//-----------------option--------------------//
effetFondu  =   1       //1:pour faire un effet de Fondu, 0:ou non
EnLigne  =   1       //1:pour ranger en ligne  0:ou en colonne
Posscrol  =   0       //1:pour que le menu suive la scroll barre  0:pour non


//-----------------parametrage menu mere--------------------//
Color0M  = '#FFFFFF' //Couleur du texte
Color1M  = '#346697' //Couleur Arrière
Color2M  = '#CCCCCC' //Couleur Arrière Surbrillance
Color3M  = '#346697' //Couleur Bordure 
PosY     = -11       //position
AlignM   = 'center'  //'center','right','left'
FontM    = 'Verdana, Arial, Helvetica, sans-serif' //Police
SizeM    =  7       //Taille de la Police
WeightM  = 'bold'    //Epaisseur de la Police
CursorM  = 'hand' //Curseur-> default,hand...
LargeurM = 720       //Largeur mere si = 0 c'est calculé sur la largeur maximum des menu fille
HauteurM =  25       //Hauteur mere
//----------------------parametre menu fille---------------------//
Color0F  = '#FFFFFF' //Couleur du texte
Color1F  = '#346697' //Couleur Arrière
Color2F  = '#CCCCCC' //Couleur Arrière Surbrillance
Color3F  = '#346697' //Couleur Bordure
AlignF   = 'center'  //'center','right','left'
FontF    = 'Verdana, Arial, Helvetica, sans-serif' //Police
SizeF    =  7       //Taille de la Police
WeightF  = 'bold'    //Epaisseur de la Police
CursorF  = 'hand' //Curseur-> default,hand...
HauteurF =  20       //Hauteur fille
//----------------------------feille de style---------------------------------------//


document.write('<style>')
document.write('.ejmenu  { font-style: normal; line-height: 8pt; font-variant: normal; background:'+Color1M+';text-align:'+AlignM+';font:'+WeightM+' '+SizeM+'pt '+FontM+';color:'+Color0M+';cursor:'+CursorM+'}')
document.write('.ejsmenu { font-style: normal; line-height: 8pt; font-variant: normal; background:'+Color1F+';text-align:'+AlignF+';font:'+WeightF+' '+SizeF+'pt '+FontF+';color:'+Color0F+';cursor:'+CursorF+'}')
document.write('</style>')
//----------------------------fonction de fondu---------------------------------------//
function fondu(obj)
{ obj.style.filter="blendTrans(duration=1)"
  if(obj.filters.blendTrans.status!=1)
  { obj.filters.blendTrans.Apply()
    obj.style.visibility="visible"
    obj.filters.blendTrans.Play()
  }
}
//------------------------action-------------------------------------------//
document.onclick     = function() { 
skn.visibility='hidden';
	if (document.getElementById('topdeck2')) {
document.getElementById('topdeck2').style.visibility="hidden"; 
	}
}
if (Posscrol)
{
document.onmousemove = function() { dgt.top=document.body.scrollTop+PosY; dgt.visibility='visible' }
window.onscroll      = function() { skn.visibility='hidden' }
}
//----------------------------fonction d'affichage du menu fille---------------------------------------//

