
var offset=10;var real_width;var real_height;var page_width;var win_img;function VoirImg(img)
{var d;var tabm=new Array();var nwin;nwin="win_"+base;page_width=430;page_height=630;win_img=window.open('',nwin,'width='+page_width.toString()+',height='+page_height.toString()+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes',true);tabm=img.split("/");win_img.focus();d=win_img.document;d.open();d.write("<HTML>\n");d.write("<SCRIPT>\n");d.write("window.focus();\n");d.write("var offset="+offset.toString()+"\n");d.write("var img ;\n");d.write("function ResizeWin() {\n");d.write("img=window.document.images[\"myimg\"];\n");d.write("opener.real_width = img.offsetWidth-offset;\n");d.write("opener.real_height = img.offsetHeight-offset;\n");d.write("window.resizeTo(img.width+30,img.height+130) ;\n");d.write("img.ondblclick=opener.zoom;\n");d.write("img.onmousedown=opener.rcz;\n");d.write("img.style.cursor=\'nw-resize\';\n");d.write("img.title=\'Maintenez enfoncée la touche gauche de la souris et déplacez le pointeur pour redimensionner la photo !\';\n");d.write("opener.zoom();\n");d.write("return false ;\n");d.write("}\n");d.write("</SCRIPT>\n");d.write("<HEAD>\n");d.write("<TITLE>"+tabm[tabm.length-1]+"</TITLE>");d.write("</HEAD>\n");d.write("<BODY BGCOLOR=#FFFAEF>\n");d.write("<BODY BGCOLOR=\"#FFFAEF\" TEXT=\"#000000\" LINK=\"#009999\" VLINK=\"#E0968F\">\n");d.write("<SCRIPT>window.focus();</SCRIPT>\n");d.write("<DIV ID=\"entete\">\n");d.write("<TABLE WIDTH=\"100%\" BORDER=\"0\" CELLSPACING=\"0\" BGCOLOR=\"#009999\">\n<TR>\n");d.write("<TD ALIGN=\"center\" WIDTH=\"10%\"><B>&#160;Image</B></A></TD>\n");d.write("<TD WIDTH=\"94%\"><IMG HEIGHT=\"32\" SRC=\"/icons/rempl.gif\"></TD>\n");d.write("<TD ALIGN=\"center\" WIDTH=\"1%\"><SPAN ID=\"pc\">100%</SPAN></TD>\n");d.write("<TD WIDTH=\"1%\"><IMG HEIGHT=\"32\" SRC=\"/icons/rempl.gif\"></TD>\n");d.write("<TD WIDTH=\"1%\" VALIGN=\"bottom\"><A HREF=\"javascript:opener.zoom(\'=\');\"><IMG ALIGN=\"bottom\" HEIGHT=\"32\" SRC=\"/icons/imgadapt.gif\" ALT=\"Adapter la taille de l'image !\" TITLE=\"Adapter la taille de l'image !\" BORDER=\"0\"></A></TD>\n");d.write("<TD WIDTH=\"1%\" VALIGN=\"center\"><A HREF=\"javascript:opener.zoom(\'+\');\"><IMG HEIGHT=\"32\" SRC=\"/icons/zoomin.gif\" ALT=\"Agrandir la taille de l'image\" TITLE=\"Agrandir la taille de l'image\" BORDER=\"0\"></A></TD>\n");d.write("<TD WIDTH=\"1%\" VALIGN=\"center\"><A HREF=\"javascript:opener.zoom(\'-\');\"><IMG HEIGHT=\"32\" SRC=\"/icons/zoomout.gif\" ALT=\"Diminuer la taille de l'image\n\" TITLE=\"Diminuer la taille de l'image\" BORDER=\"0\"></A></TD>\n");d.write("<TD WIDTH=\"1%\" VALIGN=\"center\"><A HREF=\"javascript:close();\"><IMG HEIGHT=\"32\" SRC=\"/icons/clore.gif\" ALT=\"Clore la page\" BORDER=\"0\"></A></TD>\n</TR>\n");d.write("<TR>\n<TD COLSPAN=\"8\" BGCOLOR=\"#FFFAEF\" HEIGHT=\"2\"></TD>\n</TR>\n");d.write("<TR>\n<TD COLSPAN=\"8\" HEIGHT=\"2\" BGCOLOR=\"#009999\"></TD>\n</TR>\n");d.write("</TABLE>\n</DIV><BR>\n");d.write("<CENTER><DIV ID=\"img\">\n");d.write("<IMG NAME=\"myimg\" SRC="+img+" ALIGN=\"center\" onLoad=\"ResizeWin();\" BORDER=\"0\" ALT=\"\">\n");d.write("</DIV></CENTER>\n");d.write("<SCRIPT>\n");d.write("window.onresize=function(){if (opener.page_width!=document.getElementById(\'entete\').offsetWidth-offset) opener.zoom()}\n");d.write("</SCRIPT>\n");d.write("</BODY>\n");d.write("</HTML>\n");d.close();win_img.focus();return false;}
function zoom(val)
{d=win_img.document;page_width=d.getElementById('entete').offsetWidth-offset;img=d.images["myimg"];if(!isNaN(val)&&val)
var width=real_width*val/100;else if(val=='=')
var width=real_width;else if(val=='+'||val=='-')
var width=(img.offsetWidth-14)*Math.pow(1.2,val=='-'?-1:1);else
var width=Math.min(real_width,page_width);width=width/real_width<0.2?real_width*0.2:width/real_width>2?real_width*2:width;img.setAttribute('width',Math.round(width));img.setAttribute('height',Math.round(width*real_height/real_width));img.style.marginLeft=Math.max((page_width-width)/2,0)+'px';img.style.marginRight=img.style.marginLeft;win_img.ratio=Math.round(width/real_width*100);d.getElementById('pc').innerHTML=win_img.ratio.toString()+'%';}
function rcz(e)
{win_img.lastY=e.clientY;img=win_img.document.images["myimg"];if(e&&e.preventDefault)
e.preventDefault();else
img.ondragstart=function(){return false}
img.onmousemove=function(e){if(dif=(e.clientY-win_img.lastY)*win_img.ratio/250)
zoom(win_img.ratio+(Math.abs(dif)>1?dif:(dif>0?1:-1)));win_img.lastY=e.clientY;}
img.onmouseup=img.onmouseout=function(){img.onmousemove=null}}
function ChargerImg(self,img)
{return false;}
function lstobj(objet)
{names="";for(var i in objet)
names+=i+"\n";alert(names);}
