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(b){$(b+"a[href*='showphoto']").bind("click",function(e){var a=$(this).attr("href");if(a!=undefined){a=a.substring(a.indexOf("path")+5);e.preventDefault();$("#cm,#c2").append("<div id=photoZoom style='display:none;'><p class=wait><img src='x/loader.gif'><br>Un instant</p><p class=loadhere></p></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();$(this).find(".loadhere").load("x/zoom.php?path="+a,function(){$("#photoZoom .loadhere img").bind("click",function(c){$("#photoZoom").dialog("close")})})}})}})}$(document).ready(function(){bindZoom("")});