//declarations variables var mnu,timer,hideTimeout;
var rndImg,mnu,timer,hideTimeout,indexImg;
//init variables
hideTimeout = 500;

// masque tous les calques et remet toutes les liens a off
function hideAllDiv() {
	//pour chaque element de menu
	for (i=0 ; i < mnu.length; i++){
	  //cache le calque
	  document.getElementById(mnu[i][0]).style.visibility="hidden";
	  // remet l'image off
	  document.getElementById(mnu[i][1]).style.color = mnu[i][2];
	  document.getElementById(mnu[i][1]).style.background = mnu[i][4];
	}
}

//affiche un sous menu et active le lien on
function showDiv(divId) {
  hideAllDiv();
  // arrete le timer en cours s il est lance
  clearTimeout(timer);
  // puis affiche le calque correspondant au lien active
  document.getElementById(divId).style.visibility="visible";
  // lien en surbrillance
  for (i=0 ; i < mnu.length; i++){
    if (mnu[i][0] == divId) {
      document.getElementById(mnu[i][1]).style.color = mnu[i][3];
	  document.getElementById(mnu[i][1]).style.background = mnu[i][5];// ***
	}
  }
}
//*** Gestion de la background color au survol du menu contact
//suite au survol d un sous-menu
function init_sm() {
  clearTimeout(timer);
}

// lance une demande de fermeture de tous les sous-menus
function close_all_sm() {
  timer = setTimeout("hideAllDiv()",hideTimeout);
}

// rajoute le 08/10/07
//definit l'image aleatoire
function init_images() {
  //choisit l'image aleatoire
  rnd = 60/rndImg.length;
  currentdate = new Date();
  i = currentdate.getSeconds();
  i = Math.floor(i/rnd);
  indexImg = i;
  document.getElementById('imgBandeau').src = rndImg[i];
}

function ouvrir_popup_img(){
        window.open('/popup_bando/popup' + indexImg + '.aspx', 'popupBando','menubar=no,scrollbars=yes,resizable=yes,width=767,height=660');
}



