// JavaScript Document

startList = function () {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("MainMenu");
		for ( i = 0; i < navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];

	        if (node.nodeName=="LI") {
				//TODO: Recursive
				for (j = 0; j < node.childNodes.length; j++) {
					str = ( node.childNodes[j].id == null ) ? "" : node.childNodes[j].id;
					if (str.substr(0,7) == "SubMenu" ) {
						DoIt(node.childNodes[j].name);
					}
				}
				
				node.onmouseover=function() {
				this.className+=" over";
				}
				node.onmouseout=function() {
				this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

function DoIt(who) {
	if (document.all&&document.getElementById) {
		subRoot = document.getElementById(who);
	
		for ( k = 0; k < subRoot.childNodes.length; k++) {
			subnode = subRoot.childNodes[k];
	      
	        if (subnode.nodeName=="LI") {
				subnode.onmouseover=function() {
				this.className+=" over";
				}
				subnode.onmouseout=function() {
				this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

window.onload=startList;