/*
 * 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(){	
	var target = arguments[0];
	var xOffset = arguments[1];
	var yOffset = arguments[2];
	var appendId = arguments[3];
	$(target).hover(function(e){
		imgrollover(this, true);
		this.t = this.title;
		this.title = "";									  
		$("body").append("<div id='"+appendId+"'><div class=\"top\"></div><p>"+ this.t +"</p><div class=\"bottom\"></div></div>");
		$("#"+appendId)
			.css("top",(e.pageY + yOffset - $("#"+appendId).height()) + "px")
			.css("left",(e.pageX + xOffset) + "px")
			.show();		
    },
	function(){
		imgrollover(this, false);
		this.title = this.t;		
		$("#"+appendId).remove();
    });	
	$(target).mousemove(function(e){
		$("#"+appendId)
			.css("top",(e.pageY + yOffset - $("#"+appendId).height()) + "px")
			.css("left",(e.pageX + xOffset) + "px");
	});			
};


