function init() {
  M=false;
  N=false;
  if (navigator.appName.slice(0,1)=='N') N=true; else M=true;
  cm=null;
  wipeOn=null;
  wipeTime=null;
  if (N) document.captureEvents(Event.MOUSEOVER);
  document.onmouseover=menuControl;
}

function getPos(el,sProp) {
  var iPos=0;
  while (el!=null) {
    if (el.tagName!='A') iPos+=el["offset"+sProp];
    el=el.offsetParent;
    if (M) if (el.id=="B") el=null;
  }
  return iPos;
}

function show(el,m) {
  if (way=='H') { 
    var lt = 0;
    var tp = boxHeight;
  } else {
    var lt = el.offsetWidth;
    var tp = 0;
  }
  with (m.style) {
    clip='rect(0,0,0,0)';
    display='';
    left=getPos(el,"Left")+lt;
    top=getPos(el,"Top")+tp;
  }

  if ((m!=cm) && (cm!=null)) cm.style.display='none';
  cm=m;
  wipePos=0;
  wipeHeight=getPos(cm,"Height");
  wipeWidth=getPos(cm,"Width");
  wipeOn=true;
  wipe();
}

function wipe() {
  if (wipeOn) {
    wipePos+=4;
    if (wipePos>wipeHeight+4) {
      wipeOn=false;
      return;
    }
  } else {
    return;
  }
  if (cm) cm.style.clip='rect(0,'+wipeWidth+','+wipePos+',0)';
  wipeTime=setTimeout('wipe()',1);
}

function hide() {
  if (cm!=null) cm.style.display='none';
  cm=null;
}

function menuControl(e) {
  if (N) es=e.target;
  if (M) es=event.srcElement;
  esi=es.id;
  if (esi==void 0) {
    es=es.parentNode;
    esi=es.id;
  }
  es1=esi.substring(0,1);
  es2=esi.substring(1,2);
  cmid=cm?cm.id.substring(2,3):'';
  if (es1=='d' && es2!=cmid) show(es,document.getElementById('sd'+es2));
  if (es1=='B') {
    wipeOn=false;
    clearTimeout(wipeTime);
    hide();
  }
}
