// A cascading menu script by Fredrik Fridsten 2000 (c)// Feel free to use this, but please mention in a comment in the code.// To configure the script:// Change the nom value to the number of menus that you want to use// Note: Always make sure that this is correct, otherwise you might get a javascript error.// The phrases "../images/opened.gif" and "../images/closed.gif" should be referring to the// pictures you might use.// If you don't want to use images, just remove the picopen and picclose functions.// Also remove the lines in the toggle function that refer to those.// The input variable to the toggle function is the number of the submenu to open/close,// starting with 1. http://www.fridsten.se/script/var lastn;var isIE4;var isNav4;var isNav6;function setbrowser() {	if (navigator.appVersion.charAt(0) == "4") {		if (navigator.appName.indexOf("Explorer") >= 0) {			isIE4 = true;		}		else {			isNav4 = true;		}	}	else if (navigator.appVersion.charAt(0) > "4") {		isNav6 = true;	}	if (isNav4) { // Setting the visibility for NN and IE		visible = 'show';		hidden = 'hide';	}	else if (isIE4) {		visible = 'visible';		hidden = 'hidden';	}	else if (isNav6) {		visible = 'visible';		hidden = 'hidden';	}}// A couple of small functions that changes the image by the clicked menufunction picopen(n) {	title = ('title' + n);	pic = ('pic' + n);	if (isNav4) {		document.layers[title].document.images[pic].src = "../images/opened.gif";	}	else if (isIE4) {		document.all(pic).src = "../images/opened.gif";	}	else if (isNav6) {		document.getElementById(pic).src = "../images/opened.gif";	}}function picclose(n) {	title = ('title' + n);	pic = ('pic' + n);	if (isNav4) {		document.layers[title].document.images[pic].src = "../images/closed.gif";	}	else if (isIE4) {		document.all(pic).src = "../images/closed.gif";	}	else if (isNav6) {		document.getElementById(pic).src = "../images/closed.gif";	}}// The main scripts for toggling the selected menu// Input variables:// n = the number of the submenu to show/hidelastn = 0;function lasttoggle(n) {	if (n > 0) {		menu = ('submenu' + n);		if (isNav4) {			submenu = document.layers[menu];		}		else if (isIE4) {			submenu = document.all(menu).style;		}		else if (isNav6) {			submenu = document.getElementById(menu).style;		}		if (submenu.visibility.toLowerCase() == visible) {			submenu.visibility = hidden;			picclose(n); // Remove this if you don't use pictures		}	}}function toggle(n) {	var menu = ('submenu' + n);	if (isNav4) {		submenu = document.layers[menu];	}	else if (isIE4) {		submenu = document.all(menu).style;	}	else if (isNav6) {		submenu = document.getElementById(menu).style;	}	if (submenu.visibility.toLowerCase() == visible) {		submenu.visibility = hidden;		picclose(n); // Remove this if you don't use pictures	}	else {		submenu.visibility = visible;		picopen(n); // Remove this if you don't use pictures		if (lastn != n) {			lasttoggle(lastn);		}	}	lastn = n;}