

function ImgHi(index, image) {
  if (_images[image]) index.src = _images[image][1];
}

function ImgLo(index, image) {
  if (_images[image]) index.src = _images[image][0];
}



function GetDiv(divId) {
 var div = null;
 if (document.getElementById)
   div = parent.inhalt.document.getElementById(divId);
 else if (document.all)
   div = parent.inhalt.document.all[divId];
 else if (document.layers)
   div = parent.inhalt.document.layers[divId];
 return div;
}


function HideActiveMenu() {
 if (_activeMenu) {
  var div = GetDiv(_activeMenu);
  if (div==null) return;
  if ( !_isMenuActive ) {
    if (_timer) { clearTimeout(_timer);}
    _timer = setTimeout("HideDiv('" + _activeMenu + "')", 750);
  }
 }
}

function ShowMenu(divId, pos) {
 HideAllDiv();
 var div = GetDiv(divId);
 var scrollpos=0;
 var scrollcol=0;
 var col = _x;
 if (!document.all && !document.layers) pos += _pos_offset_mozilla;
 if (div==null) {
   parent.inhalt.location.href=_defaultinhalt;
   return;
 }
 if (document.all || document.getElementById) {
   scrollpos=parent.inhalt.document.body.scrollTop;
   scrollcol=parent.inhalt.document.body.scrollLeft;
 } else if (document.layers) {
   scrollpos=parent.inhalt.window.pageYOffset;
   scrollcol=parent.inhalt.window.pageXOffset;
 }

 if (document.all && div.offsetHeight < document.body.clientHeight && (pos + div.offsetHeight > document.body.clientHeight-20)) {
   pos = document.body.clientHeight - div.offsetHeight - 20;
 }
 pos += scrollpos;
 col += scrollcol;

 if (document.getElementById) {
   div.style.left = col;
   div.style.top = pos;
   div.style.visibility = "visible";
   _isMenuActive=true;
 } else {
   if (document.layers) {
     div.moveTo(col,pos);
     div.visibility = "show";
     _isMenuActive=true;
   }
 }
 _activeMenu = div.id;
}

function HideAllDiv() {
 var divs=null;
 if (document.getElementsByTagName)
   divs = parent.inhalt.document.getElementsByTagName("DIV");
 else if (document.all)
   divs = parent.inhalt.document.all;
 else if (document.layers)
   divs = parent.inhalt.document.layers;
 if (divs==null) return;

 for (var i = 0; i < divs.length; i++) {
  if (divs[i].id.indexOf("SubMenu") > -1 ) {
    HideDiv(divs[i].id);
  }
 }
}

function HideDiv(divId) {
 var div = GetDiv(divId);
 if (_isMenuActive == false) {
   if (document.getElementById || document.all) {
     div.style.visibility = "hidden";
   }
   else if (document.layers) {
     div.visibility = "hide";
   }
 }
}


function InitMenu(relImgPath) {
  document.write('<LINK href="../aek_ext/css/navigation.css" type="text/css" rel="stylesheet">')
  if (relImgPath != null) {
    _images[0][0] = _images[0][0].replace(_imgPathPlaceholder, relImgPath);
    _images[0][1] = _images[0][1].replace(_imgPathPlaceholder, relImgPath);
    document.write(_mainmenu_.split(_imgPathPlaceholder).join(relImgPath));
  }
  else {
    document.write(_mainmenu_);
  }
}

