	function showlayer(clickedMenu){
		var myElement = document.getElementById(clickedMenu);
		
		var myArrow = myElement.childNodes[0].childNodes[0];
		var myTitleBG = myElement;
		var myMenu = myElement.childNodes[1];
		
		//if menu not open
		if(myMenu.style.display=="none" || myMenu.style.display==""){
			
			//get list of all menus
			var allMenus = getElementsByClassName(document, 'ul', 'dropdown_menu');
			//close all menus that could be open
			allMenus.forEach(closeAllMenus);
			
			//open menu
			myMenu.style.display="block";
			
			//set arrow and title active states
			myArrow.className='dropdown_arrow active_arrow';
			myTitleBG.className='dropdown_menu active_title_bg';
			
		} else {// close me
			myMenu.style.display="none";
			
			//set arrow and title states to default
			myArrow.className='dropdown_arrow';
			myTitleBG.className='dropdown_menu';
		}
	}
	function closeAllMenus(element, index, array) {
		//grab element
		var myElement = document.getElementById(element.id)
		//first sub element is LI then arrow
		var myArrow = myElement.childNodes[0].childNodes[0];
		//current element is the title bg
		var myTitleBG = myElement;
		//second sub element is the menu UL
		var myMenu = myElement.childNodes[1];
		
		myMenu.style.display="none";
		myArrow.className='dropdown_arrow';
		myTitleBG.className='dropdown_menu';
	}
	function getElementsByClassName(oElm, strTagName, strClassName){
		var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName);
		var arrReturnElements = new Array();
		strClassName = strClassName.replace(/\-/g, "\\-");
		var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
		var oElement;
		for(var i=0; i<arrElements.length; i++){
			oElement = arrElements[i];
			if(oRegExp.test(oElement.className)){
				arrReturnElements.push(oElement);
			}
		}
		return (arrReturnElements)
	}
	function writeConsole(content) {
		top.consoleRef=window.open('','myconsole',
			'width=350,height=250'
			+',menubar=0'
			+',toolbar=1'
			+',status=0'
			+',scrollbars=1'
			+',resizable=1'
		)
		top.consoleRef.document.writeln(
			'<html><head><title>Console</title></head>'
			+'<body bgcolor=white onLoad="self.focus()">'
			+content
			+'</body></html>'
		)
		top.consoleRef.document.close()
	}