<!--
//********************************************************
//Active DHTML Menu bar with Pics as menu items
//Gilles Gomez - alizesonline.com - August-September 2001
//********************************************************


ie4 = (document.all)?true:false;			//IE 4/5 compatible
ns4 = (document.layers)?true:false;			//Netscape 4.x compatible
dom = (document.getElementById)?true:false;		//DOM compatible
if(navigator.appVersion.charAt(0) > "3") v4=true;	//Version > 3

menu = new Array;
var nbItem=0;
var menuOpener=false;
var menuOpenerN=false;
var menuOn=false;
var menuOnN=false;
var menuHighlighted=false;
var menuHighlightedN=false;
var watchEnable=true;
var refresh=false;
var overElement=false;
var closeSub=false;
var resetHighlighted=false;


//********************************************************
//Global variables - to be modified as necessary
//********************************************************

var picsPath="http://www.nagra-france.fr/images_menu/";	//The path where you have the pics
var menuTop=91;						//The top of the menu
var menuLeft=200;					//Starting left position of the menu
var menuWidth=95;					//Width of each menu title
var menuHeight=22;					//Height of each menu title
var subOffsetLeft=1;					//Starting left position of submenus
var subWidth=93;					//Width of submenus
var subColor0="#FF9933";				//Color of submenus when mouse out
var subColor1="#FFCC66";				//Color of submenus when mouse over
var subBorder=0;					//Width of the submenu border (0:1)
var subBorderColor="#FFFFFF";				//Color of submenu border
var subClass="sub";					//CSS class of submenus
var menuTimeOut=20;					//TimeOut (in ms)
var resetWhenOver=true;					//Reset the highlighted color when the mouse is over the menu
var textLinkClass="nagra"				//CSS class of the text menu (links)
var textLinkClassStd="nagra"				//CSS class of the text menu (text)


//********************************************************
//Pics should be called
//menu00.gif	first item  - mouse out
//menu01.gif	first item  - mouse over
//menu02.gif	first item  - selected
//menu10.gif	second item - mouse out
//menu11.gif	second item - mouse over
//menu12.gif	second item - selected
//menu20.gif	third item  - mouse over
//and so on...
//********************************************************


//********************************************************
//menuBlock object creator. Do not modify
//********************************************************

function menuBlock(title, url0, posLeft, nb){
	this.title=title;
	this.url0=url0;
	this.posLeft=posLeft;
	this.nb=nb;

	this.image=new Array;
	this.image[0]=new Image();
	this.image[1]=new Image();
	this.image[2]=new Image();

	this.item = new Array;
	this.url = new Array;
	this.pic = new Array;
}


//********************************************************
//Here are the parameters of the menu bar
//
//Use as follow:
//
//	menu[nbItem]=new menuBlock();
//	menu[nbItem].title="*** Title of the first item of the menu ***";
//	menu[nbItem].url0="*** http://url_of_page ***";
//
//	nbItem+=1;		*** Next menu Item ***
//
//	menu[nbItem]=new menuBlock();
//	menu[nbItem].title="*** Title of the second item of the menu ***";
//	menu[nbItem].url0="*** http://url_of_page ***";
//	
//	menu[nbItem].item[1]="*** Title of the first line of the submenu ***";
//	menu[nbItem].url[1]="*** http://url_of_page ***";
//	menu[nbItem].pic[1]=new Image();
//	menu[nbItem].pic[1].src="*** http://url_of_image ***";
//	
//	menu[nbItem].item[2]="Titel of the next line of the submenu";
//	menu[nbItem].url[2]="*** http://url_of_page ***";
//	menu[nbItem].pic[2]=new Image();
//	menu[nbItem].pic[2].src="*** http://url_of_image ***";
//
//	nbItem+=1;		*** Next menu Item ***
//
//	...			*** And so on till the end of the menu ***
//
//	Here we go...
//
//********************************************************

menu[nbItem]=new menuBlock();
menu[nbItem].title="Accueil";
menu[nbItem].url0="/accueil.htm";

nbItem+=1;

