
function init() {
    M=false;
    N=false;
    if (navigator.appName.slice(0,1)=='N') N=true; else M=true;
    cm=null;
    document.onmouseover=menuControl;
}

function getPos(el,sProp) {
    var iPos=0;
    while (el!=null) {
      iPos+=el["offset"+sProp];
      el = el.offsetParent;
    }
    return iPos;
}

// hacked for use with image buttons
function show(el,m) {
    with (m.style) {
        display='';
        left=getPos(el,"Left") + 3;
        top=getPos(el,"Top")+el.offsetHeight - 10;
    }
    if ((m!=cm) && (cm!=null)) cm.style.display='none';
    cm=m;
}

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);
    if (es1=='d') show(es,document.getElementById('sd'+esi.substring(1,2)));
    if (es1=='B') hide();
}
