if (is.nav4) document.write("<style type='text/css'>.menuLabel { position:absolute; visibility:hidden; overflow:hidden; font-family: verdana,arial,sans-serif; font-size: 12px; font-weight:normal; color:#00ccff; background: #00ccff; layer-background-color: #00ccff; width:75px; margin:0; padding:2px;}</style>");
else document.write("<style type='text/css'>.menuLabel { position:absolute; visibility:hidden; overflow:hidden; font-family: verdana,arial,sans-serif; font-size: 12px; font-weight:normal; color:#00ccff; background: #00ccff; layer-background-color: #00ccff; width:75px; margin:0; padding:2px; border:2px outset;}</style>");

var menuCount=5, menuArray, activeMenu=1, menuOpen=false, activeColor='#999999', inactiveColor='#00ccff', labelExtension=10;
function windowOnload()
{
  var i, menuLabel, menuX=4, menuY=47;
  menuArray = new Array();
  for (i = 1; i <= menuCount; ++i) {
    menuLabel = document.getElementById('menuLabel'+i).cbe;
    menuLabel.resizeTo(95,20);
    menuLabel.moveTo(menuX, menuY);
    menuLabel.show();
    menuArray[i] = document.getElementById('menu'+i).cbe;
    menuArray[i].moveTo(menuLabel.left() + menuLabel.width() + labelExtension, menuLabel.top());
    menuArray[i].menuLabel = menuLabel;
    menuArray[i].zIndex(3);
    menuY += menuLabel.height() + 6;
  }
  document.cbe.addEventListener("mousemove", menuHide);
  
  mnuMarker = cbeGetElementById('mnuMarker').cbe;
  cbeMenu = new cbeDropdownMenu(
    mnuMarker.pageX(), mnuMarker.pageY(), // coord of first label
    101, 20,                               // label width and height
    202,                                  // box width
    18,                                   // item height
    2,                                    // item left padding
    '#00ccff',                            // background color
    '#ffffff',                            // text color
    '#999999',                            // hover background color
    '#ffffff'                             // hover text color
    
  );
  window.cbe.addEventListener('resize', winResizeListener, false);
  
}

function menuShow(e,mn)
{
  if (mn == activeMenu && menuOpen) return;
  menuArray[activeMenu].hide()
  for (i = 1; i <= menuCount; ++i) {
    menuArray[i].menuLabel.background(inactiveColor);
  }
  menuArray[mn].menuLabel.resizeBy(labelExtension, 0);
  menuArray[mn].show();
  menuArray[mn].menuLabel.background(activeColor);
  activeMenu = mn;
  menuOpen = true;
}

function menuHide(e)
{
  if (!menuOpen) return;
  var x = e.pageX;
  var y = e.pageY;
  if (!menuArray[activeMenu].contains(x,y,-2,0,0,0) && !menuArray[activeMenu].menuLabel.contains(x,y)) {
    menuArray[activeMenu].hide();
    menuArray[activeMenu].menuLabel.background(inactiveColor);
    menuArray[activeMenu].menuLabel.resizeBy(-labelExtension, 0);
    menuOpen = false;
  }
}

