this.imagePreview = function(){	
	/* CONFIG */
		
		xOffset = 10;
		yOffset = 30;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("a.preview").hover(function(e){
		$("body").append("<p id='imgPreview' class='borderGrey'><img src='"+ this.href +"' alt=' ' /></p>");								 
		$("#imgPreview")
			.css("position", "absolute")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		$("#imgPreview").remove();
    });	
	$("a.preview").mousemove(function(e){
		$("#imgPreview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

$(document).ready(function(){
	imagePreview();
});