function showZoom(){$("#photoZoom .wait").hide();var w=parseInt($(".loadhere img").attr("width"))+20;var h=parseInt($(".loadhere img").attr("height"))+75;var l=parseInt($(".ui-dialog-container").parent().css("left"));var t=parseInt($(".ui-dialog-container").parent().css("top"));l=Math.max(10,l-(w-150)/2);t=Math.max(10,t-(h-150)/2);$(".ui-dialog-container").parent().animate({left:l+"px",top:t+"px",width:w+"px",height:h+"px"},200,function(){$("#photoZoom img").animate({opacity:1},100)})};function bindZoom(f){$(f+"a[href*='showphoto']").bind("click",function(e){e.preventDefault();var a=$(this).attr("href");var b=$(this).find('img').attr("wz");if(b==undefined){b=$(this).attr("wz")}var d=$(this).find('img').attr("hz");if(d==undefined){d=$(this).attr("hz")}a=unescape(a.substring(a.indexOf("path")+5));if(a!=undefined&&b!=undefined&&d!=undefined){$("#cm,#c2").append("<div id=photoZoom style='display:none;'><p class=wait><img src='x/loader.gif'><br>Un instant</p><div class='loadhere'><div><img oncontextmenu='return false;' onmousemove='return false;' ONLOAD='showZoom();' style='filter: alpha(opacity=0);opacity:0;' src='"+a+"' width='"+b+"' height='"+d+"'></div></div></div>");$("#photoZoom").dialog({draggable:false,width:150,height:150,resizable:false,modal:true,title:"Zoom",overlay:{opacity:0.5,background:"#000"},buttons:{"Fermer":function(){$(this).dialog("close")}},close:function(){$(".papage .pact_hr,#pb,#pd,.pubfiche,.zoomcon").show();$(this).dialog("destroy").remove()},open:function(){$(this).css("display","");$(".papage .pact_hr,#pb,#pd,.pubfiche,.zoomcon").hide();$("#photoZoom .loadhere img").bind("click",function(c){$("#photoZoom").dialog("close")})}})}})}$(document).ready(function(){bindZoom("")});