menu[nbItem]=new menuBlock();
menu[nbItem].title="Audiophile";
menu[nbItem].url0="#top";

menu[nbItem].item[1]="Nagra PL-P";
menu[nbItem].url[1]="/audiophile/plp/plp.htm";

menu[nbItem].item[2]="Nagra PL-L";
menu[nbItem].url[2]="/audiophile/pll/pll.htm";

menu[nbItem].item[3]="Nagra MPA";
menu[nbItem].url[3]="/audiophile/mpa/mpa.htm";

menu[nbItem].item[4]="Nagra VPA";
menu[nbItem].url[4]="/audiophile/vpa/vpa.htm";

menu[nbItem].item[5]="Nagra SNST-R";
menu[nbItem].url[5]="/audiophile/sn/snst.htm";

nbItem+=1;

menu[nbItem]=new menuBlock();
menu[nbItem].title="Audio-Pro";
menu[nbItem].url0="#top";

menu[nbItem].item[1]="Nagra DII";
menu[nbItem].url[1]="/audiopro/d2/d2.htm";

menu[nbItem].item[2]="Nagra V";
menu[nbItem].url[2]="/audiopro/nagra5/nagra5.htm";

menu[nbItem].item[3]="Nagra ARES-C";
menu[nbItem].url[3]="/audiopro/aresc/aresc.htm";

menu[nbItem].item[4]="Nagra ARES-P";
menu[nbItem].url[4]="/audiopro/aresp/aresp.htm";

menu[nbItem].item[5]="Nagra RCX 220";
menu[nbItem].url[5]="/audiopro/aresp/rcx220.htm";

menu[nbItem].item[6]="Nagra C-PP";
menu[nbItem].url[6]="/audiopro/cpp/cpp.htm";

menu[nbItem].item[7]="Nagra IV-S";
menu[nbItem].url[7]="/audiopro/nagra4s/nagra4s.htm";

nbItem+=1;

menu[nbItem]=new menuBlock();
menu[nbItem].title="Nagra";
menu[nbItem].url0="#top";

menu[nbItem].item[1]="Services";
menu[nbItem].url[1]="/services.htm";

menu[nbItem].item[2]="Groupe Kudelski";
menu[nbItem].url[2]="http://www.nagra.com";

//menu[nbItem].item[3]="Filiales";
//menu[nbItem].url[3]="/filiales.htm";

menu[nbItem].item[3]="Historique";
menu[nbItem].url[3]="/histoire.htm";

nbItem+=1;

menu[nbItem]=new menuBlock();
menu[nbItem].title="Téléchargement";
menu[nbItem].url0="/download.htm";

nbItem+=1;

menu[nbItem]=new menuBlock();
menu[nbItem].title="Contact";
menu[nbItem].url0="/contact.htm";


//********************************************************
//Beginning of the programm
//Do not modify from this point to the bottom of the page
//********************************************************


//********************************************************
//This function creates the menu to the page
//********************************************************

