// NAVIGATION //

var blnOk=true;

function Chargement() {

  if(document.body.style.backgroundColor!="") { blnOk=false; }
  if(document.body.style.color!="") { blnOk=false; }
  if(document.body.style.marginTop!="") { blnOk=false; }
  if(document.getElementById) {

  }
  else{
  blnOk=false;
  }

  if(blnOk) {
    with(document.body.style) {
      backgroundColor="#264565";
      color="#FFF";
      marginTop="0";
    }

    var distanceHorizontale=0;
    var largeurEntreMenus=25;
    
    var lastLeft=340; // 400;
    for(i=1;i<=5;i++) {
      var aMenu=document.getElementById("menu"+i);
      if(aMenu!=null) {
        with(aMenu.style) {
          position="absolute";
          top="4.8em";
          left=lastLeft+"px";
          
          height="3em";
          textAlign="center";
          paddingTop="0.8em";
          zIndex="2";
          width=aMenu.clientWidth+largeurEntreMenus+"px"
        };
        lastLeft+=(aMenu.clientWidth)+distanceHorizontale;
        console.log("apres "+aMenu.clientWidth)
        console.log(lastLeft)
      }
    }    
    
    for(i=1;i<=5;i++) {
      var aMenu=document.getElementById("menu"+i);
      if(aMenu){
        with(document.getElementById("ssmenu"+i).style) {
          position="absolute";
          top="9em";
          width="13em";
          margin="0";
          left=aMenu.style.left
          padding="0";
          zIndex="3";
        }
      }
    }    
    CacherMenus();
  }
}

function MontrerMenu(strMenu) {
  if(blnOk) {
    CacherMenus();  
    document.getElementById(strMenu).style.visibility="visible";
  }
}

function CacherMenus() {
  if(blnOk) {
    for(i=1;i<=5;i++) {
      with(document.getElementById("ssmenu"+i).style) {
        visibility="hidden";
      }
    }
  }
}

