// this is the drop down menu - the submenus drop down when the item is clicked on
function checkMenu(menuno,parentitem,topcount,allparents) {
	var menuno = menuno;
	menu = 'menu' + menuno;
    menuexists = document.getElementById(menu);
	arrowtext = 'arrow' + menuno;
    arrowtextexists = document.getElementById(arrowtext);
	if (menuexists != null) {
		if (document.getElementById(menu).style.display == "block") {
   			document.getElementById(menu).style.display = "none";
			if (arrowtextexists != null) {
   				document.getElementById(arrowtext).innerHTML = "&#8658;";
			}
		} else {
   			document.getElementById(menu).style.display = "block";
			if (arrowtextexists != null) {
   				document.getElementById(arrowtext).innerHTML = "&darr;";
			}
		}
	}
}

function openMenu() {
	var menuList = document.menuform.menuopen.value;
	var opencount = document.menuform.opencount.value;
	var separateitems = menuList.split(",");
	loopcount = 0;
	while (loopcount < opencount) {
		var menuno = separateitems[loopcount];
		var menu = 'menu' + menuno;
    	menuexists = document.getElementById(menu);
		if (menuexists != null) {
			arrowtext = 'arrow' + menuno;
   			arrowtextexists = document.getElementById(arrowtext);
   			document.getElementById(menu).style.display = "block";
			if (arrowtextexists != null) {
   				document.getElementById(arrowtext).innerHTML = "&darr;";
			}
		}
		loopcount = loopcount + 1;
	}
}

function checkMap(mapno) {
	var mapno = mapno;
	map = 'map' + mapno;
    mapexists = document.getElementById(map);
	if (mapexists != null) {
		if (document.getElementById(map).style.display == "block") {
   			document.getElementById(map).style.display = "none";
		} else {
   			document.getElementById(map).style.display = "block";
		}
	}
}

function openSearchForm() {
	if (document.getElementById('searchForm').style.display == "block") {
		document.getElementById('searchForm').style.display = "none";
		document.getElementById('searchArrow').innerHTML = "Site & News &nbsp; &#8658;";
	} else {
		document.getElementById('searchForm').style.display = "block";
		document.getElementById('searchArrow').innerHTML = "Site & News &nbsp; &darr;";
	}
}

