function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}

//do browser detect stuff
var isNS = (navigator.appName == "Netscape");
var isMacIE = ( (navigator.userAgent.indexOf("IE 4")  > -1) && (navigator.userAgent.indexOf("Mac")  > -1) );
var layerRef = (isNS) ? "document" : "document.all";
var styleRef = (isNS) ? "" : ".style";
var isDynamic = ( (document.layers || document.all) && !isMacIE );

var activeMenu = 0;
var finalClip;


function activateMenu(menuLayerRef, offset) {
	
	if (isDynamic && activeMenu != menuLayerRef) {

		if (activeMenu) hideMenu("menu" + activeMenu);
			
		menuID = "menu" + menuLayerRef;
		activeMenu = menuLayerRef;

		if (isNS) {
			document[menuID].top = 121;
			document[menuID].left = offset;
		} else {
			document.all[menuID].style.pixelTop = 121;
			document.all[menuID].style.pixelLeft = offset;
		}

		showMenu(menuID)
		
	}
	if (isDynamic && !isNS) window.event.cancelBubble = true;
}

function showMenu(layerID) {
	eval(layerRef + '["' + layerID + '"]' + styleRef + '.visibility = "visible"');
}

function hideMenu(layerID) {
	eval(layerRef + '["' + layerID + '"]' + styleRef + '.visibility = "hidden"');
}

function killMenu(e) {

	//check if theres a menu active
	if (activeMenu) {
		menuID = "menu" + activeMenu;
		if (isNS) {
			menuX1 = document[menuID].left;
			menuX2 = menuX1 + document[menuID].clip.right;
			menuY1 = document[menuID].top;
			menuY2 = menuY1 + document[menuID].clip.bottom;
			
			if (e.pageX < menuX1 || e.pageX > menuX2 || e.pageY > menuY2) {
				hideMenu(menuID);
				activeMenu = 0;
			}
		} else {
				hideMenu(menuID);
				activeMenu = 0;

		}
	}  

}


function init() {
	if (isDynamic) {
		if (isNS) { 
			document.captureEvents(Event.MOUSEMOVE); 
			document.onmousemove = killMenu;
		} else {
			document.onmouseover = killMenu;
		}
		
	}
}

function go(which, num, win,fr) {
  n = which.selectedIndex;
  if (n != 0) {
    var url = eval("urls" + num + "[n]")
    if (win) {
      openWindow(url);
    } else {
      parent.right.location.href = url;
    }
  }
}

function doNavigation(s) {
	var g = s.options[s.selectedIndex].value;
	location.href = g;
	s.selectedIndex=0;
}

