/*
 * Url preview 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
 *
 */
 



// starting the script on page load
jQuery(document).ready(function($){
/* CONFIG */
		
		xOffset = 30;
		yOffset = 200;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
  



	jQuery("a.catalogue_item_preview").hover(function(e){

		//this.t = this.title;
		this.t = "";
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		jQuery("body").append("<p id='catalogue_item_preview'><img src='"+ this.rel +"' alt='item preview' />"+ c +"</p>");								 
		jQuery("#catalogue_item_preview")
			.css("top",(e.pageY - yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		jQuery("#catalogue_item_preview").remove();
    });	
	jQuery("a.catalogue_item_preview").mousemove(function(e){
		jQuery("#catalogue_item_preview")
			.css("top",(e.pageY - yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px");
	});			

});