var ncur=""; //ID current!
var txZoom;
var pasZoom;
var delaiZoom;
var vign_width;
var big_width;
var vign_height;
var imgId="";

var go1,go0;

///////////////////////////////////////////////////////
function initZoom(prefix,taux,pas,delai,vwidth,vheight){
 imgId=prefix;
 txZoom=1.3;//taux;
 pasZoom=pas;
 delaiZoom=delai;
 vign_width=vwidth;
 big_width=vwidth*txZoom;
 vign_height=vheight;
}

function Zoomer(big,idCur){
 if(ncur=="" || ncur==idCur) {
   ncur=idCur;
   (big==1)?expand():reduce();
 }
}

function expand() {
 img=document.getElementById(ncur);


 wcur=img.width;
 hcur=img.height;

 if(vign_width==0){
     vign_width=wcur;
 }
 if(vign_height==0){
     vign_height=hcur;
 }

 if (wcur<big_width) {
  img.style.width=wcur+pasZoom;
  img.style.height=hcur+pasZoom;
  go1=window.setTimeout('expand()', delaiZoom)
 }
 else{
    //y=setTimeout('reduce()', 100)
    ncur="";
 }
}

function reduce() {
 img=document.getElementById(ncur);
 if(go1) {clearTimeout(go1);}

 wcur=img.width;
 hcur=img.height;
 wbig=img.width*txZoom;


 if (wcur>vign_width) {
  go0=window.setTimeout('reduce()', delaiZoom/2)
  img.style.width=wcur - pasZoom;
  img.style.height=hcur - pasZoom;
 }else{
   ncur="";
 }

}
//////////////////////////////////////////////////////////


