<!-- Vignette V6 Thu Jan 19 22:45:19 2012 -->
// Configuration 
// ------------------------------------------------------------------------------- //



var appBorderSize = 2;
var appBorderColor = '990000'; //border
var appItemHeight = 20;
var appItemColor = '990000';
var appItemOverColor = 'CC0000';
var appItemOutColor = '990000';

// ------------------------------------------------------------------------------- //



// ------------------------------------------------------------------------------- //
function appBrowserCheck(){
	this.usr=navigator.userAgent;
	this.ver=navigator.appVersion;
	this.dom=document.getElementById?1:0;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom)?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.ie7);
	this.ns6=(this.dom && parseInt(this.ver) >= 5)?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.ns=(this.ns4 || this.ns6);
	this.ok=(this.ie7 || this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6);
	this.mac=(this.ver.indexOf("Mac")>-1)?1:0;
	return this;
}
var appBw = new appBrowserCheck();
// ------------------------------------------------------------------------------- //



// ------------------------------------------------------------------------------- //
function makeSubMenu(subMenuId){
	if(appBw.ns4){this.obj = eval("document.layers['subMenu"+subMenuId+"']")}
	if(appBw.ie){this.obj = eval("document.all['subMenu"+subMenuId+"']")}
	if(appBw.ns6){this.obj = eval("document.getElementById('subMenu"+subMenuId+"')")}
	this.showIt = showIt;
	this.hideIt = hideIt;
}
function showIt(){
	if(appBw.ns4){this.obj.visibility = 'show';}
	if(appBw.ie || appBw.ns6){this.obj.style.visibility = 'visible';}
}
function hideIt(){
	if(appBw.ns4){this.obj.visibility = 'hide';}
	if(appBw.ie || appBw.ns6){this.obj.style.visibility = 'hidden';}
}
// ------------------------------------------------------------------------------- //



// ------------------------------------------------------------------------------- //
function makeSubMenuItem(subMenuId,subMenuItemId,parentId){
	if(appBw.ns4){this.obj = eval("document.layers['subMenu"+subMenuId+"'].document.layers['subMenu"+subMenuId+"Item"+subMenuItemId+"']");}
	if(appBw.ie){this.obj = eval("document.all['subMenu"+subMenuId+"Item"+subMenuItemId+"']");}
	if(appBw.ns6){this.obj=eval("document.getElementById('subMenu"+subMenuId+"Item"+subMenuItemId+"')");}
	this.isItemOf = subMenuId;
	this.isChildOf = parentId;
	this.overIt = overIt;
	this.outIt = outIt;
}
function overIt(){
	if(appBw.ns4){this.obj.bgColor = appItemOverColor;}
	if(appBw.ie || appBw.ns6){this.obj.style.backgroundColor=appItemOverColor;}
}
function outIt(){
	if(appBw.ns4){this.obj.bgColor = appItemOutColor;}
	if(appBw.ie || appBw.ns6){this.obj.style.backgroundColor = appItemOutColor;}
}
// ------------------------------------------------------------------------------- //
//hideForm();


// ------------------------------------------------------------------------------- //
function menu(subMenuId,parentId){	
	if(appBw.ns4){document.layers['closeMenu'].visibility = 'show';}
	if(appBw.ie){document.all('closeMenu').style.visibility = 'visible';}
	if(appBw.ns6){document.getElementById('closeMenu').style.visibility = 'visible';}		

	for(i=0;i<nbSubMenu;i++){
		if(subMenuId!=i){eval("oSubMenu"+i+".hideIt()");}
	}
	if(parentId !=null){
		eval("oSubMenu"+parentId+".showIt();")
	}
	eval("oSubMenu"+subMenuId+".showIt();")
	
	for(i=0;i<(eval("nbItemsInMenu"+subMenuId));i++){
		eval("oSubMenu"+subMenuId+"Item"+i+".outIt()");
	}
	nbItemsInMenuTemp = eval("subMenu["+subMenuId+"].length")

	if (nbItemsInMenuTemp == 0)
	{
		eval("oSubMenu"+subMenuId+".hideIt()")
	}
}
// ------------------------------------------------------------------------------- //



// ------------------------------------------------------------------------------- //
function item(subMenuId,subMenuItemId){
	eval("oSubMenu"+subMenuId+".showIt()");
	
	fromParent = eval("oSubMenu"+subMenuId+"Item"+subMenuItemId+".isChildOf");
	
	for(i=0;i<nbSubMenu;i++){
		if(subMenuId!=i){eval("oSubMenu"+i+".hideIt()");}
	}
	if(fromParent!=null){eval("oSubMenu"+fromParent+".showIt()");}
	
	eval("oSubMenu"+subMenuId+"Item"+subMenuItemId+".overIt()");
	
	for(i=0;i<(eval("nbItemsInMenu"+subMenuId));i++){
		if(subMenuItemId!=i){eval("oSubMenu"+subMenuId+"Item"+i+".outIt()");}
	}
}
// ------------------------------------------------------------------------------- //