function cache(){ document.getElementById('topdeck2').style.visibility="hidden"; }
function cache1(){ 
document.getElementById('topdeck').style.visibility="hidden"; 
	if (document.getElementById('topdeck2')) {
	document.getElementById('topdeck2').style.visibility="hidden";
	}
}
function soussousmen(koi,larg,Pleft)
{ 
list = koi.split(";");
	lav2 = 'menu';
for(i=0;i<list.length;i++){
	lav2 += '['+eval(list[i])+'].ssmn';
}
lavar2 = eval(lav2);
	document.getElementById('topdeck2').style.visibility="hidden";
	document.getElementById('topdeck2').style.left=Pleft;
	lachaine="<table BORDER=0 cellspacing=0 cellpadding=0 width="+larg+" style='border:1px solid #CCCCCC'>";
	for(aa=0;aa<lavar2.length;aa++){
		if(lavar2[aa].ssmn) { 
		lachaine+="<tr><TD WIDTH="+lerg+" onMouseDown='location.href=\""+lavar2[aa].lien+"\"' onMouseOver=\"this.style.background='"+Color2F+"';\" onMouseOut=\"this.style.background='"+Color1F+"'\" HEIGHT="+HauteurF+" CLASS=ejsmenu>"+lavar2[aa].nomm+"</TD></tr>";
		} else {
		lachaine+="<tr><TD WIDTH="+lerg+" onMouseDown='location.href=\""+lavar2[aa].lien+"\"' onMouseOver=\"this.style.background='"+Color2F+"';\" onMouseOut=\"this.style.background='"+Color1F+"'\" HEIGHT="+HauteurF+" CLASS=ejsmenu>"+lavar2[aa].nomm+"</TD></tr>";
		}
	}
	lachaine+="</table>";
	document.getElementById('topdeck2').innerHTML= lachaine;
	//document.getElementById('topdeck2').style.visibility="visible";
	if(document.all && effetFondu)
	  {
		  fondu(topdeck2); 
	  } else {
		  document.getElementById('topdeck2').style.visibility="visible";
	  }
}
function sousmen(niv){


lav = 'menu['+niv+'].ssmn';
lavar = eval(lav);
skn.visibility="hidden"
skn.top=PosY+HauteurM
lerg = LargeurM / eval(lavar.length);


content="<TABLE style='border-collapse:collapse;' bordercolor="+Color3F+" BORDER=1 width="+LargeurM+"><TR>";
for(aa=0;aa<lavar.length;aa++){
		if(lavar[aa].ssmn) { 
	content+="<TD WIDTH="+lerg+" onMouseDown='location.href=\""+lavar[aa].lien+"\"' onMouseOver=\"this.style.background='"+Color2F+"';soussousmen('"+niv+";"+aa+"',"+lerg+",this.offsetLeft);\" onMouseOut=\"this.style.background='"+Color1F+"'\" HEIGHT="+HauteurF+" CLASS=ejsmenu>"+lavar[aa].nomm+"</TD>";
		} else {
	content+="<TD WIDTH="+lerg+" onMouseDown='location.href=\""+lavar[aa].lien+"\"' onMouseOver=\"this.style.background='"+Color2F+"';cache()\" onMouseOut=\"this.style.background='"+Color1F+"'\" HEIGHT="+HauteurF+" CLASS=ejsmenu>"+lavar[aa].nomm+"</TD>";
		}
}
	content+="</tr></TABLE><DIV style=\"POSITION:absolute;VISIBILITY:hidden;z-index:15\" id=topdeck2></DIV>";
document.getElementById("topdeck").innerHTML=content
	  skn.visibility="visible";
}
//----------------------------affichage du menu mere---------------------------------------//
function mere()
{ 


lerg = LargeurM / eval(menu.length);
document.write('<DIV style="position:relative"><DIV style="POSITION:absolute;VISIBILITY:hidden;z-index:15" id=topdeck style="border-top:1px solid #CCCCCC"></DIV><TABLE ID=topmenu style="position:absolute;border-collapse:collapse;" bordercolor='+Color3M+' BORDER=1 HEIGHT='+HauteurM+' width='+LargeurM+'><tr>')
skn=document.getElementById('topdeck').style
dgt=document.getElementById('topmenu').style
//sousmen(menu["+pass+"].ssmn)
for(pass=0;pass<menu.length;pass++) {
		if(menu[pass].ssmn) { 
document.write("<TD WIDTH="+lerg+" onMouseDown='location.href=\""+menu[pass].lien+"\"' onMouseOver='this.style.background=\""+Color2M+"\";sousmen("+pass+")' onMouseOut='this.style.background=\""+Color1M+"\"' CLASS=ejmenu>"+menu[pass].nomm+"</TD>");
		} else {
document.write("<TD WIDTH="+lerg+" onMouseDown='location.href=\""+menu[pass].lien+"\"' onMouseOver='this.style.background=\""+Color2M+"\";cache1()' onMouseOut='this.style.background=\""+Color1M+"\"' CLASS=ejmenu>"+menu[pass].nomm+"</TD>");
		}
}
document.write('</TR></TABLE></DIV>')
dgt.top=PosY
}
