function showZoom(){$("#photoZoom .wait").hide();var w=parseInt($(".loadhere img").attr("width"))+20;var h=parseInt($(".loadhere img").attr("height"))+75;var lignes=$("#photoZoom .descp br").length;if(lignes>0){h=h+20+(10*lignes)}else{if($("#photoZoom .descp").html()!=null){h=h+25}}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)})};$(document).ready(function(){$("a[href*='showphoto=']").bind("click",function(e){var theURL=$(this).attr("href");if(theURL!=undefined){var photonum=theURL.substring(theURL.indexOf("showphoto=")+10);theURL="photos/"+photonum+".jpg";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,embed").show();$(this).dialog("destroy").remove()},open:function(){$(this).css("display","");$(".papage .pact_hr,#pb,#pd,.pubfiche,.zoomcon,embed").hide();$(this).find(".loadhere").load("x/zoomtext.php?path="+theURL+"&photo="+photonum,function(){$("#photoZoom .loadhere img").bind("click",function(c){$("#photoZoom").dialog("close")})})}})}})});
