"use strict";jQuery.fn.fancyZoom=function(varOptions){var options,directory,zooming,zoom,zoom_table,zoom_close,zoom_content,middle_row,ext,html;function switchBackgroundImagesTo(varTo){$("#zoom_table td").each(function(i){var bg=$(this).css("background-image").replace(/\.(png|gif|none)\"\)$/,"."+varTo+'")');$(this).css("background-image",bg)});var close_img,new_img;close_img=zoom_close.children("img");new_img=close_img.attr("src").replace(/\.(png|gif|none)$/,"."+varTo);close_img.attr("src",new_img)}function fixBackgroundsForIE(){if($.browser.msie&&parseFloat($.browser.version)>=7){switchBackgroundImagesTo("gif")}}function unfixBackgroundsForIE(){if($.browser.msie&&$.browser.version>=7){switchBackgroundImagesTo("png")}}function hide(varEvt){if(zooming){return false}zooming=true;$("#zoom").unbind("click");fixBackgroundsForIE();if(zoom_close.attr("scaleImg")!=="true"){zoom_content.html("")}zoom_close.hide();$("#zoom").animate({top:zoom_close.attr("curTop")+"px",left:zoom_close.attr("curLeft")+"px",opacity:"hide",width:"1px",height:"1px"},500,null,function(){if(zoom_close.attr("scaleImg")==="true"){zoom_content.html("")}unfixBackgroundsForIE();zooming=false});return false}function show(varEvt){if(zooming){return false}zooming=true;var content_div,zoom_width,zoom_height,width,height,x,y,window_size,d,newTop,newLeft,curTop,curLeft;content_div=$($(this).attr("href"));zoom_width=options.width;zoom_height=options.height;width=window.innerWidth||(window.document.documentElement.clientWidth||window.document.body.clientWidth);height=window.innerHeight||(window.document.documentElement.clientHeight||window.document.body.clientHeight);x=window.pageXOffset||(window.document.documentElement.scrollLeft||window.document.body.scrollLeft);y=window.pageYOffset||(window.document.documentElement.scrollTop||window.document.body.scrollTop);window_size={width:width,height:height,x:x,y:y};width=(zoom_width||content_div.width())+60;height=(zoom_height||content_div.height())+60;d=window_size;newTop=Math.max((d.height/2)-(height/2)+y,0);newLeft=(d.width/2)-(width/2);curTop=varEvt.pageY;curLeft=varEvt.pageX;zoom_close.attr("curTop",curTop);zoom_close.attr("curLeft",curLeft);zoom_close.attr("scaleImg",options.scaleImg?"true":"false");$("#zoom").hide().css({position:"absolute",top:curTop+"px",left:curLeft+"px",width:"1px",height:"1px"});fixBackgroundsForIE();zoom_close.hide();if(options.closeOnClick){$("#zoom").click(hide)}if(options.scaleImg){zoom_content.html(content_div.html());$("#zoom_content img").css("width","100%")}else{zoom_content.html("")}$("#zoom").animate({top:newTop+"px",left:newLeft+"px",opacity:"show",width:width,height:height},500,null,function(){if(options.scaleImg!==true){zoom_content.html(content_div.html())}unfixBackgroundsForIE();zoom_close.show();zooming=false});return false}options=varOptions||{};directory=options&&options.directory?options.directory:"images";zooming=false;if($("#zoom").length===0){ext=$.browser.msie?"gif":"png";html=' \n<div id="zoom" style="display:none;">\n  <table id="zoom_table" style="border-collapse:collapse; width:100%; height:100%;">\n    <tbody>\n    <tr>\n      <td class="hautgauche" style="background:url('+directory+"/hautgauche."+ext+') 0 0 no-repeat; width:20px; height:20px; overflow:hidden;" />\n      <td class="hautcentre" style="background:url('+directory+"/hautcentre."+ext+') 0 0 repeat-x; height:20px; overflow:hidden;" />\n      <td class="hautdroite" style="background:url('+directory+"/hautdroite."+ext+') 100% 0 no-repeat; width:20px; height:20px; overflow:hidden;" />\n    </tr>\n    <tr>\n      <td class="milieugauche" style="background:url('+directory+"/milieugauche."+ext+') 0 0 repeat-y; width:20px; overflow:hidden;" />\n      <td class="milieucentre" style="background:#FFF; vertical-align:top; padding:10px;"><div id="zoom_content"></div></td>\n      <td class="milieudroite" style="background:url('+directory+"/milieudroite."+ext+') 100% 0 repeat-y;  width:20px; overflow:hidden;" />\n    </tr>\n    <tr>\n       <td class="basgauche" style="background:url('+directory+"/basgauche."+ext+') 0 100% no-repeat; width:20px; height:20px; overflow:hidden;" />\n       <td class="bascentre" style="background:url('+directory+"/bascentre."+ext+') 0 100% repeat-x; height:20px; overflow:hidden;" />\n      <td class="basdroite" style="background:url('+directory+"/basdroite."+ext+') 100% 100% no-repeat; width:20px; height:20px; overflow:hidden;" />\n    </tr>\n    </tbody>\n  </table>\n  <a href="#" title="Fermer" id="zoom_close" style="position:absolute; top:0px; left:0px;">\n    <img src="'+directory+"/closebox."+ext+'" alt="Fermer" style="border:none; margin:0; padding:0;" />\n  </a>\n</div>\n';$("body").append(html);$("html").click(function(varEvent){if($(varEvent.target).parents("#zoom:visible").length===0){hide()}});$(document).keyup(function(varEvent){if(varEvent.keyCode===27&&$("#zoom:visible").length>0){hide()}});$("#zoom_close").click(hide)}zoom=$("#zoom");zoom_table=$("#zoom_table");zoom_close=$("#zoom_close");zoom_content=$("#zoom_content");middle_row=$("td.milieugauche, td.milieucentre, td.milieudroite");this.each(function(varI){$($(this).attr("href")).hide();$(this).click(show)});return this};

