
var all_uls = new Array(
	'ul_one',
	'ul_two',
	'ul_three',
	'ul_four',
	'ul_five',
	'ul_six',
	'ul_seven',
	'ul_eight',
	'ul_nine'
	); 

//window.onload=hideAllULs; // First thing after the page is loaded, hide the ULs, becausebrowsers with javascript turned off need to see the menu too.
// this has to be done in the onload event, or at the end of the HTML after the elements have all been read in. Putting it inside the <head> tag causes
// an "object required" error, because the menu elements haven't actually been downloaded yet.

function openMenu1(){
	changeOpenMenu(all_uls[0]); // First index is 0...
}

function openMenu2(){
	changeOpenMenu(all_uls[1]); // First index is 0...
}

function openMenu3(){
	changeOpenMenu(all_uls[2]); // First index is 0...
}

function openMenu4(){
	changeOpenMenu(all_uls[3]); // First index is 0...
}

function openMenu5(){
	changeOpenMenu(all_uls[4]); // First index is 0...
}

function openMenu6(){
	changeOpenMenu(all_uls[5]); // First index is 0...
}

function openMenu7(){
	changeOpenMenu(all_uls[6]); // First index is 0...
}

function openMenu8(){
	changeOpenMenu(all_uls[7]); // First index is 0...
}

function openMenu9(){
	changeOpenMenu(all_uls[8]); // First index is 0...
}



function hideAllULs(){
	for(i=0;i<all_uls.length;i++){ 
		document.getElementById(all_uls[i]).style.display = 'none'; 
	} 
}
function changeOpenMenu(id){ 
	var the_ul;
	
	the_ul = document.getElementById(id);
	if (the_ul.style.display == 'block') flag = 1; // If the clicked-on item is displayed already, set flag = 1 to close it.
	else flag = 0; // otherwise, set flag = 0 to display it.
	
hideAllULs();
	
	if (flag == 0)	// If flag == 0, display the element.
	the_ul.style.display = 'block'; 
	else  // else, hide the element, because it is already displayed.
	the_ul.style.display = 'none'; 
	
	clearButtons(); 
} 
function clearButtons() { 
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a"); 
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		anchor.blur(); 
	} 
} 
