
var isNS = (navigator.appName == "Netscape");
var layerRef = "document.getElementById";
var styleRef = ".style";
var topRef = (isNS) ? ".top" : ".pixelTop";
var leftRef = (isNS) ? ".left" : ".pixelLeft";
var isDynamic = (document.getElementById);
var activeMenu = 0;


leftPixel = 158;
topPixel = new Array();
topPixel[0] = 0;
topPixel[1] = 109;
topPixel[2] = 149;
topPixel[3] = 174;
topPixel[4] = 200;
topPixel[5] = 223;
topPixel[6] = 0;
topPixel[7] = 0;
topPixel[10] = 253;


function activateMenu(menuLayerRef, theClass){
 if (isDynamic && activeMenu != menuLayerRef)
 {
  if (activeMenu) 
  {
   if (activeMenu == 1) {hideMenu(menuID, 'outSpan1')};
   if (activeMenu == 2) {hideMenu(menuID, 'outSpan2')};
   if (activeMenu == 3) {hideMenu(menuID, 'outSpan2')};
   if (activeMenu == 4) {hideMenu(menuID, 'outSpan3')};  
  }
  menuID = "menu" + menuLayerRef;
  activeMenu = menuLayerRef;	
  eval(layerRef + "('" + menuID + "')" + styleRef + topRef + ' = ' + topPixel[menuLayerRef]);
  eval(layerRef + "('" + menuID + "')" + styleRef + leftRef + ' = ' + leftPixel);
  showMenu(menuID, theClass);
 }
 if (isDynamic && !isNS) window.event.cancelBubble = true;
}


function showMenu(menuID) {
 eval(layerRef + "('" + menuID + "')" + styleRef + '.visibility = "visible"');
 eval(layerRef + "('item" + activeMenu + "')" + ".className='overSpan1'");
}

function hideMenu(menuID, theClass){
 eval(layerRef + "('" + menuID + "')" + styleRef + '.visibility = "hidden"');
 eval(layerRef + "('item" + activeMenu + "')" + ".className='" + theClass + "'");
}


function killMenu(){
 if (activeMenu != 0)
 {
  menuID = "menu" + activeMenu;
  if (activeMenu == 1) {hideMenu(menuID, 'outSpan1')};
  if (activeMenu == 2) {hideMenu(menuID, 'outSpan2')};
  if (activeMenu == 3) {hideMenu(menuID, 'outSpan2')};
  if (activeMenu > 3) {hideMenu(menuID, 'outSpan3')};
  activeMenu = 0;
 }  
}



function spanIn(theSpan){
 theSpan.className='overSpan1';
}

function spanOut(theSpan, theClass){
 if (!activeMenu)
  theSpan.className=theClass;
}


function spanOutSub(theSpan){
 theSpan.className='outSpanSub';
}


function spanInSub(theSpan, theClass){
 theSpan.className='overSpanSub';
 if (activeMenu)
 { 
  eval("item" + activeMenu + ".className='overSpan1'");
 }
}


function spanOutSub2(theSpan){
 theSpan.className='outSpanSub2';
}


function spanInSub2(theSpan, theClass){
 theSpan.className='overSpanSub2';
 if (activeMenu)
 { 
  eval("item" + activeMenu + ".className='overSpan1'");
 }
}

