// DHTML intialisieren
var init = false;
var DHTML = false;
var DOM = false;
var IE = false;
var NC = false;
var OP = false;
function initDHTML()
{
   if (window.opera) {OP = true;}
   if (document.getElementById) {DHTML = true; DOM = true;}
   if (document.all && !OP) {DHTML = true; IE = true;}
   if (window.netscape && window.screen && !DOM && !OP) {DHTML = true; NC = true;}
   var ua = navigator.userAgent.toLowerCase();
   if (IE && ua.indexOf('mac',0) != -1) 
   {
      if (getE('mask')) {getE('mask').style.backgroundColor = 'transparent'; getE('mask').style.backgroundImage = 'url(img/trans.gif)';}
   }
   init = true;
}

// Element (DHTML-abhängig zurückliefern)
function getE(p)
{
   if (DOM) {if (typeof document.getElementById(p) == "object") {return document.getElementById(p);} else {return void(0);}}
   else if (IE) {if (typeof document.all[p] == "object") {return document.all[p];} else {return void(0);}}
   else if (NC) {if (typeof document[p] == "object") {return document[p];} else {return void(0);}}
   else return void(0);
}

// y-Scroll-Position zurückliefern
function getScrollY()
{
   if (self.pageYOffset) {return self.pageYOffset;}
   else if (window.pageYOffset) {return window.pageYOffset;}
   else if (document.documentElement && document.documentElement.scrollTop) {return document.documentElement.scrollTop;}
   else if (document.body && document.body.scrollTop) {return document.body.scrollTop;}
   else {return 0;}
}

// Scrollposition für Reload anhand aktueller Scrollposition berechnen
function setScroll(l,p1,p2)
{
   return l.href+(l.search ? '&' : '?')+'scy='+Math.max(0,(getScrollY()));
}

// geöffnete Aufklappliste in Sichtbereich scrollen
function opnScroll()
{
   var hOpn = getE('opn').offsetHeight + 8;
   var yOpn = getE('opn').offsetTop - 4 + (getE('lpt').offsetTop ? 0 : getE('cont').offsetTop);
   if (self.innerHeight) {hWin = self.innerHeight;}
   else if (document.documentElement && document.documentElement.clientHeight) {hWin = document.documentElement.clientHeight;}
   else if (document.body) {hWin = document.body.clientHeight;}
   var h = yOpn + (hWin > hOpn ? hOpn - hWin : 0);
   window.scrollTo(0,Math.max(0,h));
}

// Hinweis einblenden
function show(id)
{
   if (DOM || IE) {getE(id).style.visibility = 'visible';}
   else if (NC) {getE(id).visibility = 'show';}
}

// Hinweis ausblenden
function hide(id)
{
   if (DOM || IE) {getE(id).style.visibility = 'hidden';}
   else if (NC) {getE(id).visibility = 'hide';}
}
