/* AUTEUR: OT THE BEST */
/* DATE DE CREATION: 22/02/2006 */
//pour les navigateurs n'ayant pas de getelementbyid
if(!document.getElementById){
  if(document.all){document.getElementById=function(){
	  if(typeof document.all[arguments[0]]!="undefined"){return document.all[arguments[0]]}else{return null}
    }
  }else if(document.layers){document.getElementById=function(){
      if(typeof document[arguments[0]]!="undefined"){return document[arguments[0]]}else{return null}
    }
  }
}

function nav_Bar(x){
	NAV = navigator.appVersion
	IE = (document.all)?true:false;
	MN = document.getElementById(x);
	LI = MN.getElementsByTagName('li');
	n = LI.length;

	for(i=0; i<n; i++){
   		if(IE){
   		   LI[i].onmouseover = function(){this.className = 'lihover';}
   		   LI[i].onfocus = function(){this.className = 'lihover';}
   		   LI[i].onmouseout = function(){this.className = '';}
   		}
   		LI[i].setAttribute( 'id', "li"+i );
   		LI[i].onclick = function(){
       		UL= this.getElementsByTagName('UL');
       		var li_en_cours=this
    		this.className = 'lihover';
			hideAllOthersUls(li_en_cours)
			if(IE){li_en_cours.onmouseout=''}
       		if(UL[0]){ 
       		  	if(UL[0].style.display!= 'block'){
       				UL[0].style.display = 'block';
       			}
       		}
		}
	}
}

// hide all ul on the same level of  this list item
function hideAllOthersUls( currentLi ){
    var lis = currentLi.parentNode;
    for ( var i=0; i<lis.childNodes.length; i++ ){
        if ( lis.childNodes[i].nodeName=='LI' && lis.childNodes[i].id != currentLi.id ){
            hideUlUnderLi( lis.childNodes[i] );
			lis.childNodes[i].className = '';
        }
    }
}

// hide all the ul wich are in the li element
function hideUlUnderLi( li ){
    var uls = li.getElementsByTagName('ul');
    for ( var i=0; i<uls.length; i++ )    {
       	if(IE){li.onmouseout=function(){this.className = '';}}
		li.className = ''; 
		uls.item(i).style.display = 'none';

    }
} 

//affiche et cache des blocks
function displaye(elmid,effid){
	if(effid){var effdiv=document.getElementById(effid);effdiv.style.display='none';};
	var divelm=document.getElementById(elmid)
	if (divelm.style.display=='block'){
		divelm.style.display='none'
	}
	else{divelm.style.display='block'}
}