// ------------------------------------------------------------------------------- //
function makeHtmlCode(menuId,subMenuId,PosX,PosY,W,fromParent){
	nbItemsInMenuTemp = eval("subMenu["+subMenuId+"].length")
	eval("nbItemsInMenu"+subMenuId+" = "+nbItemsInMenuTemp)
	SubMenuW = (W+(2*appBorderSize));
	SubMenuH = ((eval("nbItemsInMenu"+subMenuId)*appItemHeight)+(2*appBorderSize));
	
	if(appBw.ns4){

		document.open()
			
		document.write("<layer visibility='hidden' name='subMenu"+subMenuId+"' pagex='"+PosX+"' pagey='"+PosY+"' width='"+SubMenuW+"' height='"+SubMenuH+"' bgcolor='"+appBorderColor+"' z-index='15'>");
		
		for (i=0; i<nbItemsInMenuTemp; i++){
			OpenChild = eval("subMenu["+subMenuId+"]["+i+"][2]")
			if(OpenChild){
				mouseOverItem = "item("+subMenuId+","+i+"); menu("+OpenChild+");"
				imageItem = "<img src='/bnc/images/i_0_0_18.gif' width='8' height='8' border='0' />"
				}
			else{
				mouseOverItem = "item("+subMenuId+","+i+");"
				imageItem = "<img src='/bnc/images/i_spacer.gif' width='8' height='8' border='0' />"
				} 
		
			if (subMenuId == iStartOPEN || subMenuId == iStartINFO)
			{
				if  (subMenu[subMenuId][i][1] == "")
				{
					document.write("<layer name='subMenu"+subMenuId+"Item"+i+"' onmouseover='"+mouseOverItem+"' left='"+appBorderSize+"' top='"+((appItemHeight*i)+appBorderSize)+"' width='"+W+"' height='"+appItemHeight+"' bgcolor='"+appItemColor+"'>");
					document.write("<p class='padTitle'>"+imageItem+"<a class='padTitle'>"+eval("subMenu["+subMenuId+"]["+i+"][0]")+"</a></p>");
					document.write("</layer>");
				}
				else
				{
					document.write("<layer name='subMenu"+subMenuId+"Item"+i+"' onmouseover='"+mouseOverItem+"' left='"+appBorderSize+"' top='"+((appItemHeight*i)+appBorderSize)+"' width='"+W+"' height='"+appItemHeight+"' bgcolor='"+appItemColor+"'>");
					document.write("<p class='pad'>"+imageItem+"<a class='SubMenuItem' href='"+eval("subMenu["+subMenuId+"]["+i+"][1]")+"'>&nbsp;&nbsp;&nbsp;&nbsp;"+eval("subMenu["+subMenuId+"]["+i+"][0]")+"</a></p>");
					document.write("</layer>");
				}
			}
			else{
				document.write("<layer name='subMenu"+subMenuId+"Item"+i+"' onmouseover='"+mouseOverItem+"' left='"+appBorderSize+"' top='"+((appItemHeight*i)+appBorderSize)+"' width='"+W+"' height='"+appItemHeight+"' bgcolor='"+appItemColor+"'>");
				document.write("<p class='pad'>"+imageItem+"<a class='SubMenuItem' href='"+eval("subMenu["+subMenuId+"]["+i+"][1]")+"'>"+eval("subMenu["+subMenuId+"]["+i+"][0]")+"</a></p>");
				document.write("</layer>");
			}	
		}
		document.write("</layer>");
		document.close();
	}
		
	else if(appBw.ie || appBw.ns6){
		document.write("<div id='subMenu"+subMenuId+"' style='position: absolute; background-color: "+appBorderColor+"; width: "+SubMenuW+"; height: "+SubMenuH+"; visibility: hidden; top: "+PosY+"; left: "+PosX+"; z-index: 15;'>");
		
		for (i=0; i<nbItemsInMenuTemp; i++){
			OpenChild = eval("subMenu["+subMenuId+"]["+i+"][2]")
				if(OpenChild){
					mouseOverItem = "item("+subMenuId+","+i+"); menu("+OpenChild+");"
					imageItem = "<img src='/bnc/images/i_0_0_18.gif' width='8' height='8' border='0' />"
				}
				else{
					mouseOverItem = "item("+subMenuId+","+i+");"
					imageItem = "<img src='/bnc/images/i_spacer.gif' width='8' height='8' border='0' />"	
				} 
	
				if (subMenuId == iStartOPEN || subMenuId == iStartINFO)
				{
					if  (subMenu[subMenuId][i][1] == "")
					{
						document.write("<div id='subMenu"+subMenuId+"Item"+i+"' onmouseover='"+mouseOverItem+"' style='position: absolute; background-color: "+appItemColor+"; width: "+W+"; height: "+appItemHeight+"; top: "+((appItemHeight*i)+appBorderSize)+"; left: "+appBorderSize+"; z-index: 2;'>");				
						document.write("<p class='padTitle'>"+imageItem+"<a class='padTitle'>"+eval("subMenu["+subMenuId+"]["+i+"][0]")+"</a></p>");
						document.write("</div>");
					}
					else
					{
		    		   	document.write("<div id='subMenu"+subMenuId+"Item"+i+"' onmouseover='"+mouseOverItem+"' style='position: absolute; background-color: "+appItemColor+"; width: "+W+"; height: "+appItemHeight+"; top: "+((appItemHeight*i)+appBorderSize)+"; left: "+appBorderSize+"; z-index: 2;'>");
						document.write("<p class='pad'>"+imageItem+"<a class='SubMenuItem' href='"+eval("subMenu["+subMenuId+"]["+i+"][1]")+"'>&nbsp;&nbsp;&nbsp;&nbsp;"+eval("subMenu["+subMenuId+"]["+i+"][0]")+"</a></p>");
						document.write("</div>");
					}
				}
				else{
	    		   	document.write("<div id='subMenu"+subMenuId+"Item"+i+"' onmouseover='"+mouseOverItem+"' style='position: absolute; background-color: "+appItemColor+"; width: "+W+"; height: "+appItemHeight+"; top: "+((appItemHeight*i)+appBorderSize)+"; left: "+appBorderSize+"; z-index: 2;'>");
					document.write("<p class='pad'>"+imageItem+"<a class='SubMenuItem' href='"+eval("subMenu["+subMenuId+"]["+i+"][1]")+"'>"+eval("subMenu["+subMenuId+"]["+i+"][0]")+"</a></p>");
					document.write("</div>");
			    }
		}
		document.write("</div>");
	}
	eval("oSubMenu"+subMenuId+" = new makeSubMenu("+subMenuId+")");
	
	for (i = 0; i < nbItemsInMenuTemp; i++){
		eval("oSubMenu"+subMenuId+"Item"+i+" = new makeSubMenuItem("+subMenuId+","+i+","+fromParent+")");
	}	
}
// ------------------------------------------------------------------------------- //



