

// -----------------------------------
// GESTION DES MENUS HAUT ET GAUCHE
// -----------------------------------




//--------------------------------------------------------------------------------
// Gestion menu Haut
//--------------------------------------------------------------------------------
var memoMenu=1;
var timeoutMenu;
var timeAttente;
var sousGammeOK=1;
var calque=1;
var nbUnivers=5;

// Fonctions gestion calque
function tempsMenu(a){
	timeoutMenu = setTimeout('supCalque(memoMenu)',100);
	clearTimeout(timeAttente);
}


function affCalque(calque){
	c=calque;
	timeAttente = setTimeout('lanceCalque(c)',200);
}

function lanceCalque(c){
	var n=1;
	
	
	with (document.getElementById("SG" + memoMenu).style)
		visibility="hidden";
	
	for(i=1; i<=nbUnivers; i++){
		with (document.getElementById("celRub" + i).style)
			backgroundColor = "#CCCCCC";
	}		
	
	
	with (document.getElementById("SG" + c).style)
		visibility="visible";
	with (document.getElementById("celRub" + c).style)
		backgroundColor = "#6B6EA4";

	memoMenu = c;
	
	
	
	// appel opac
	//OpacOK(50);		
}


function stopTempsMenu(){
	clearTimeout(timeoutMenu);
}

function supCalque() {
  if (sousGammeOK == 1){
	with (document.getElementById("SG" + memoMenu).style)
		visibility="hidden";
	
	for(i=1; i<=nbUnivers; i++){
		with (document.getElementById("celRub" + i).style)
			backgroundColor = "#6B6EA4";
	}
			
	//OpacOK(0);
	}
}





// functions gestion calque fond
//-------------------------------
function tempsOpac(){
	clearTimeout(timeOpac);
	timeOpac= setTimeout('changeOpac()',50);
}


 function OpacOK(valeur){
	
	if (document.all){
		with (document.getElementById("fondPage").style)
			filter=eval('"alpha(opacity='+valeur+')"');
	}
	else{
		with (document.getElementById("fondPage").style)
			opacity=(valeur/100);			
	}
	if(valeur==50){
		with (document.getElementById("fondPage").style){			
			width="100%";
			height="100%";
		}
	}
	else{
		with (document.getElementById("fondPage").style){			
			width="1";
			height="1";	
		}
	}
 }



//--------------------------------------------------------------------------------
// Gestion menu gauche
//--------------------------------------------------------------------------------
	// recherche style
	var activeCalqueMenu = 0;
	if(designRub > 0){		
		if(designRub < 20)
			activeCalqueMenu=1;
		else if(designRub < 30)
			activeCalqueMenu=2;
		else if(designRub < 40)
			activeCalqueMenu=3;
		else if(designRub < 50)
			activeCalqueMenu=4;
		else if(designRub < 60)
			activeCalqueMenu=5;
	}
	document.write('<link rel="stylesheet" href="../site/style/'+activeCalqueMenu+'.css" type="text/css">')

	// activation des calques gamme en fct de l'univers
	function activeMenu(){
		var tabCalqueMenu= new Array(0,20,30,40,50,60);		
		if(designRub > 0){
			for(i=tabCalqueMenu[activeCalqueMenu-1]; i<= tabCalqueMenu[activeCalqueMenu]; i++){
				if(document.getElementById("menuGamme"+i)){
					with (document.getElementById("menuGamme"+i).style)
						display="block";
				}	
			}
		}								
	}
