startList = function() {
	if (document.all && document.getElementById) {
		navRoot = document.getElementById("mainmenu");
		listElements = navRoot.getElementsByTagName("LI");

		for (i=0; i < listElements.length; i++) {
			node = listElements[i];

			node.onmouseover = function() {
				this.className += " over";
			}

			node.onmouseout = function() {
				this.className = this.className.replace(" over", "");
			}

			nodeAnchors = node.getElementsByTagName("A");

			nodeAnchors[0].onfocus = function() {
				this.parentNode.className += " over";
			}

			nodeAnchors[0].onblur = function() {
				if (this.parentNode.getElementsByTagName("UL").length < 1) {
					this.parentNode.className = this.parentNode.className.replace(" over", "");
				}

				if (this.parentNode == this.parentNode.parentNode.lastChild) {
					this.parentNode.parentNode.parentNode.className = this.parentNode.parentNode.parentNode.className.replace(" over", "");
				}
			}
		}
	}
}

window.onload = startList;