/* Image 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.imgpreview1 = function(){
	var yOffset=250; var xOffset=20;
	var xPos=0; yPos=0;
	$("a.aimgpreview1").hover(function(e){
		this.t = this.title; this.title = ""; var c = (this.t != "") ? "<br/>" + this.t : "";		
		switch(this.rel)
		{
		case "ITEM_ZOOM" :
			yOffset=370; var xOffset=350; xPos=e.pageX+xOffset; yPos=e.pageY-yOffset;
			//xPos=360; yPos=200;
			break;		
		default :
			if(parseInt(e.pageX)>parseInt($(window).width()/2)){xOffset=-620;} else {xOffset=20;}
			xPos=e.pageX+xOffset; yPos=e.pageY-yOffset;
			break;
		}
				
		$("body").append("<p id='imgpreview1'><img src='"+ this.href +"' alt='Cliquez pour fermer' />"+ c +"</p>");								 
		$("#imgpreview1").css("left",xPos).css("top",yPos).fadeIn("fast");
		return false;
    },
	function(){
		this.title = this.t; $("#imgpreview1").remove();
    });

	$("a.aimgpreview1").click(function(){return false;});
};
