/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
	
***********************************************/

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	//make sure the browser can read this script
if(document.getElementById){
	//variable for the group of items in the clicked topic
var clickedMenu = document.getElementById(obj);
	//variable for all items under all topics
var allItems = document.getElementById("masterdiv").getElementsByTagName("span");
	//as long as the clicked item is not already a block display
	if(clickedMenu.style.display != "block"){ //DynamicDrive.com change
	//run through all the menu items
	for (var i=0; i<allItems.length; i++){
	//set the display only for those that are not already a block display
		if (allItems[i].style.display != "block") //DynamicDrive.com change
		allItems[i].style.display = "none";
	//change back those that are part of the clicked topic group
	clickedMenu.style.display = "block";
	//when the clicked item is already a block display, set display to none
	}
	}else{
	clickedMenu.style.display = "none";
	}
}
}


