/*
 * 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
 *
 */
 
var t_help;


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



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