/*
 * Image 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-tooltip-using-jquery
 *
 */
 
this.imagetooltip = function(){	
	/* CONFIG */

		xOffset = -107;
		yOffset = 404;

		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result

	/* END CONFIG */
	jQuery(".tooltip").hover(function(e){
		this.t = this.title;
		this.title = "";
		var c = (this.t != "") ? "<br />" + this.t : "";
		jQuery("body").append('<p id="tooltip"><img src="'+ this.href +'" alt="" />'+ c +'</p>');
		jQuery("#tooltip")
			.css("left",(e.pageX + xOffset) + "px")
			.css("top",(e.pageY - yOffset) + "px")
			.show();
    },
	function(){
		this.title = this.t;
		jQuery("#tooltip").remove();
    });
	jQuery(".tooltip").mousemove(function(e){
		jQuery("#tooltip")
			.css("left",(e.pageX + xOffset) + "px")
			.css("top",(e.pageY - yOffset) + "px");
	});
};
