	// if the given id is off, turn it on, and vice versa
	function toggleVis(theid, clicked) {
		if(document.getElementById) {
			if(document.getElementById(theid).style.height == 'auto') {
				hideIt(theid, clicked, true);
			} else {
				showIt(theid, clicked, true);
			}
		} else {
			// browser can't handle getelementbyid. do nothing
			return;
		}
	};
	
	
	var oldSelValue;
	
	// toggle a quickLink from selected option
	function toggleQL(mySelect) {
		var selValue = mySelect.options[mySelect.selectedIndex].value;
		if(oldSelValue) hideIt(oldSelValue, false, false);
		if(selValue == "ql-none") return;
		showIt(selValue, false, false);
		oldSelValue = selValue;
	};

	
	// show the given block
	function showIt(theid, clicked, accessible) { // accessible flags wheter the content should remain in the page or remove completely
		if(document.getElementById) {
			if(accessible == false) {
				// add it to the page
				document.getElementById(theid).style.display = 'block';
			} else {
				// show it in the page
				document.getElementById(theid).style.height = 'auto';
				document.getElementById(theid).style.top = '0';
			}
			//set colors for the button
			if(clicked) {
				clicked.style.background = 'url(/assets/stylesheets/images/nav_button_clicked.gif) left center no-repeat';
			}
		} else {
			// browser can't handle getelementbyid. do nothing
			return;
		}
	};
	
	// hide the given block
	function hideIt(theid, clicked, accessible) {
		if(document.getElementById) {
			if(accessible) {
				// hide it visibly, but leave content in the page
				document.getElementById(theid).style.height = '1px';
				document.getElementById(theid).style.top = '-1px'; // offset for height=1
			} else {
				// remove it from the page completely
				document.getElementById(theid).style.display = 'none';
			}
			// set colors for the button
			if(clicked) {
				clicked.style.background = 'url(/assets/stylesheets/images/nav_button_up.gif) left center no-repeat';
			}
		} else {
			// browser can't handle getelementbyid. do nothing
			return;
		}
	};

		
	function initHide() {
		if(document.getElementById) {
			for(i=0;i<menus.length;i++) {
				hideIt(menus[i], false, true);
				// make sure to expand the current section
				if(document.getElementById(menus[i]).className == "expanded") toggleVis(menus[i]);
			}
			for(i=0;i<quicklinkLists.length;i++) {
				hideIt(quicklinkLists[i], false, false);
			}			
		} else {
			// browser can't handle getelementbyid. do nothing
			return;
		}
	}
	
	// go to the selected item in quicklinks menu
	function qlGoSelected() {
		theSelect = document.quicklinksform.quicklinks;
		var selValue = theSelect.options[theSelect.selectedIndex].value;
		if(selValue != 'ql-none') {
			var goURL = '/'+selValue+'.html';
			window.location.assign(goURL);
		}
	}


		window.onload = initHide;