
function vignettedim(img){
 if(document.getElementById){
      var el;
      el = document.getElementById("listimg"+img);
      if(el){
        el.style.opacity = (0.3);
        el.style.filter = "Alpha(opacity=60 , finishopacity=0 , style=2)";
      }
      el = document.getElementById("listtext"+img);
      if(el){
        if(el.className && el.className == 'textlistitempromo'){
          el.style.backgroundImage = "url(/images/etoilebleue.png)";
        }
        el.style.backgroundColor = "#FFBB00";
      }
    }
}

function vignetteundim(img){
 if(document.getElementById){
      var el;
      el = document.getElementById("listimg"+img);
      if(el){
          el.style.opacity = (1);
          el.style.filter = "";
      }
      el = document.getElementById("listtext"+img);
      if(el){
        if(el.className && el.className == 'textlistitempromo'){
          el.style.backgroundImage = "url(/images/etoileorange.png)";
        }
        el.style.backgroundColor = "#00AAFF";
      }
    }
}


function zoom(elout , elin){
      elin.style.display = "block";
      elout.style.display = "none";
}

function zoomarticleout(situation){
 if(document.getElementById){
   var elin;
   var elout = document.getElementById("articlewrapper");
   if(situation){
     elin = document.getElementById("imgsituationzoom");
   }else{
     elin = document.getElementById("imgarticlezoom");
   }
   if(elin && elout){
    hidearticlezoomout(situation);
    zoom(elout , elin)
   }
  }
}

function zoomarticlein(situation){
 if(document.getElementById){
   var elout;
   var elin = document.getElementById("articlewrapper");
   if(situation){
     elout = document.getElementById("imgsituationzoom");
   }else{
     elout = document.getElementById("imgarticlezoom");
   }
   if(elin && elout){
    hidearticlezoomin(situation);
    zoom(elout , elin)
   }
  }
}


function showarticlezoomout(situation){
 if(document.getElementById){
   var el;
   if(situation){
     el = document.getElementById("imgsituationzoomout");
   }else{
    el = document.getElementById("imgzoomout");
   }
    if(el){
      el.style.display = "block";
    }
  }
}

function hidearticlezoomout(situation){
if(document.getElementById){
   var el;
   if(situation){
     el = document.getElementById("imgsituationzoomout");
   }else{
    el = document.getElementById("imgzoomout");
   }
    if(el){
      el.style.display = "none";
    }
    }
}

function showarticlezoomin(situation){
 if(document.getElementById){
   var el;
   if(situation){
     el = document.getElementById("imgsituationzoomin");
   }else{
    el = document.getElementById("imgzoomin");
   }
      if(el){
        el.style.display = "block";
      }
    }
}
function hidearticlezoomin(situation){
 if(document.getElementById){
   var el;
   if(situation){
     el = document.getElementById("imgsituationzoomin");
   }else{
    el = document.getElementById("imgzoomin");
   }
      if(el){
        el.style.display = "none";
      }
    }
}


var opacityout;
var imgout;
var imgin;
var indice;

function setopacity(){
    var elout = document.getElementById(imgout);
    var elin = document.getElementById(imgin);
    if(elin && elout){
      elout.style.opacity = (this.opacityout / 100);
      elout.style.filter = "alpha(opacity=" + this.opacityout + ")";
      var opacityin = 100 - this.opacityout;
      elin.style.opacity = (opacityin / 100);
      elin.style.filter = "alpha(opacity=" + opacityin + ")";
      return true;
    }
    else{
      return false;
    }
}

function starttransition() {
    indice = 0;
    imgout = document.imagesaccueil[indice];
    indice = 1;
    imgin = document.imagesaccueil[indice];
    this.opacityout = 100;
    if(setopacity()){
      window.setTimeout("imagetransition()", 4000);
    }
    else{
      window.setTimeout("starttransition()", 10);
    }
}

function imagetransition(){
    this.opacityout = this.opacityout- 1;
    setopacity();
    if(opacityout > 0){
        window.setTimeout("imagetransition()", 20);
    }
    else{
        opacityout = 100;
        imgout = document.imagesaccueil[indice];
        indice++;
        if(indice>=document.imagesaccueil.length){
          indice = 0;
        }
        imgin = document.imagesaccueil[indice];
        window.setTimeout("imagetransition()", 4000);
    }
}

