function ToggleChildUL(node,showhide) {
	var i;
	var thisnode;
	for (i=0;i<node.childNodes.length;i++) {
		thisnode=node.childNodes[i];
		if (thisnode.nodeName=='UL') {
			if (showhide=='show') thisnode.className+=' over';
			else thisnode.className=thisnode.className.replace(' over','');
			return;
		}
	}
}

function HasULChild(node) {
	var i;
	for (i=0;i<node.childNodes.length;i++) {
		if (node.childNodes[i].nodeName=='UL') return 1;
	}
	return 0;
}

function FixNav(thisnode,setthese) {
	var i;
	var j;
	var node;
	for (i=0;i<thisnode.childNodes.length;i++) {
		node=thisnode.childNodes[i];
		for (j=0;j<setthese.length;j++) {
			if ((node.nodeName==setthese[j])&&HasULChild(node)) {
				node.onmouseover=function() { this.className+=' over'; ToggleChildUL(this,'show'); }
				node.onmouseout=function() { this.className=this.className.replace(' over',''); ToggleChildUL(this,'hide'); }
			}
		}
		if (node.childNodes&&node.childNodes.length) FixNav(node,setthese);
	}
}

startList = function() {
	var setthese=new Array('DIV','LI');
	if (document.all&&document.getElementById)
		FixNav(document.getElementById("nav"),setthese);
}
window.onload=startList;
