function pageLoad() {
  arrTd = document.getElementsByTagName("td");
  for(i=0;i<arrTd.length;i++) {
    if((arrTd[i].className=="topnavcell")||(arrTd[i].className=="subnavcell")) {
	  arrTd[i].onmouseover = new Function("doOverNav(this)");
	  arrTd[i].onmouseout = new Function("doOutNav(this)");
	}
  }
}

window.onload = pageLoad;

var curNav = "none";
var curSub = "none";
var intClose = "";

function doOverNav(navObj) {
  if(navObj.className=="topnavcell") {
    navObj.className="topnavcell1";
	if(curSub!="none") {
	  curSub.style.visibility = "hidden";
	  curNav.className="topnavcell";
	}
	curNav = navObj;
	curSub = document.getElementById("sub"+navObj.id);
	curSub.style.left = navObj.offsetLeft + "px";
	curSub.style.top = navObj.offsetParent.offsetTop + navObj.offsetTop + 27 + "px";
	curSub.style.visibility= "visible";
  }
  if(navObj.className=="subnavcell") {
    navObj.className="subnavcell1";
  }
  clearInterval(intClose);
}

function doOutNav(navObj) {
  if(intClose!="") clearInterval(intClose);
  if((navObj.className=="topnavcell1")&&(curNav!=navObj)) {
    navObj.className="topnavcell";
  }
  if(navObj.className=="subnavcell1") {
    navObj.className="subnavcell";
  }
  intClose = setInterval("closeNav()",250);
}

function closeNav() {
	if(curSub!="none") {
	  curSub.style.visibility = "hidden";
	  curNav.className="topnavcell";
	  curNav = "none";
	  curSub = "none";
	}
	clearInterval(intClose);
}