var wPopup;


function zoom_launch(zoom_img,t1,t2,t3,n1,n2) {
   // Si la fenêtre n'existe pas ou est fermée, on la réouvre
   if(!wPopup || wPopup.closed) {
      wPopup = window.open('zoom.php?img='+zoom_img+'&t1='+t1+'&t2='+t2+'&t3='+t3+'&n1='+n1+'&n2='+n2,
                           '',
//                           'width='+screen.width+', height=='+screen.height+', top='+(screen.height-50)/2+', left='+(screen.width-50)/2+', status=no, directories=no, toolbar=no, location=no, menubar=no, scrollbars=no, resizable=yes');
                           'width='+screen.width+', height=='+screen.height+', top=0, left=0, status=no, directories=no, toolbar=no, location=no, menubar=no, scrollbars=yes, resizable=yes, fullscreen=yes');

   }
   wPopup.focus();
}



function zoom_checkSize() {
   if(document.images && document.images[0].complete) {
      w = document.images[0].width+50;
      h = document.images[0].height+100;
      w=screen.width;
      h=screen.height;
      //alert(w+'/'+h);
      //window.resizeTo(w, h);
      //window.moveTo((screen.width-w)/2, (screen.height-h)/2);
      window.moveTo(0,0);
      document.images[0].style.visibility = "visible";
      window.focus();
   } else { setTimeout("zoom_checkSize()", 250); }
}

function zoom_aff(img, imgb, t1, t2, t3, n1, n2) {
   if (img  == '') img  = imgb;
   if (imgb == '') imgb = img;
   //alert(imgb);
   if (n1 == 0 ) n1 = 300;
   w1 = ' '
   //if (n1 != -1) w1 = ' width='+n1;
   if (n1 != -1) w1 = ' height='+n1;
   if (n2 == -1) w1 = ' width='+n1;

   document.write('<a href="javascript:zoom_launch(\''+img+'\',\''+t1+'\', \''+t2+'\',\''+t3+'\', '+n1+', '+n2+')">');
   document.write('<img border=1 '+w1+' src="'+imgb+'"></a>');
}

