// JavaScript Document

/* To use this file, add this line to the html page, in the <head> section,
	after the jsHeadMenuVars.js script, and any other variable declaration
	scripts (e.g. jsHeadPictVars.js).
<script type='text/javascript' src="javascript/jsHeadMenuFuncs.js"></script>
*/

/* The functions in this file are used to make sub-menus visible and to clear them.
	
	This file is included via the page templates. It is a separate js file so that
	the code can be changed without the template having to be changed.
	These functions can be used by a page for other button usage (e.g. music/band/index.htm).
*/

// This function changes the submenu divs to hidden or visible
function changeDiv (divToChange, changeToMake) {
	document.getElementById(divToChange).style.visibility = changeToMake;
}

// This function changes all sub-menu divs to hidden. It takes as arguments the name of
// the array that has the sub-menu div names in it, and the length of that array. These
// arguments must be defined in the jsHeadMenuVars.js file.
function closeDivs (arraySubMenuDivs, numSubMenuDivs) {
	var k;
	for (k = 0; k < numSubMenuDivs; k++) {
		changeDiv (arraySubMenuDivs [k], "hidden");
	}
}