function createMenu(menuOn,x,y){

	if(x) menuLeft=x;					// fix x position if defined
	if(y) menuTop=y;					// fix y position if defined
	nbItem=menu.length;					// # of menu items

	for(i=0;i<nbItem;i++){					// Preloads the images
		menu[i].image[0].src=picsPath+"menu"+i+"0.gif";
		menu[i].image[1].src=picsPath+"menu"+i+"1.gif";
		menu[i].image[2].src=picsPath+"menu"+i+"2.gif";
		menu[i].posLeft=menuLeft + menuWidth*i;		// Calculates Left of items
		menu[i].nb=menu[i].item.length;			// calculates # of submenus items
	}

	if(ie4||dom){
		for(i=0;i<nbItem;i++){
			//Title of Item
			if(menu[i].nb){
				if(menuOn==i){
					document.writeln("<div id='title"+ i +"' style='position:absolute; left:"+ menu[i].posLeft +"px; top:"+ menuTop +"px; width:"+ menuWidth +"px; height:"+ menuHeight +"px; z-index:1' onMouseOver=\"changeMenu("+ i +",true,true,'menu',1,'nothing',false)\" onMouseOut=\"changeMenu("+ i +",false,this,'menu',2,true,false)\">");
					document.writeln("<table cellspacing='0' cellpadding='0' border='0'><tr align='center'><td>");
					document.writeln("<a href='"+ menu[i].url0 +"'><img src='"+ menu[i].image[2].src +"' ' border='0' name='imageMenu"+ i +"'></a>");
				}
				else{
					document.writeln("<div id='title"+ i +"' style='position:absolute; left:"+ menu[i].posLeft +"px; top:"+ menuTop +"px; width:"+ menuWidth +"px; height:"+ menuHeight +"px; z-index:1' onMouseOver=\"changeMenu("+ i +",true,true,'menu',1,'nothing',false)\" onMouseOut=\"changeMenu("+ i +",false,this,'menu',0,true,false)\">");
					document.writeln("<table cellspacing='0' cellpadding='0' border='0'><tr align='center'><td>");
					document.writeln("<a href='"+ menu[i].url0 +"'><img src='"+ menu[i].image[0].src +"' ' border='0' name='imageMenu"+ i +"'></a>");
				}
			}
			else{
				if(menuOn==i){
					document.writeln("<div id='title"+ i +"' style='position:absolute; left:"+ menu[i].posLeft +"px; top:"+ menuTop +"px; width:"+ menuWidth +"px; height:"+ menuHeight +"px; z-index:1' onMouseOver=\"changeMenu("+ i +",'hide',true,'menu',1,'nothing',false)\" onMouseOut=\"changeMenu("+ i +",false,this,'menu',2,'nothing',false)\">");
					document.writeln("<table cellspacing='0' cellpadding='0' border='0'><tr align='center'><td>");
					document.writeln("<a href='"+ menu[i].url0 +"'><img src='"+ menu[i].image[2].src +"' ' border='0' name='imageMenu"+ i +"'></a>");
				}
				else{
					document.writeln("<div id='title"+ i +"' style='position:absolute; left:"+ menu[i].posLeft +"px; top:"+ menuTop +"px; width:"+ menuWidth +"px; height:"+ menuHeight +"px; z-index:1' onMouseOver=\"changeMenu("+ i +",'hide',true,'menu',1,'nothing',false)\" onMouseOut=\"changeMenu("+ i +",false,this,'menu',0,'nothing',false)\">");
					document.writeln("<table cellspacing='0' cellpadding='0' border='0'><tr align='center'><td>");
					document.writeln("<a href='"+ menu[i].url0 +"'><img src='"+ menu[i].image[0].src +"' ' border='0' name='imageMenu"+ i +"'></a>");
				}
			}
			document.writeln("</td></tr></table></div>");

			//Scroll menu if exists
			if(menu[i].nb){
				document.writeln("<div id='menu"+ i +"' style='position:absolute; left:"+ (menu[i].posLeft+subOffsetLeft) +"px; top:"+ (menuTop+menuHeight) +"px; width:"+ (menuWidth+2*subBorder) +"px; height:28px; z-index:2; visibility:hidden'>");
				document.writeln("<table border='"+ subBorder +"' cellspacing='0' cellpadding='1' bgcolor='"+ subColor0 +"' width='"+ (subWidth+2*subBorder) +"' bordercolor='"+ subBorderColor +"'>");
				for(j=1;j<menu[i].nb;j++){	
					document.writeln("<tr align='center'><td class='"+ subClass +"' onMouseOver=\"changeMenu(0,false,this,'sub',1,false,false)\" onMouseOut=\"changeMenu(0,false,this,'sub',0,true,true)\">");
					document.writeln("<a href='"+ menu[i].url[j] +"'>"+ menu[i].item[j] +"</a>");					
					document.writeln("</td></tr>");
				}
				document.writeln("</table></div>");
			}	
		}
	}

	else if(ns4){
		for(i=0;i<nbItem;i++){
			//Title of Item
			if(menu[i].nb){				
				if(menuOn==i){
					document.writeln("<layer id='title"+ i +"' left='"+ menu[i].posLeft +"' top='"+ menuTop +"' width='"+ menuWidth +"' height='"+ menuHeight +"' z-index='1' onMouseOver=\"changeMenu("+ i +",true,true,'menu',1,'nothing',false)\" onMouseOut=\"changeMenu("+ i +",false,this,'menu',2,true,false)\">");
					document.writeln("<table cellspacing='0' cellpadding='0' border='0'><tr align='center'><td>");
					document.writeln("<a href='"+ menu[i].url0 +"'><img src='"+ menu[i].image[2].src +"' ' border='0' name='imageMenu"+ i +"'></a>");
				}
				else{
					document.writeln("<layer id='title"+ i +"' left='"+ menu[i].posLeft +"' top='"+ menuTop +"' width='"+ menuWidth +"' height='"+ menuHeight +"' z-index='1' onMouseOver=\"changeMenu("+ i +",true,true,'menu',1,'nothing',false)\" onMouseOut=\"changeMenu("+ i +",false,this,'menu',0,true,false)\">");
					document.writeln("<table cellspacing='0' cellpadding='0' border='0'><tr align='center'><td>");
					document.writeln("<a href='"+ menu[i].url0 +"'><img src='"+ menu[i].image[0].src +"' ' border='0' name='imageMenu"+ i +"'></a>");
				}
			}
			else{
				if(menuOn==i){
					document.writeln("<layer id='title"+ i +"' left='"+ menu[i].posLeft +"' top='"+ menuTop +"' width='"+ menuWidth +"' height='"+ menuHeight +"' z-index='1' onMouseOver=\"changeMenu("+ i +",'hide',true,'menu',1,'nothing',false)\" onMouseOut=\"changeMenu("+ i +",false,this,'menu',2,'nothing',false)\">");
					document.writeln("<table cellspacing='0' cellpadding='0' border='0'><tr align='center'><td>");
					document.writeln("<a href='"+ menu[i].url0 +"'><img src='"+ menu[i].image[2].src +"' ' border='0' name='imageMenu"+ i +"'></a>");
				}
				else{
					document.writeln("<layer id='title"+ i +"' left='"+ menu[i].posLeft +"' top='"+ menuTop +"' width='"+ menuWidth +"' height='"+ menuHeight +"' z-index='1' onMouseOver=\"changeMenu("+ i +",'hide',true,'menu',1,'nothing',false)\" onMouseOut=\"changeMenu("+ i +",false,this,'menu',0,'nothing',false)\">");
					document.writeln("<table cellspacing='0' cellpadding='0' border='0'><tr align='center'><td>");
					document.writeln("<a href='"+ menu[i].url0 +"'><img src='"+ menu[i].image[0].src +"' ' border='0' name='imageMenu"+ i +"'></a>");
				}
				
			}
			document.writeln("</td></tr></table></layer>");

			//Scroll menu if exists
			if(menu[i].nb){
				document.writeln("<layer id='menu"+ i +"' left='"+ (menu[i].posLeft+subOffsetLeft) +"' top='" + (menuTop+menuHeight) + "' width='74' height='28' z-index='2' visibility='hide' onMouseOver='ns4Fix(true)' onMouseOut='ns4Fix(false)'>");
				document.writeln("<table border='"+ subBorder +"' cellspacing='0' cellpadding='1' bgcolor='"+ subColor0 +"' width='"+ (subWidth+2*subBorder) +"' bordercolor='"+ subBorderColor +"'>");
				for(j=1;j<menu[i].nb;j++){
					document.writeln("<tr align='center'><td class='"+ subClass +"'>");
					document.writeln("<a href='"+ menu[i].url[j] +"'>"+ menu[i].item[j] +"</a>");
					document.writeln("</td></tr>");
				}
				document.writeln("</table></layer>");
			}	
		}
	}

	else{
		document.writeln("<div align='center'>");
		document.writeln("| ");
		for(i=0;i<nbItem;i++){
			document.writeln("<a href='"+ menu[i].url0 +"'\">"+ menu[i].title +"</a> | ");
		}
		document.writeln("</div>");
	}

	if((!menuOn)&&(menuOn!=0))resetWhenOver=false;		// Test for Menu highlight and color reset
	else if(menuOn==99)resetWhenOver=false;
	else{
		menuHighlightedN=menuOn;			// creates the Highlighted menu object
		menuHighlighted=createTitleObject(menuOn);
	}

	if(v4) closeSub=window.setTimeout("watchDog()",menuTimeOut);
}


