
	var timer
	var lastMenu = null
	
	function hideMenu(menuId) {
		if (timer) { clearTimeout(timer); }
		timer = setTimeout("hideMenuFinal("+menuId+");",600);
	}
	function showMenu(menuId) {
		if (lastMenu > 0) { document.getElementById('menu'+lastMenu).className = 'menuHidden'; }
		if (timer) { clearTimeout(timer); }
		var currentMenu = 'menu'+menuId;
		document.getElementById(currentMenu).className = 'menuVisible';
		lastMenu = menuId;
	}
	function hideOtherMenus() {
		if (lastMenu > 0) { document.getElementById('menu'+lastMenu).className = 'menuHidden'; lastMenu = 0; }
		if (timer) { clearTimeout(timer); }
	}
	function hideMenuFinal(menuId) {
		if (timer) { clearTimeout(timer); }
		var currentMenu = 'menu'+menuId;
		document.getElementById(currentMenu).className = 'menuHidden';
	}
	
	
	function showCurrentMenu() {
		if (lastMenu > 0) { showMenu(lastMenu);	}	
	}
	function hideCurrentMenu() {
		if (lastMenu > 0) { hideMenu(lastMenu);	}	
	}
	
	function resizeViewports() {
		if (document.body.offsetWidth < 818) {
			document.getElementById('pageWrapper').className = 'smallResolution';
		} else {
			document.getElementById('pageWrapper').className = 'largeResolution';
		}
	}
	
	function setResizeFunction() {
		onresize=resizeViewports;
	}