
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+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;



function testingBug(){
    alert($('topheader').offsetWidth);
}



var currentMainNavDiv = null;
var hideTimer = null;
var mouseX;
var mouseY;

var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var tempX = 0;
var tempY = 0;
function getMouseXY(e) {
if (IE) { // grab the x-y pos.s if browser is IE

tempX = event.clientX + document.body.scrollLeft;
tempY = event.clientY + document.body.scrollTop;
}
else {  // grab the x-y pos.s if browser is NS
tempX = e.pageX;
tempY = e.pageY;
}
if (tempX < 0){tempX = 0;}
if (tempY < 0){tempY = 0;}
mouseX = tempX;
mouseY = tempY;
//document.title = "(WIDTH "+ document.body.clientWidth +")";
return true;
}

function showMainNavDiv(divString){
	clearInterval(hideTimer);
	var theDiv = $(divString);
	if(currentMainNavDiv!=null){
		currentMainNavDiv.select('div.invert')[0].setStyle({display: 'none'});
		currentMainNavDiv.select('div.content')[0].setStyle({display: 'none'});

	}
	currentMainNavDiv = theDiv;

	hideTimer = setInterval(hideMainNavDiv, 750);

	theDiv.select('div.invert')[0].setStyle({display: 'block'});
	theDiv.select('div.content')[0].setStyle({display: 'block'});


}
function hideMainNavDiv(event){
	if(!Position.within(currentMainNavDiv, mouseX, mouseY)){
		currentMainNavDiv.select('div.invert')[0].setStyle({display: 'none'});
		currentMainNavDiv.select('div.content')[0].setStyle({display: 'none'});
		clearInterval(hideTimer);
	}

}
