<script>

function af_zoomShow(src,w,h) {
   if (typeof(afvid_stopVideo)!="undefined") afvid_stopVideo();
   winwidth = window.innerWidth ? window.innerWidth : document.body.clientWidth;
   winheight = window.innerHeight ? window.innerHeight : document.body.clientHeight;

   //faire en sorte que ?a tienne dans la page
   if (w>winwidth-60 || h>winheight-60) {
       cw=(winwidth-60)/w; ch=(winheight-60)/h;
       c=(cw>ch ? ch : cw);
       w*=c; h*=c;
   }
       popupContent='<img class=af_zoomContent src="' + src + '" width='+w+' height='+h+' border=0 />';
   if (typeof(IVW)!="undefined" && IVW.length>0) popupContent+='<img src="'+IVW.replace(/;$/,'-piczoom;')+'"?r='+escape(document.referrer)+'&d='+(Math.random()*100000)+'" width=1 height=1 alt="szmtag" style="position:absolute;" />';
   af_zoomTagsShowHide(false);
   af_zoomWindow(popupContent,w,h);
}

var af_zoomBg, af_zoomDiv;
function af_zoomWindow(popupContent,w,h) {
   if (!af_zoomBg) {
       af_zoomBg=document.createElement("DIV");
       af_zoomBg.innerHTML='&nbsp;';
       af_zoomBg.className = 'af_zoomBg';
       document.body.insertBefore(af_zoomBg,document.body.firstChild);
       af_zoomBg.onclick=af_zoomHide;
   }
   if (!af_zoomDiv) {
       af_zoomDiv=document.createElement("DIV");
       af_zoomDiv.innerHTML='&nbsp;';
       af_zoomDiv.className = 'af_zoom';
       document.body.insertBefore(af_zoomDiv,af_zoomBg);
       af_zoomDiv.onclick=af_zoomHide;
   }
   af_zoomDiv.innerHTML=popupContent;

   winwidth = window.innerWidth ? window.innerWidth : document.body.clientWidth;
   winheight = window.innerHeight ? window.innerHeight : document.body.clientHeight;

   document.body.style.margin="0px";
   af_zoomBg.style.height=document.body.scrollHeight+"px";      af_zoomDiv.style.left=((winwidth - w - 40)/2 + document.body.scrollLeft) + "px";
   af_zoomDiv.style.top=((winheight - h - 40)/2 + document.body.scrollTop) + "px";
   af_zoomDiv.style.display='';
   af_zoomBg.style.visibility='visible';
}

function af_zoomHide() {
   if (typeof(afvid_stopVideo)!="undefined") afvid_stopVideo();
   if (af_zoomBg) af_zoomBg.style.visibility='hidden';
   af_zoomDiv.style.display='none';
   af_zoomTagsShowHide(true);
}
//Bug IE : on fait "disparaitre" tous les SELECT , EMBED, OBJECT  et IFRAME de la page pour ?viter qu'ils ne passent "au-dessus" du zoom
function af_zoomTagsShowHide(show) {
   var sels=document.getElementsByTagName("select");
   for (var i=0;i<sels.length;i++) sels[i].style.visibility=(!show ? 'hidden' : 'visible');
   sels=document.getElementsByTagName("embed");
   for (var i=0;i<sels.length;i++) sels[i].style.visibility=(!show ? 'hidden' : 'visible');
   sels=document.getElementsByTagName("object");
   for (var i=0;i<sels.length;i++) sels[i].style.visibility=(!show ? 'hidden' : 'visible');
   sels=document.getElementsByTagName("iframe");
   for (var i=0;i<sels.length;i++) sels[i].style.visibility=(!show ? 'hidden' : 'visible');
}

</script>

