// JavaScript Document

function addLiEventsToUl(ulElement) {
	for (i=0; i<ulElement.childNodes.length; i++) {
		node = ulElement.childNodes[i];
		if (node.nodeName=="LI") {
			addEventsToLi(node);
			
		}
	}
}

function addEventsToLi(node) {
	node.onmouseover=function() {
		this.className+=" over";
	};
	node.onmouseout=function() {
                this.className=this.className.replace(" over", "");
	};
}

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		lis = navRoot.getElementsByTagName('LI');
		for(var i = 0; i < lis.length; i++) {
			addEventsToLi(lis[i]);
		}
		/*
		if(navRoot) {
			addLiEventsToUl(navRoot);
		}
		index = 1;
		do {
			ul = document.getElementById("nav" + index);
			if(ul == undefined) {
				break;
			}
			addLiEventsToUl(ul);
			index++;
		} while(true);*/
		
	}
}

window.onload=startList;

