/*
 * 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(){	
	/* CONFIG */		
		xOffset = 40;
		yOffset = 0;
		var tooltipheight = 0;
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$(".blacktooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";
		if ($(this).hasClass('fidorreg')) xOffset = 60; else xOffset = 40;
		$("body").append("<div id='tooltip' class='tooltip'><div class='tooltiptext'>"+ this.t +"</div></div>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset - tooltipheight) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;
		$("#tooltip").remove();
	});	
	$("a.tooltip").mousemove(function(e){
		if ($(this).hasClass('fidorreg')) xOffset = 60; else xOffset = 40;
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};
this.redtooltip = function(){	
	$(".redtooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<div id='redtooltip' class='tooltip redtooltip'><div class='tooltiptext'>"+ this.t +"</div></div>");
		$("#redtooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#redtooltip").remove();
    });	
	$("a.redtooltip").mousemove(function(e){
		$("#redtooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};
$(document).ready(function(){
	tooltip();
	redtooltip();
});