//********************************************************
//This part handles the DHTML menu
//********************************************************


// This function hides all layers
function hideAll(){
	if (dom){
		for (i=0;i<nbItem;i++){
			menuName = "menu"+i;
			if(menu[i].nb) document.getElementById(menuName).style.visibility = 'hidden';
		}
	}
	else if (ie4){
		for (i=0;i<nbItem;i++){
			menuName = "menu"+i;
			if(menu[i].nb) document.all[menuName].style.visibility = 'hidden';
		}
	}
	else if (ns4){
		for (i=0;i<nbItem;i++){
			menuName = "menu"+i;
			if(menu[i].nb) document.layers[menuName].visibility = 'hide';
		}
	}
	if(refresh) menuColorReset();
}


// This functions hides all layers when timeout is reached
function watchDog(){
	if(watchEnable){
		hideAll();
		watchEnable = false;
	}
}


// This function changes the menu, opens submenus, changes styles and set flags
// n = number of the layer
// visible = true, "hide" or false (false means nothing happens)
// who = this or false (false means no Style will be changed)
// what = "menu" or "sub"
// how = 0 or 1 or 2 (indicates the color)
// watch = "nothing" or true or false (nothing means watchEnable will not be changed)
// ref = true or false (false means refresh will not be changed)

function changeMenu(n, visible, who, what, how, watch, ref){
	if(visible){					// Menu section enabled
		hideAll();				// Close all submenus
		if(visible!="hide"){			// Open a submenu if not "hide"
			watchEnable = false;
			window.clearTimeout(closeSub);
			menuName = "menu"+n;
			if (dom) document.getElementById(menuName).style.visibility = 'visible';
			else if (ie4) document.all[menuName].style.visibility = 'visible';
			else if (ns4) document.layers[menuName].visibility = 'show';
		}
	}

	if(who){					// Change object style section enabled
		if(what=="menu"){			// Object is a menu
			if(how==1){
				overElement=true;
				if(resetWhenOver) changeImage(menuHighlightedN,0);
				changeImage(n,how);
				menuOpener=who;
				menuOpenerN=n;
			}
			else if(how==2){
				overElement=true;
				changeImage(n,how);
				menuOpener=who;
				menuOpenerN=n;
			}
			else{
				changeImage(n,how);
				if(resetHighlighted)window.clearTimeout(resetHighlighted);
				if(resetWhenOver) resetHighlighted=window.setTimeout("if(!overElement)changeImage(menuHighlightedN,2)",menuTimeOut);
				overElement=false;
			}
		}
		if(what=="sub"){			// Object is a submenu
			if(how){
				overElement=true;
				if(ie4||dom)who.style.backgroundColor=subColor1;
				if(resetWhenOver) changeImage(menuHighlightedN,0);
				if(menuOpener){		// Resets the menuOpener Color
					changeImage(menuOpenerN,how);
				}
			}
			else{
				overElement=false;
				if(ie4||dom)who.style.backgroundColor=subColor0;
			}
		}
	}

	if(watch==false){
		watchEnable=false;			// Resets the watchEnable flag
		window.clearTimeout(closeSub);		// Disables the timer
	}
	else if(watch==true){
		watchEnable=true;			// Sets the watchEnable flag
		window.clearTimeout(closeSub);		// Hides the submenus
		closeSub=window.setTimeout("watchDog()",menuTimeOut);
	}

	if(ref) refresh=true;				// Sets the refresh flag
}


