startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" active";
				}
				node.onmouseout=function() {
					this.className=this.className.replace
					(" active", "");
				}
			}
		}
	}
	var ver = navigator.appVersion;
	if (ver.indexOf("MSIE") == -1)
	{
	} else {
		var elements = document.getElementsByTagName("LI");
	
		for(i = 0; i < elements.length; i++) {
			if(elements[i].className == 'gotchilds') {
				submenu = elements[i].getElementsByTagName("UL");
			
				if(submenu.length == 1) {
					elements[i].setAttribute('onmouseover', function() { showSubmenu(this); });
					elements[i].setAttribute('onmouseout', function() { hideSubmenu(this); });
				}
			}
		}
	}
}

if (window.addEventListener)
	window.addEventListener("load", startList, false)
else if (window.attachEvent)
	window.attachEvent("onload", startList)

function showSubmenu(parent) {
	submenu = parent.getElementsByTagName("UL");
	
	if(submenu.length == 1) {
		submenu[0].style.position = 'absolute';
		submenu[0].style.display = 'block';
		submenu[0].style.left = parent.offsetLeft- 22;
		submenu[0].style.top = parent.offsetTop + 26; 
		parent.style.background = '#foo';
	}
}

function hideSubmenu(parent) {
	submenu = parent.getElementsByTagName("UL");
	
	if(submenu.length == 1) {
		submenu[0].style.position = 'absolute';
		submenu[0].style.left = '-999%';
	}	
}
