var oldBlocP = "*";
var oldBlocS = "*";
var oldBlocPs = "*";

// bloc menu Principal et Secondaire actif
var bMenuPa = "*";
var bMenuSa = "*";

// bloc menu Principal et Secondaire a activer
var bMenuP = "*";
var bMenuPs = "*";
var bMenuS = "*";


var TempoMg ="";
var tab_blocs = new Array("menu11","menu12","menu23","menu31","menu41","menu43")
	
function masque_BlocP()
	{
		
		if ((oldBlocP != "*")  && ( oldBlocP != bMenuPa))
		{
			objM = document.getElementById(oldBlocP);
			objM.style.display = "none";
			oldBlocP ="*";
		}
	}

function masque_BlocP2(moi)
	{
		
		if ((oldBlocP != "*")  && (oldBlocP !=moi))
		{
			objM = document.getElementById(oldBlocP);
			objM.style.display = "none";
			oldBlocP ="*";
		}
	}


function effaceMg()
	{

	if ((oldBlocS!= "*") && ( oldBlocS != bMenuSa))
		{
		objM = document.getElementById(oldBlocS);
		objM.style.display = "none";
		oldBlocS ="*";
		}
	if ( bMenuS == bMenuSa) 
		{
		masque_BlocP();
		}
	}

function afficheBlocP(qui)
	{
	// masque le menu haut 
	efface()
	stopTempo()
	stopTempoMg()
	// détermine quel menu doit être activé
	bMenuP = qui
	// masque un éventuel menu affiche
	effaceMg()
	masque_BlocP();
	// affiche le bloc principal;	
	objM = document.getElementById(qui);
	objM.style.display = "block";
	oldBlocP = qui;
	}

function aff_Page( optM, la_page)
	{
	// si l'option ne fait pas partie du menu développé
	// alors on peut afficher la page
	if (optM != bMenuPa)	
		{ 
		top.location = la_page; 
		}
	}
	
function active( option)
	{
	
	// determination des blocs Principale et Secondaire à activer 
	var blocP = option.charAt(0);
	bMenuPa = "menu"+blocP;
	
	var blocS = option.substring(0,2);
	bMenuSa = "menu"+blocS;
	
	// affiche le bloc Principal actif
	obj = document.getElementById(bMenuPa); 
	obj.style.display ='block';
	
	// affiche le bloc Principal actif
	obj = document.getElementById(bMenuPa); 
	obj.style.display ='block';
	
	// masque la flêche du bloc Principal
	obj = document.getElementById("Fmenu"+blocP); 
	obj.src = "/img/t.gif";
	
	// affiche les blocs secondaires  du bloc principal courant
	for (var bcl = 0; bcl < tab_blocs.length; bcl++)
		{
		var smenu = tab_blocs[bcl];
		if ( smenu.indexOf(bMenuPa) != -1) 
			{ 
				obj = document.getElementById(smenu); 
				obj.style.display = "block";
			}
		}
		
	if (option.length < 3) { return;}

	// met le lien courant en violet
	document.getElementById("lien"+option).className = "violet10"
	// met l'image du lien courant en violet
	document.getElementById("iosm"+option).src = "/img/otp_on.gif";
	}
	
function stopTempoMg()
	{ 
	clearTimeout(TempoMg);
	}

function startTempoMg()
	{ 	
	clearTimeout(TempoMg);
	TempoMg = setTimeout("effaceMg()",3000);
	}