// This function resets the colors of the menu item
function menuColorReset(){
	if(menuOpener){
		if(menuOpener!=menuHighlighted){// menuOpener is not the current item
			changeImage(menuOpenerN,0);
			if(resetWhenOver){
				changeImage(menuHighlightedN,2);
			}
		}
		else{				// menuOpener is the current item
			changeImage(menuOpenerN,2);
		}
		menuOpener=false;
		menuOpenerN=false;
	}
	refresh=false;
}


// This function changes the Image
function changeImage(imageNumber,toggleToState){
	imageObject=eval("document.imageMenu"+imageNumber);
	imageObject.src=menu[imageNumber].image[toggleToState].src;
}


//This function returns a Title/Menu Object from a number
function createTitleObject(n){
	layerName="title"+n;
	if(dom)highlight=document.getElementById(layerName);
	else if(ie4)highlight=document.all[layerName];
	else if(ns4)highlight=document.layers[layerName];
	return highlight;
}


// This function fixes the bugs with Netscape4.x browsers
function ns4Fix(onOff){
	if(onOff){
		overElement=true;
		watchEnable=false;		// Set the color of the menu
		if(resetWhenOver) changeImage(menuHighlightedN,0);
		if(menuOpener)changeImage(menuOpenerN,1);
	}
	else{
		overElement=false;
		watchEnable=true;		// Sets the watchEnable flag
		refresh=true;			// Enables the menu refresh
		window.clearTimeout(closeSub);	// Close all the menus
		closeSub=window.setTimeout("watchDog()",menuTimeOut);
	}
}


