

function selectmenu(menu){
     if(document.getElementById){
      var el = document.getElementById("top_" + menu);
      if(el){
          if(menu == 'contact'){
           el.style.background = "url('/images/" + menu + "_on.png')";
          }
          else{
           el.style.background = "url('/images/" + lang + "/top/" + menu + "_on.png')";
          }
      }
  }
}
function checksize(){
  if(document.forms["customform"]){
    if(document.forms["customform"].largeur && document.forms["customform"].hauteur){
      if(!checkint(document.forms["customform"].largeur , 15)){
        alert(str_largeur + ' >=  15');
      }
      var l = document.forms["customform"].largeur.value;
      if(!checkint(document.forms["customform"].hauteur , 15)){
        alert(str_hauteur + ' >=  15');
      }
    }
  }
}

function calculateprix(){
  if(document.forms["customform"]){
     if(document.forms["customform"].largeur && document.forms["customform"].hauteur){
       if(!checkint(document.forms["customform"].largeur , 25)){
        alert(str_largeur + ' >=  25');
       }
       var l = document.forms["customform"].largeur.value;
       if(!checkint(document.forms["customform"].hauteur , 25)){
        alert(str_hauteur + ' >=  25');
       }
       var h = document.forms["customform"].hauteur.value;
       var x = l*h;
       var v = 0;
       if(x<=2500){
         // v = 0.02*x;
         v = 0.05*x;
       }
       else if(x<=6000){
        //  v = 0.015*x;
         v = 0.03*x;
       }
       else if(x<=10000){
        //  v = 0.01*x;
         v = 0.02*x;
       }
       else if(x<=2000){
        // v = 0.0075*x;
          v = 0.0150*x;
       }
       else{
        // v =  v = 0.005*x;
          v = 0.01*x;
       }
       v = Math.round(v);
       if(document.getElementById){
         var el;
         el = document.getElementById("customprixindicatif");
         if(el){
           el.innerHTML  = "" + v + " \u20AC";
         }
       }
       return true;
     }
  }
  return false;
}

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- 3;
    setopacity();
    if(opacityout > 0){
        window.setTimeout("imagetransition()", 100);
    }
    else{
        opacityout = 100;
        imgout = document.imagesaccueil[indice];
        indice++;
        if(indice>=document.imagesaccueil.length){
          indice = 0;
        }
        imgin = document.imagesaccueil[indice];
        window.setTimeout("imagetransition()", 4000);
    }
}
