<!-- Main menu script //-->
var errorMessage = "";
var isBrowser = new browserType(); 
var isResolution = new resolutionCheck(); 

function browserType () {   
   var browser = navigator.userAgent.toLowerCase();
   this.gecko = ((browser.indexOf('mozilla')!=-1) && (browser.indexOf('gecko') != -1)) && ((browser.indexOf('spoofer')==-1) && (browser.indexOf('compatible') == -1));
   this.ie = ((browser.indexOf('msie')!=-1) && (browser.indexOf('opera') == -1));
   this.opera = (browser.indexOf('opera') != -1);
   if (this.ie) {
      var isIe3 = (browser.indexOf("msie 3") != -1);
      var isIe4 = (browser.indexOf("msie 4") != -1);
      var isIe5 = (browser.indexOf("msie 5") != -1);
      this.supported = (!isIe3 &&!isIe4 && !isIe5); // if browser is Explorer 6.x or higher
      this.name = "IE";
   } else if (this.gecko) {
      var releaseDate = parseInt(browser.substr(browser.indexOf('gecko/') + 6, 6)); // Release date of the browser (year & month)
      if (browser.indexOf("firefox") != -1) {
         this.supported = (releaseDate >= 200409); // if browser is Firefox 1.x or higher
      } else if (browser.indexOf("netscape") != -1) {
         var netscapeVer = parseInt(browser.substr(browser.indexOf('netscape/') + 9, 1)); // if browser is Netscape 7.x or higher
         this.supported = (netscapeVer >= 7);
      } else {
         this.supported = (releaseDate >= 200406); // if browser is Mozilla 1.7 or higher
      }
      this.name = "GECKO";
   }
}
function resolutionCheck()
{
   this.recommended = (screen.width >= 1024 && screen.height >= 768);
   this.accepted = (screen.width == 800 && screen.height == 600);
   this.supported = (this.recommended || this.accepted);
}

<!-- Submenu script //-->
var currMenu = 0;
var currSubMenu = 0;
function changeBgrOn(whichSub)
{
	document.getElementById("subMenu" + whichSub).style.backgroundColor = "#003399";
}

function changeBgrOff(whichSub)
{
	document.getElementById("subMenu" + whichSub).style.backgroundColor = "#D6DFF7";
}

function hideSubMenu(whichSub)
{
	parent.mainFrame.document.getElementById("subMenuShadow").style.visibility = "hidden";
	parent.mainFrame.document.getElementById("subMenu" + whichSub).style.visibility = "hidden";
}

function handleMouseIE()
{
	if (currMenu != 0) {
		if (currSubMenu != 0) {
			var subMenuObj = document.getElementById("subMenu" + currMenu);
			bodyScrollY = parent.mainFrame.document.documentElement.scrollTop;
			bodyScrollX = parent.mainFrame.document.documentElement.scrollLeft;
			if (subMenuObj.style.visibility == "visible") {
				mouseX = event.clientX + bodyScrollX; 
				mouseY = event.clientY + bodyScrollY;	
				if (mouseY > (subMenuObj.scrollHeight + 10 + bodyScrollY) || mouseX < (subMenuObj.style.pixelLeft - 10) || mouseX > (subMenuObj.style.pixelLeft + subMenuObj.scrollWidth + 10)) parent.topFrame.hideSubMenu(); 
			}
		} else parent.topFrame.hideSubMenu();
	}
}

function handleMouseNS(e)
{
	if (currMenu != 0) {
		if (currSubMenu != 0) {
			var subMenuObj = document.getElementById("subMenu" + currMenu);
			bodyScrollY = parent.mainFrame.document.documentElement.scrollTop;
			bodyScrollX = parent.mainFrame.document.documentElement.scrollLeft;
			window.status = bodyScrollY +":"+(subMenuObj.scrollHeight + bodyScrollY) +":" + (e.pageY + bodyScrollY);
			if (subMenuObj.style.visibility == "visible") {
				var subMenuLeft = parseInt(subMenuObj.style.left);
				mouseX = e.pageX + bodyScrollX; 
				mouseY = e.pageY + bodyScrollY;	
				if (mouseY > (subMenuObj.scrollHeight + bodyScrollY + 10) || mouseX < (subMenuLeft + bodyScrollX - 10) || mouseX > (subMenuLeft + subMenuObj.scrollWidth + bodyScrollX + 10)) parent.topFrame.hideSubMenu(); 
			}
		}
	}
}

var bodyScrollY = 0;
var bodyScrollX = 0;

function mouseEvent() 
{
	if (isBrowser.ie) {
	document.onmousemove = handleMouseIE;
	} else {
	document.captureEvents(Event.MOUSEMOVE)
	document.onmousemove = handleMouseNS;
	}
}
parent.parent.frameLoaded();

