/*
 * Image preview script
 */
 
this.imagePreview = function(){	

	/* CONFIG */	
		xSpace = 180;
		ySpace = 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("<img id='preview' src='"+ this.href +"'/>");								 
		$("#preview")
			.css("top",(e.pageY - xSpace) + "px")
			.css("left",(e.pageX + ySpace) + "px")
			.fadeIn("fast");						
    },
	function(){	
		$("#preview").remove();
    });	
	$("a.preview").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xSpace) + "px")
			.css("left",(e.pageX + ySpace) + "px");
	});			
};

// starting the script on page load
$(document).ready(function(){
	imagePreview();
});

