//
// BrowserDetect (Netscape or Microsoft Internet Explorer)
//

var browser = navigator.appName;
var ns4 = (document.layers) ? true : false;
var ie4 = (document.all) ? true : false;
var ver4 = (ns4 || ie4) ? true : false;

//
// Menu Top Roll Over
//

var aPopups = new Array();
var aMenuLeft = new Array();

function SetBeginEnd(index,from,to,whichmenu) {
	if (whichmenu == "left") {
		aMenuLeft[index] = new Array();
		aMenuLeft[index][0] = from;
		aMenuLeft[index][1] = to;
	}
	else {
		aPopups[index] = new Array();
		aPopups[index][0] = from;
		aPopups[index][1] = to;
	}
}

//----- Menu Top -----//

SetBeginEnd(1,0,71,"top");
SetBeginEnd(2,72,154,"top");
SetBeginEnd(3,155,241,"top");
SetBeginEnd(4,242,334,"top");
SetBeginEnd(5,335,439,"top");
SetBeginEnd(6,440,526,"top");
SetBeginEnd(7,527,605,"top");
SetBeginEnd(8,606,738,"top");

//----- Menu Left -----//

SetBeginEnd(1,18,35,"left");
SetBeginEnd(2,36,53,"left");
SetBeginEnd(3,54,71,"left");
SetBeginEnd(4,72,89,"left");
SetBeginEnd(5,90,107,"left");
SetBeginEnd(6,108,125,"left");

var clMenuTopTop = 0;
var clMenuTopBottom = 15;
var clMenuLeftLeft = 0;
var clMenuLeftRight = 113;

function MenuTopOver(index, over) {
	if (ie4) elWhich = document.all.elMenuTopOver.style; else elWhich = document.elMenuTopOver;
	if (!over) { elWhich.visibility = "hidden"; return; }

	clLeft = aPopups[index][0];
	clRight = aPopups[index][1];

	if (ns4) {
		elWhich.clip.left = clLeft;
		elWhich.clip.right = clRight;
	}
	else {
		elWhich.clip = "rect(" + clMenuTopTop + " " + clRight + " " + clMenuTopBottom + " " + clLeft + ")";
	}

	elWhich.visibility = "visible";
}

function MenuLeftOver(index, over) {
	if (ie4) elWhich = document.all.elMenuLeftOver.style; else elWhich = document.elMenuLeftOver;
	if (!over) { elWhich.visibility = "hidden"; return; }

	clTop = aMenuLeft[index][0];
	clBottom = aMenuLeft[index][1];

	if (ns4) {
		elWhich.clip.top = clTop;
		elWhich.clip.bottom = clBottom;
	}
	else {
		elWhich.clip = "rect(" + clTop + " " + clMenuLeftRight + " " + clBottom + " " + clMenuLeftLeft + ")";
	}

	elWhich.visibility = "visible";
}
