
function getWindowWidth(win)
{
    if (win == undefined)
        win = window;
    if (win.innerWidth) {
        return win.innerWidth;
    } else {
        if (win.document.documentElement 
                && win.document.documentElement.clientWidth) 
        {
            return win.document.documentElement.clientWidth;
        }
        return win.document.body.offsetWidth;
    }
}

function getWindowHeight(win)
{
    if (win == undefined)
        win = window;
    if (win.innerHeight) {
        return win.innerHeight;
    } else {
        if (win.document.documentElement 
                && win.document.documentElement.clientHeight) 
        {
            return win.document.documentElement.clientHeight;
        }
        return win.document.body.offsetHeight;
    }
}




function check_hoehe() {
   var Mwidth = getWindowWidth();
   var Mheight = getWindowHeight();
   var minHoehe=560;
   
   hoehenav=document.getElementById('navigation').offsetHeight+20;
   hoehecontent=document.getElementById('content').offsetHeight+20;
   hoeheevent=document.getElementById('event').offsetHeight+20;
   
    if (hoehenav > minHoehe) { minHoehe=hoehenav;}
    if (hoehecontent > minHoehe) { minHoehe=hoehecontent;}
    if (hoeheevent > minHoehe) { minHoehe=hoeheevent;}
    Seitenhoehe=minHoehe+175;
   
   
   if (document.all) {
      document.all.navigation.style.height = minHoehe;
      document.all.content.style.height = minHoehe;
      document.all.event.style.height = minHoehe;
      document.all.inhalt.style.height = Seitenhoehe;
   }
   else if (document.layers) {
      window.document.navigation.height = minHoehe;
      window.document.content.height = minHoehe;
      window.document.event.height = minHoehe;
      window.document.inhalt.height = Seitenhoehe;
   }
   else if (document.getElementById) {
      document.getElementById('navigation').style.height = minHoehe + 'px';
      document.getElementById('content').style.height = minHoehe + 'px';
      document.getElementById('event').style.height = minHoehe + 'px';
      document.getElementById('inhalt').style.height = Seitenhoehe + 'px';
   }
}

function check_content(posobenfuss) {
   var hoehecontent=document.getElementById('content').style.top;
   //String in Zahl umwandeln
   hoehecontent=parseInt(hoehecontent);
   var setzecontent=posobenfuss-hoehecontent;

   if (document.all) {
      document.all.content.style.height = setzecontent;
      //document.all.content.style.visibility = "visible";
   }
   else if (document.layers) {
      window.document.content.height = setzecontent;
//     (( window.document.content.style.visibility = "visible";
   }
   else if (document.getElementById) {
      document.getElementById('content').style.height = setzecontent + 'px';
//      //document.getElementById('content').style.visibility = "visible";
   }	
}


function delay(prmSec)
{ prmSec *= 1000;  var eDate = null; var eMsec = 0;  var sDate = new Date(); var sMsec = sDate.getTime();  do { eDate = new Date(); eMsec = eDate.getTime();  } while ((eMsec-sMsec)<prmSec);} 


//ajax funktion für die Reiter
var SuchFenster='irgendwas';

function sendRequest(Aktion,Fenster,Variable) {
   try {
      req = window.XMLHttpRequest?new XMLHttpRequest():
      new ActiveXObject("Microsoft.XMLHTTP");
   }
   catch (e) {
    //Kein AJAX Support
   }
   req.onreadystatechange = handleResponse;
 
   //Jetzt kommen die einzelnen Aktionen
 
   if(Aktion=='Suche'){
      SuchFenster=Fenster;
      req.open('get', 'output/ajaxsuche.php?suchwort='+Variable);
   }
   req.send(null);
}
 
function handleResponse() {
        if ((req.readyState == 4) && (req.status == 200)) {
           if(Aktion=="Suche"){
        		   document.getElementById(SuchFenster).innerHTML = req.responseText;
        	  }

        }
}
 
//Die nächsten Funktionen sind die Hauptfunktionen, die im HTML-Text aufgerufen werden
//Variable in Klammern: Aktion,Fenster,Variable,Variable2
//Fenster bedeutet Div-Container, also id
 

function Suche(Suchstring) {
 Fenster='sucherg';
 Aktion='Suche';
 //suche sichtbar machen
 document.getElementById('suchergebnisse').style.visibility='visible';
 sendRequest(Aktion,'sucherg',Suchstring);
}


function check_seitenhoehe() {
   var Mwidth = getWindowWidth();
   var Mheight = getWindowHeight();
   var Unterkante=Mheight-parseInt(document.getElementById('fussleiste').style.height)-5;
   var Oberkante=parseInt(document.getElementById('content').style.top);
   NeueHoehe=Unterkante-Oberkante;
   if (document.all) {
      document.all.fussleiste.style.top = Unterkante;
      document.all.fussleiste.style.visibility = 'visible';
      document.all.content.style.height = NeueHoehe;
   }
   else if (document.layers) {
      window.document.fussleiste.top = Unterkante;
      window.document.fussleiste.style.visibility = 'visible';
      document.all.content.style.height = NeueHoehe;
   }
   else if (document.getElementById) {
      document.getElementById('fussleiste').style.top = Unterkante + 'px';
      document.getElementById('fussleiste').style.visibility = 'visible';
      document.getElementById('content').style.height = NeueHoehe + 'px';
   }   
}
