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 */
	$(".thumbEl .thumbnails img").hover(function(e){
		$("body").append("<p id='preview'><img id='preview_img' src='"+ $(this).attr('src') +"' alt='' /></p>");								 
		$('#preview_img').css('height','400px');
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.css('position','absolute')
			.css('z-index','99999')
			.fadeIn("fast");
	},
	function(){
		$("#preview").remove();
    });	
	$(".preview").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});
};


// starting the script on page load
$(document).ready(function(){
	imagePreview();
});
