this.imagePreview = function(){	
	/* CONFIG */
		
		xOffset = 20;
		yOffset = -350;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("img.preview").hover(function(e){
		var path = $(this).attr('src');
		var pos = path.lastIndexOf("/");
		//alert(pos);
		var alt = $(this).attr('alt')
		var filename = path.substring(pos+1);
		//alert(filename);
		//$("body").append("<div id='preview'><h2>" + alt + "</h2><img src='images/products/medium/"+ filename +"' alt='" + this.alt + "' /></div>");								 
		//alert(filename);
		//var n = filename.substr(filename.lastIndexOf('_'),filename.length);
		//alert(n);
		//$("body").append("<div id='preview'><img src='/beta/application/assets/img/products/medium/r_"+ filename.replace('_home','_home') +"' alt='" + this.alt + "' /></div>");
		$("body").append("<div id='preview'><img src='/beta/application/assets/img/products/medium/"+ filename+"' alt='" + this.alt + "' /></div>");
		xOffset = 20;
		if($(this).hasClass('left-preview'))
			xOffset = -300;
		//alert(e.pageY);
		$("#preview")
			.css("top",(e.pageY + yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		//$("#preview").hide('fast');
		$("#preview").remove();
    });	
	$("img.preview").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY + yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px");
	});			
};
