/*
 * 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 */
if($.browser.msie) 
{ 
		xOffset = -23;
		yOffset = 12;
} else {
		xOffset = 10;
		yOffset = 10;
} 
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
//mainnavig
	$("div.screenshot").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='screenshot'><img src='/img/layout/bulle_plus.png' alt='url preview' />"+ c +"</p>");								 
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#screenshot").remove();
    });	
	$("div.screenshot").mousemove(function(e){
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
//pressnavig
	$("div.screenshot2").hover(function(e2){
		this.t = this.title;
		this.title = "";	
		var c2 = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='screenshot2'><img src='/img/layout/bulle_exclusive.png' alt='url preview' />"+ c2 +"</p>");								 
		$("#screenshot2")
			.css("top",(e2.pageY - xOffset) + "px")
			.css("left",(e2.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#screenshot2").remove();
    });	
	$("div.screenshot2").mousemove(function(e2){
		$("#screenshot2")
			.css("top",(e2.pageY - xOffset) + "px")
			.css("left",(e2.pageX + yOffset) + "px");
	});			

//newsletter
	$("div.screenshot3").hover(function(e3){
		this.t = this.title;
		this.title = "";	
		var c3 = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='screenshot3'><img src='/img/layout/bulle_fresco.png' alt='url preview' />"+ c3 +"</p>");								 
		$("#screenshot3")
			.css("top",(e3.pageY - xOffset) + "px")
			.css("left",(e3.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#screenshot3").remove();
    });	
	$("div.screenshot3").mousemove(function(e3){
		$("#screenshot3")
			.css("top",(e3.pageY - xOffset) + "px")
			.css("left",(e3.pageX + yOffset) + "px");
	});			



};

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