// ------------------------------------------------------------------------------- //
function hideAllMenu(){

	if(appBw.ns4){document.layers['closeMenu'].visibility = 'hide';}
	if(appBw.ie){document.all('closeMenu').style.visibility = 'hidden';}
	if(appBw.ns6){document.getElementById('closeMenu').style.visibility = 'hidden';}
	
	//imgTransUp & imgTransDown are the "Open session" braket images.
	if( document.imgTransUp!=null && document.imgTransDown!=null )
	{
		document.imgTransUp.src = "/bnc/images/i_spacer.gif";
		document.imgTransDown.src = "/bnc/images/ligne_sub.gif";
	}
	
	//imgTransUp & imgTransDown are the "Open session" braket images.
	if( document.imgTransUp2!=null && document.imgTransDown!=null )
	{
		document.imgTransUp2.src = "/bnc/images/ligne_sub.gif";
		document.imgTransDown2.src = "/bnc/images/ligne_sub.gif";
	}

	for(i=0;i<nbSubMenu;i++){eval("oSubMenu"+i+".hideIt()");}
}
// ------------------------------------------------------------------------------- //



// ------------------------------------------------------------------------------- //
function writeCloseMenu(){
	if(appBw.ns4){
		document.open();
		document.write("<layer name='closeMenu' onmouseover='javascript:hideAllMenu();' visibility: show; left='140' top='100' width='560' height='400' z-index='10'>");
		document.write("<img src='/bnc/images/i_spacer.gif' width='560' height='400' border='0'></layer>");
		document.close();
	}
	else if(appBw.ie || appBw.ns6){
		document.write("<div id='closeMenu' onmouseover='javascript:hideAllMenu();' style=' visibility: visible; position: absolute; width: 560px; height: 600px; top: 100px; left: 140px; z-index: 10;'>");
		document.write("<img src='/bnc/images/i_spacer.gif' width='560' height='400' border='0'></div>");
	}
}
// ------------------------------------------------------------------------------- //		

