var isMenuOn = false;
var aboveNav, belowNav; 
var mainSwitch = 0;
var bName = navigator.appName;
var browser;
var menuTop = 85;

//get browser type
if(bName == "Netscape") {
	browser = "nn";
}

function turnOn() {
	mainSwitch = 1;
}

if (window.captureEvents) {
        window.captureEvents(Event.MOUSEMOVE);
        window.onmousemove = menuTracker;
} else {
        document.onmousemove = menuTracker;
        
}

function menuTracker(e){

	e = e || window.Event || window.event;
    window.pageY = e.pageY || e.clientY;

	setTimeout("",2000);

	if (isMenuOn == true) { 
			aboveNav = menuTop - 23;;		//pixels above nav
			belowNav = menuTop + 280;	//pixels below nav
		if (window.pageY < aboveNav || window.pageY > belowNav) {
				hideMenu();
		}
	}

}

// hide element  
function hideMenu() {
	if (mainSwitch == 1) {
		isMenuOn = false;
  		theobjs["menu"].objHide();
	}
}

// show element
function showMenu() {
	if (mainSwitch == 1) {
		isMenuOn = true;
	   	theobjs["menu"].objShow();
		menuTop = window.pageY;
	}

}

function menuOn(img) {
	if (mainSwitch == 1) {
		if (browser == 'nn') {
			document.layers['menu'].document.images[img].src = eval(img + "on.src");
		} else {
			window.document.images[img].src = eval(img + "on.src");
		}
	}
}

function menuOff(img) {
	if (mainSwitch == 1) {
		if (browser == 'nn') {
			document.layers['menu'].document.images[img].src = eval(img + "off.src");
		} else {
			window.document.images[img].src = eval(img + "off.src");
		}
	}
}
