
wd = screen.width;
var codest = '<SCRIPT LANGUAGE="Javascript" SRC="/scripts/';
var cd2 = '.js"></SCRIPT>';
if (wd == 1024)
{var x = 131; z = 373; a=335; b = 45; c = 565;  d = 142; m = 232;}
if (wd == 800)
{var x = 28;m = 120;z = 258;a = 225;b = -40; d = 50; c = 565;}
if (wd == 640)
{var x=506;}
var y = 126;
var NS = (navigator.appName == "Netscape");
var ver = navigator.appVersion
var isNS = (NS && ver.indexOf(5) < 0);
var isNS6 = (NS && ver.indexOf(5) >= 0);
var isMacIE = ( (navigator.userAgent.indexOf("IE 4")  > -1) && (navigator.userAgent.indexOf("Mac")  > -1) );

/*if(NS)
{
	var layerRef = (isNS) ? "document" : "document.all"; 
}
else{
	var layerRef = (isNS6) ? "document.getElementById" : "document.all";
}
*/

var layerRef = (isNS) ? "document" : ((isNS6) ? "document.getElementById" : "document.all");

var styleRef = (isNS) ? "" : ".style";

var isDynamic = ( (document.getElementById || document.layers || document.all) && !isMacIE );

//track which menu is active
var activeMenu = 0;
var vo; var whichactive = "top";
//display a selected menu
//alert(isNS6);

function activateMenu(menuLayerRef, offset, voffset) {

vo = voffset;
if(ld==0)
{
}else{
        if (isDynamic && activeMenu != menuLayerRef) {

                if (activeMenu) hideMenu("menu" + activeMenu);
                        
                menuID = "menu" + menuLayerRef;
                activeMenu = menuLayerRef;
                hmenuoff = offset;
if(voffset == '2x')
	whichactive = "bottom";
else if(voffset == 106)
	whichactive = "top";
	
if (whichactive == "bottom")
{
	vo = '2x';
	voffset = y+108;
}else{
	voffset = y;
}

if(offset==560)
offset = 585;

                vmenuoff = voffset;
                if (isNS) {
						document[menuID].top = 25 + voffset;
                        document[menuID].left = offset;
						document[menuID].zIndex = 2;
                }else if(isNS6)
					{
						document.getElementById(menuID).style.top = 620+voffset;
                        document.getElementById(menuID).style.left = offset;
						document.getElementById(menuID).style.zIndex = 2;
					}
				else {
                        document.all[menuID].style.pixelTop = 627 + voffset;
                        document.all[menuID].style.pixelLeft = offset;
                } // if is NS else

                showMenu(menuID)
        } // if is dynamic and new menu needed
        // kill menu if browser is IE
        if (isDynamic && !isNS && !isNS6) window.event.cancelBubble = true;
}
} // activateMenu

function showMenu(layerID) {
        if(isNS6)
	{
		eval(layerRef + '("' + layerID + '")' + styleRef + '.visibility = "visible"');
	}else{
		eval(layerRef + '["' + layerID + '"]' + styleRef + '.visibility = "visible"');
	}
}


function hideMenu(layerID) {
	if(isNS6)
	{
		        eval(layerRef + '("' + layerID + '")' + styleRef + '.visibility = "hidden"');
	}else{
        eval(layerRef + '["' + layerID + '"]' + styleRef + '.visibility = "hidden"');
	}
}

// get rid of menus when outside menu or button
function killMenu(e) {
  //check if theres a menu active

  if (activeMenu) {
    menuID = "menu" + activeMenu;
    if (isNS) {
	// top menus
        if (activeMenu <=700) {
	  menuX1 = document[menuID].left;
	  menuX2 = menuX1 + document[menuID].clip.right;
	  menuY1 = document[menuID].top;
	  menuY2 = menuY1 + document[menuID].clip.bottom;
	} // if menu 1 through 5
	// side menus
        if (activeMenu >=701) {
 	  menuX1 = 0;
          menuX2 = 245;
	  menuY1 = document[menuID].top;
	  menuY2 = menuY1 + document[menuID].clip.bottom;
        } // if menu 6 or greater
        if ((e.pageX < menuX1) || (e.pageX > menuX2) ||
             (e.pageY < menuY1) || (e.pageY > menuY2)) {
             hideMenu(menuID);
	     activeMenu = 0;
        } // if in menu
    }else if(isNS6)
	{
		hideMenu(menuID);
		activeMenu = 0;
	} else { // if not NS
	hideMenu(menuID);
	activeMenu = 0;
    }  //if isNS else
  }  //if activeMenu
}  //function

// initialize the menu system
function init() {
  if (isDynamic) {
    if (isNS) { 
	document.captureEvents(Event.MOUSEOUT); 
	document.onmouseout = killMenu;
    }else if (isNS6) { 
	document.onmouseout = killMenu;
	}else {
	document.onmouseover = killMenu;
    } // if NS else
		
  } // if dynamic
} // init

window.onload = init();