// This function writes a vertical text menu corresponding to the active submenu
function createList(m,s){
	menuLength=menu[m].item.length
	if(menuLength){
		document.writeln("<p class='"+ textLinkClass +"'>");
		for(k=1;k<menuLength;k++){
			if(k==s)document.writeln("<span class='"+ textLinkClassStd +"'>"+ menu[m].item[k] +"</span><br>");
			else document.writeln("<a href='"+ menu[m].url[k] +"'>"+ menu[m].item[k] +"</a><br>");
		}
		document.writeln("</p>");
	}
}


// This function creates a sitemap
function sitemap(){
	document.writeln("<table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
        document.writeln("<tr><td colspan=\"3\" class=\"titreGros\">PLAN DU SITE</td></tr>");
        document.writeln("<tr><td colspan=\"3\"><img src=\"images_general/shim.gif\" width=\"500\" height=\"20\"></td></tr>");
        for(s=0;s<nbItem+1;s++){
        	if(menu[s].url0=="#top") document.writeln("<tr><td>&nbsp;</td><td colspan=\"2\" class=\"titre\"><img src=\"images_general/shim_blue.gif\" width=\"8\" height=\"8\"><img src=\"images_general/shim.gif\" width=\"8\" height=\"8\">"+ menu[s].title +"</td></tr>");
        	else document.writeln("<tr><td>&nbsp;</td><td colspan=\"2\" class=\"titre\"><img src=\"images_general/shim_blue.gif\" width=\"8\" height=\"8\"><img src=\"images_general/shim.gif\" width=\"8\" height=\"8\"><a href="+ menu[s].url0 +">"+ menu[s].title +"</a></td></tr>");
        	nb=menu[s].item.length;
        	if(nb){
        		for(t=1;t<nb;t++){
        			document.writeln("<tr><td>&nbsp;</td><td>&nbsp;</td><td><a href="+ menu[s].url[t] +">"+ menu[s].item[t] +"</a></td></tr>");
        		}
        	}
        	//else document.writeln("<tr><td>&nbsp;</td><td>&nbsp;</td><td><a href="+ menu[s].url0 +">"+ menu[s].title +"</a></td></tr>");
        	document.writeln("<tr><td colspan=\"3\"><img src=\"images_general/shim.gif\" width=\"500\" height=\"10\"></td></tr>");
        }
	document.writeln("<tr><td><img src=\"images_general/shim.gif\" width=\"20\" height=\"30\"></td>");
	document.writeln("<td><img src=\"images_general/shim.gif\" width=\"40\" height=\"30\"></td>");
	document.writeln("<td><img src=\"images_general/shim.gif\" width=\"440\" height=\"30\"></td></tr></table>");
}

//-->