// JavaScript Document

function initMenu(){
	if(document.all && document.getElementById){
		navRoot = document.getElementById('mainmenu');
		for(var i=0; i<navRoot.childNodes.length; i++){
			var node = navRoot.childNodes[i];
			if(node.nodeName == 'LI'){
				node.onmouseover = function(){ this.className += ' over'; }
				node.onmouseout = function(){ this.className = this.className.replace(' over', ''); }
				for(var j=0; j<node.childNodes.length; j++){
					var subroot = node.childNodes[j];
					if(subroot.nodeName == 'UL'){
						for(var k=0; k<subroot.childNodes.length; k++){
							var subnode = subroot.childNodes[k];
							if(subnode.nodeName == 'LI'){
								subnode.onmouseover = function(){ this.className += ' over'; }
								subnode.onmouseout = function(){ this.className = this.className.replace(' over', ''); }
								for(var m=0; m<subnode.childNodes.length; m++){
									var subroot2 = subnode.childNodes[m];
									if(subroot2.nodeName == 'UL'){
										for(var n=0; n<subroot2.childNodes.length; n++){
											var subnode2 = subroot2.childNodes[n];
											if(subnode2.nodeName == 'LI'){
												subnode2.onmouseover = function(){ this.className += ' over'; }
												subnode2.onmouseout = function(){ this.className = this.className.replace(' over', ''); }
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

function initMenu2(){
	if(document.all && document.getElementById){
		navRoot = document.getElementById('sidenav');
		for(var i=0; i<navRoot.childNodes.length; i++){
			var node = navRoot.childNodes[i];
			if(node.nodeName == 'LI'){
				node.onmouseover = function(){ this.className += ' over'; }
				node.onmouseout = function(){ this.className = this.className.replace(' over', ''); }
			}
		}
	}
}

/*
var isIE = document.all ? true : false;
var isNS = document.layers ? true : false;
var isDOM = document.getElementById ? true : false;

var mainmenu = new Array();

// element name, submenu name, submenu array count
mainmenu[0] = new Array('home', '', 0);
mainmenu[1] = new Array('hours', 'submenu_hours', 12);
mainmenu[2] = new Array('howdo', 'submenu_howdo', 2);
mainmenu[3] = new Array('services', 'submenu_services', 6);
mainmenu[4] = new Array('infodesk', 'submenu_infodesk', 2);
mainmenu[5] = new Array('resources', 'submenu_resources', 4);
mainmenu[6] = new Array('media', 'submenu_media', 1);
mainmenu[7] = new Array('reviews', 'submenu_reviews', 2);
mainmenu[8] = new Array('aboutus', 'submenu_aboutus', 6);
mainmenu[9] = new Array('contactus', 'submenu_contactus', 1);


function initMenu(){
	loadMainMenu();
}

function loadMainMenu(){
	for(var i=0; i<mainmenu.length; i++){
		showMain(mainmenu[i]);
		showSub(mainmenu[i][1], mainmenu[i][2]);
	}
}

function showMain(menuItem){
	if(menuItem[2] > 0){
		var mi = getElement(menuItem[0]);
		mi.onmouseover = function(){ showMenu(menuItem[1]); };
		mi.onmouseout = function(){ hideMenu(menuItem[1]); };
	}
}

function showSub(subItem, count){
	for(var i=0; i<count; i++){
		var si = getElement(subItem);
		si.onmouseover = function(){ clearTimeout(delay); };
		si.onmouseout = function(){ hideMenu(subItem); };
	}
}


function getElement(id){
	if(isIE) return document.all(id);
	if(isNS) return document.layers[id];
	if(isDOM) return document.getElementById(id);
}

function showMenu(id){
	getElement(id).style.display = 'block';
}

function hideMenu(id){
	delay = setTimeout('hideMe("' + id + '")', 100);
}

function hideMe(id){
	getElement(id).style.display = 'none';
}

*/
