homeOnload = function() { 
}

initNavigation = function() {
	if (document.getElementById) { // Does the browser support the getElementById method?
		navRoot = document.getElementById("nav_list"); // Get main list ul
		if (typeof defaultMainList!="undefined") {
			var reMainNav = new RegExp("^" + defaultMainList + "<", "i");
		}
		for (i=0; i<navRoot.childNodes.length; i++) { // Loop over main list items
			node = navRoot.childNodes[i];
			
			if (node.nodeName == "LI") {
				if ((typeof defaultMainList!="undefined") && node.firstChild.innerHTML.match(reMainNav)) { // Found default main nav item
					defaultMainListIndex = i;
					navRoot.childNodes[defaultMainListIndex].className = "defaulttabout";
					navRoot.childNodes[defaultMainListIndex].onmouseover = function () {
					navRoot = document.getElementById("nav_list");
						navRoot.childNodes[defaultMainListIndex].className = "defaulttabover";
					}
					navRoot.childNodes[defaultMainListIndex].onmouseout = function() {
					navRoot = document.getElementById("nav_list");
						navRoot.childNodes[defaultMainListIndex].className = "defaulttabout";
					}
				} else {
					node.onmouseover = function() {
						this.className = "mouse_over";
					}
					node.onmouseout = function() {
						this.className = "";
					}
				}
			}
		}
	}
}


initChildNavigation = function() {
	if (document.getElementById) { // Does the browser support the getElementById method?
		navRoot = document.getElementById("child_nav_list"); // Get main list ul
		if (typeof defaultChildMainList!="undefined") {
			var reMainNav = new RegExp("^" + defaultChildMainList + "<", "i");
		}
		if (navRoot != null){
			for (i=0; i<navRoot.childNodes.length; i++) { // Loop over main list items
				node = navRoot.childNodes[i];
				if (node.nodeName == "LI") {
					if ((typeof defaultChildMainList!="undefined") && node.firstChild.innerHTML.match(reMainNav)) { // Found default main nav item
						defaultChildMainListIndex = i;
						navRoot.childNodes[defaultChildMainListIndex].className = "defaulttaboutChild";
						navRoot.childNodes[defaultChildMainListIndex].onmouseover = function () {
							navRoot.childNodes[defaultChildMainListIndex].className = "defaulttaboverChild";
						}
						navRoot.childNodes[defaultChildMainListIndex].onmouseout = function () {
							navRoot.childNodes[defaultChildMainListIndex].className = "defaulttaboutChild";
						}
					} else {
						node.onmouseover = function() {
							this.className = "mouse_over";
						}
						node.onmouseout = function() {
							this.className = "";
						}
					}
				}
			}
		}
	}
}

startList = function() {
	initNavigation();
	initChildNavigation();
	homeOnload();
}

var defaultMainListIndex = -1;
var defaultChildMainListIndex = -1; // Integer, index of the default main list item

window.onload=startList; // Set the page onload event handler
