/*
 * Tooltip script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
 


this.tooltip = function(){	
	
		xOffset = 10;
		yOffset = -20;		
		// these 2 variable determine popup's distance from the cursor

//tooltip_1	
	$("a.tooltip_1").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<div id='tooltip_1' class='tooltip_item'><h3>"+ this.t +"</h3></div>");
		$("#tooltip_1")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip_1").remove();
    });	
	$("a.tooltip_1").mousemove(function(e){
		$("#tooltip_1")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});	


//tooltip_2	
	$("a.tooltip_2").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<div id='tooltip_2' class='tooltip_item'><h3>"+ this.t +"</h3></div>");
		$("#tooltip_2")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip_2").remove();
    });	
	$("a.tooltip_2").mousemove(function(e){
		$("#tooltip_2")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});	


//tooltip_3	
	$("a.tooltip_3").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<div id='tooltip_3' class='tooltip_item'><h3>"+ this.t +"</h3></div>");
		$("#tooltip_3")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip_3").remove();
    });	
	$("a.tooltip_3").mousemove(function(e){
		$("#tooltip_3")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});	


};


// starting the script on page load
$(document).ready(function(){
	tooltip();
});