var d = document;
var menuVersion = 2;
if ( d.all ) menuVersion = 1;
else if ( d.layers ) menuVersion = 0;


function GEByID(id) {
  if ( menuVersion == 0 ) return null;
  if ( menuVersion == 1 ) return d.all[id];
  if ( menuVersion == 2 ) return d.getElementById(id);
}


function hmDivOn(id) {
  id.style.visibility = 'visible';
}

function hmDivOff(id) {
  id.style.visibility = 'hidden';
}

function relPosXX(elem) { 
  var pos=elem.offsetLeft;
  while ( elem.offsetParent != null ) { 
    elem=elem.offsetParent;
    pos+=elem.offsetLeft;
    if ( elem.tagName == 'BODY' ) break;
  } 
  return pos;
}

function relPosYY(elem) { 
  var pos=elem.offsetTop;
  while ( elem.offsetParent != null ) { 
    elem=elem.offsetParent;
    pos+=elem.offsetTop;
    if ( elem.tagName == 'BODY' ) break;
  } 
  return pos;
}

function hmOn(id,parent) {
  elem = GEByID(id);
  elem.style.left = relPosXX(parent);
  elem.style.top = relPosYY(parent)+hmVertShift;
  elem.style.visibility = 'visible';
  parent.className='menu2';
}

function hmOff(id,parent) {
  elem = GEByID(id);
  elem.style.visibility = 'hidden';
  parent.className='menu1';
}

function hmiOn(id, styleParam) {
  if (styleParam == 1) id.className = hmStyle2Sel; else id.className = hmStyleSel;
}

function hmiOff(id, styleParam) {
  if (styleParam == 1) id.className = hmStyle2; else id.className = hmStyle;
}

function hmGo(h) {
  location.href = h;
}


