/*
 * 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
 *
 */

this.screenshotPreview = function(){	
	/* CONFIG */

	var rightOffset = 228; // the right hand side of the image relative to the centre of the page
	//var topOffset = -10; // the top of the image relative to the mouse
	
	/* END CONFIG */
		
	$("a.screenshot").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		//$("body").append("<p id='screenshot'><img src='"+ this.rel +"' alt='url preview' />"+ c +"</p>");								 
		$("body").append("<div id='screenshot'><div class='screenborder'><img src='"+ this.rel +"' alt='url preview' />"+ c +"</div></div>");								 

		$("#screenshot")
			.css("top", "152px")
			.css("margin-right", (-rightOffset) + "px")
			.css("right", "50%")
			.fadeIn("slow");
    },
	function(){
		this.title = this.t;	
		$("#screenshot").remove();
    });	
};


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