<!-- Vignette V6 Thu Jan 19 23:07:30 2012 -->
// ---------------- Fonctions générales ----------------

// Objet pour reconnaissance de navigateur
function lib_bwcheck(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}

// Création de l'objet
var bw=new lib_bwcheck()

// Objet Layer DHTML
function lib_obj(obj,nest){
	
	// function d'affichage
	function lib_showIt(){ 
	        this.css.visibility="visible"
	}
	
	// function de masquage
	function lib_hideIt(){
	        this.css.visibility="hidden"
	}
	
	
	this.evnt=bw.dom && document.getElementById(obj)||bw.ie4 && document.all[obj]|| (nest?bw.ns4 && document[nest].document[obj]:bw.ns4 && document.layers[obj]);
	this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt;      
	this.showIt=lib_showIt; this.hideIt=lib_hideIt;
	return this
}

// ---------------- Fonctions spécifiques au Menu ---------------- 

// Nombre de menus
var nombreMenu = 2
var g_bInitCompleted = 0;

// Affiche le Sous-menu demandé et masque les autres
function extract(num)
{
	if( g_bInitCompleted == 1 )
	{
		for(i=0;i<nombreMenu;i++)
			if(num!=i)
				eval("oSubMenu"+i+".hideIt()");
	
		eval("oSubMenu"+num+".showIt();")
	}
}

// Fonction de masque pour le layer
function evOut(){
	if(bw.ie4 || bw.dom)this.style.visibility='hidden';
	else if(bw.ns4) this.visibility='hidden';
}

// Fonction d'affichage pour le layer
function divShow(){
	if(bw.ie4 || bw.dom)this.style.visibility='visible';
	else if(bw.ns4) this.visibility='show';
}

// Démarrage du DHTML	
function init(){

	// Création des sous-menu ONLOAD

	for(i=0;i<nombreMenu;i++){
		eval("oSubMenu"+i+"=new lib_obj('divSubMenu"+i+"')");
	}

	for(i=0;i<nombreMenu;i++){
		eval("oSubMenu"+i+".evnt.onmouseout=evOut");
	}

	for(i=0;i<nombreMenu;i++){
		eval("oSubMenu"+i+".evnt.onmouseover=divShow");
	}
	g_bInitCompleted = 1;
}
