<!--
//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, top, centered, sp ) {
	// MenuLayerRef = Menu number
	// Offset = how many to the right from SP
	// Top = How many pixels from the top
	// centered = either 0 or 1 telling the menu that we have a centered table with table width of SP
	// SP = Starting point, or table width
	// - Ben Hynes 27/Sep/2000
		
	if (isDynamic && activeMenu != menuLayerRef) {

		if (activeMenu) hideMenu("menu" + activeMenu);
			
		menuID = "menu" + menuLayerRef;
		activeMenu = menuLayerRef;
		
		if (centered != 1) {
			startpoint = sp;
		} else { 
			if (isNS) {	
				startpoint = (window.innerWidth / 2) - (sp / 2);
			} else {
				startpoint = (document.body.clientWidth / 2) - (sp / 2);
			}
		}
		
		if (isNS) {
			document[menuID].top = top + 5;
			document[menuID].left = startpoint + offset;
			// Modified for centered table where browser width is variable. - Ben Hynes.
		} else {
			document.all[menuID].style.pixelTop = top;
			document.all[menuID].style.pixelLeft = startpoint + 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;
		}
		
	}
}

//This function is included just for demonstration
function popUp(moviePath, winName, xSize, Ysize) {	
      window.open(moviePath, winName, "width=" + xSize + ",height=" + Ysize + ",directories=no,status=no,scrollbars=no,resize=no,menubar=no,toolbar=no,alwaysRaised=yes" );
}
//-->

function newbrowser(url, title) {
    window.open(url, title,"top=100,left=100,width=370,height=420,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no")
}
