function addMouseHandler(e) {
	var node;
	for (var i=0; i<e.childNodes.length; i++) {
		node = e.childNodes[i];
		//debug(node.nodeName);
		if (node.nodeName=="LI") {
			//debug("depth: " + depth + ",  node:" + i);
			if (node.childNodes.length>1) {
				for (var j=0; j<node.childNodes.length; j++) {
					//alert(node.childNodes[j].nodeName);
				if (node.childNodes[j].nodeName=="UL") {
				
					node.onmouseover=function() { 
						cnDisplay(this,'block'); 
					}
					
					node.onmouseout=function() { 
						cnDisplay(this,'none');
					}
					
					addMouseHandler(node.childNodes[1]);
				}
				}
			}
		}
	}
}

function cnDisplay(node,displayStyle) {
		for (var j=0; j<node.childNodes.length; j++) {
			if (node.childNodes[j].nodeName=="UL") {
				node.childNodes[j].style.display=displayStyle; 
				break;
			}
		}
}

function debug(em) {
	alert(em);
}

function initPopup(menuID) {
	// if IE....
	
	if ((navigator.appName.indexOf("Microsoft Internet Explorer")!=-1) && (navigator.userAgent.indexOf("Opera")==-1)) {
		addMouseHandler(document.getElementById(menuID));
	}
}

// usage: initPopup(**ID OF FIRST UL**);
