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,param) {
  id.style.visibility = 'visible';  
  elem = GEByID(param);
  elem.className = itemSel;
}

function hmDivOff(id,param) {
  id.style.visibility = 'hidden';
  elem = GEByID(param);
  elem.className = item;
}

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 = itemSel;
}
function horizMOn(id,parent) {
  elem = GEByID(id);
  elem.style.left = relPosXX(parent)+hmHorizShift;
  elem.style.top = relPosYY(parent);
  elem.style.visibility = 'visible';  
  parent.className = itemSel;
}
function horizvMOn(id,parent) {
  elem = GEByID(id);
  elem.style.left = relPosXX(parent)+10;
  elem.style.top = relPosYY(parent)-43;
  elem.style.visibility = 'visible';  
}

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

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;
}

