startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav").childNodes[0];
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
//loop through children to get ULs
for (j=0; j<node.childNodes.length; j++) {
subnode = node.childNodes[j];
if (subnode.nodeName=="UL") {
//loop through the subnav ULs' children LIs & add over states
for (k=0; k<subnode.childNodes.length; k++) {
subnodeChild = subnode.childNodes[k];
if (subnodeChild.nodeName=="LI") {
subnodeChild.onmouseover=function() {
this.className+=" over";
}
subnodeChild.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
}
}
}
}
window.onload=startList;