
this.screenshotPreview = function(){   
        /* CONFIG */
               
                //xOffset = 66;
                //yOffset = document.body.clientWidth/2-292;
				xOffset = 82;
                yOffset = 301;
               
                // these 2 variable determine popup's distance from the cursor
                // you might want to adjust to get the right result
               
        /* END CONFIG */
        $("a.screenshot").hover(function(e){
                $("body").append("<div id='screenshot'><img src='"+ this.rel +"' alt='url preview' /></div>");                                                                
               
			   if (document.body.clientWidth > 907) {
					$("#screenshot")
	                        .css("top",(xOffset) + "px")
							.css("left",(document.body.clientWidth/2 - yOffset) + "px")
							.fadeIn("fast");
				}
				else
					$("#screenshot")
	                        .css("top",(xOffset) + "px")
							.css("width", "640px")
							.css("left", "152px")
							.fadeIn("fast");
				
    },
        function(){
                this.title = this.t;   
                $("#screenshot").remove();
    }); 
        $("a.screenshot").mousemove(function(e){
                $("#screenshot")
                        .css("top",(xOffset) + "px")
                        .css("left",(document.body.clientWidth/2 - yOffset) + "px");
        });                    
};
this.imagePreview = function(){ 
        /* CONFIG */
               
                xOffset =  82;
                yOffset = 292;
               
                // 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("<div id='preview'><img src='"+ this.href +"' alt='Image preview' /></div>");                                                                

				if (document.body.clientWidth > 907) {
					$("#preview")
	                        .css("top",(xOffset) + "px")
							.css("left",(document.body.clientWidth/2 - yOffset) + "px")
							.fadeIn("fast");
				}
				else
					$("#preview")
	                        .css("top",(xOffset) + "px")
							.css("width", "640px")
							.css("left", "152px")
							.fadeIn("fast");
    },
        function(){
                this.title = this.t;   
                $("#preview").remove();
    }); 
        $("a.preview").mousemove(function(e){
	
				if (document.body.clientWidth > 907) {
					$("#preview")
	                        .css("top",(xOffset) + "px")
							.css("left",(document.body.clientWidth/2 - yOffset) + "px")
							.fadeIn("fast");
				}
				else
					$("#preview")
	                        .css("top",(xOffset) + "px")
							.css("width", "640px")
							.css("left", "152px")
							.fadeIn("fast");
				
        });                    
};
this.tooltip = function(){     
        /* CONFIG */           
                xOffset = 82;
                yOffset = 292;  
                // these 2 variable determine popup's distance from the cursor
                // you might want to adjust to get the right result            
        /* END CONFIG */               
        $("a.tooltip").hover(function(e){                                                                                        
                this.t = this.title;
                this.title = "";                                                                         
                $("body").append("<p id='tooltip'>"+ this.t +"</p>");
                $("#tooltip")
                        .css("top",(xOffset) + "px")
							.css("margin-left", "auto")
							.css("margin-right", "auto")
							.css("width", "640px")
							.fadeIn("fast");        
    },
        function(){
                this.title = this.t;           
                $("#tooltip").remove();
    }); 
        $("a.tooltip").mousemove(function(e){
                $("#tooltip")
                        .css("top",(xOffset) + "px")
                        .css("left",(document.body.clientWidth/2 - yOffset) + "px");
        });                    
};


$(document).ready(function(){
        tooltip();//active les tooltip simple
        imagePreview();//active les tooltip image preview
        screenshotPreview();//active les tooltip lien avec preview
});
