jQuery(document).ready(function(){
	
	
	tooltip();
	
	var postvals     = jQuery('#post_vals').attr('value'); 
	var iid  ;

	 jQuery.ajax({  
		 	type: "POST",  
             url: "http://www.telopar.net/wp-content/themes/iMCPooBaH/js/ajax_1.php",  
             data: postvals,
             success: function(result) { iid = result;},
             error: function( XMLHttpRequest, textStatus, errorThrown){
             		alert('load failure ' + errorThrown + textStatus)}

		 });  


	jQuery(window).unload( function () { 


		 jQuery.ajax({  
		 	type: "POST",  
             url: "http://www.telopar.net/wp-content/themes/iMCPooBaH/js/ajax.php",  
             data: "iid="+ iid
             
              
		 });  
		 
	});

	
	




});

this.tooltip = function(){	
	/* CONFIG */		
		xOffset = -10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	jQuery("a.tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		jQuery("body").append("<span id='tooltip'>"+ this.t +"</span>");
		jQuery("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		jQuery("#tooltip").remove();
    });	
	jQuery("a.tooltip").mousemove(function(e){
		jQuery("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

/*
(function(jQuery) { 

jQuery.fn.saveClicks = function() {
  jQuery(this).bind('mousedown.clickmap', function(evt) {
        jQuery.post('/home/vhosts/acctname/gct/telopar.net/www.telopar.net/public_html/wp-content/themes/iMCPooBaH/clickmap.php', {
            x:evt.pageX,
            y:evt.pageY,
            l:escape(document.location.pathname)
        });
    });
}; 

jQuery.fn.stopSaveClicks = function() {
     jQuery(this).unbind('mousedown.clickmap');
};

})(jQuery); 

this.displayClicks = function(settings) {
    jQuery('<div id="clickmap-overlay"></div>').appendTo('body');
    jQuery('<div id="clickmap-loading"></div>').appendTo('body');
    jQuery.get('/home/vhosts/acctname/gct/telopar.net/www.telopar.net/public_html/wp-content/themes/iMCPooBaH/clickmap.php', { l:escape( document.location.pathname) },
        function(htmlContentFromServer) {
            jQuery(htmlContentFromServer).appendTo('body');
            jQuery('#clickmap-loading').remove();
        }
    );
}; 

this.removeClicks = function() {
    jQuery('#clickmap-overlay').remove();
    jQuery('#clickmap-container').remove();
}; */
