function formHilite(ID,event)
 {
  if(document.getElementById)
   {
    if(event=="focus"){document.getElementById(ID).style.backgroundImage = "url(img/shadow.gif)"}
    else{document.getElementById(ID).style.backgroundImage = "none"}
   }
 }
 
//funktion popup
function pop(win,breite,hoehe)
   {
   var links=screen.width/2-breite/2;
   var oben=screen.height/2-hoehe/2;
   popup = window.open(win, 'popup',"location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,width="+breite+",height="+hoehe+",left="+links+",top="+oben)
   popup.focus();
   }

function pop1(win,breite,hoehe)
   {
   var links=screen.width/2-breite/2;
   var oben=screen.height/2-hoehe/2;
   popup1 = window.open(win, 'popup1',"location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no,width="+breite+",height="+hoehe+",left="+links+",top="+oben)
   popup1.focus();
   }

//Hintergrundfarbe ändern
function chcolor(id,color)
  {
  document.getElementById(id).style.background=color;
  document.getElementById(id).style.cursor='hand';
  }

//weiterleitung
function weiterleitung(site)
   {
   self.location.href="?site="+site;
   }
   
//showhide elements by id
function show(win,showhide)
  {
  if(showhide == "show"){document.getElementById(win).style.visibility="visible";}
  else if(showhide == "hide"){document.getElementById(win).style.visibility="hidden";}
  }
  
//visible cssbox
function showbox(id)
   {
   if(document.getElementById(id).style.display!="block")
      {document.getElementById(id).style.display="block";}
   else
      {document.getElementById(id).style.display="none";}
   }

//hand
function hand(id)
   {
   document.getElementById(id).style.cursor='pointer';
   }

//Bild ändern
function CHimg(id,img,path)
   {
   var image=path+img;

   if(document.getElementById(id).name==image+'_1.jpg')
      {
      document.getElementById(id).name=image+'_2.jpg';
      document.getElementById(id).src=path+img+'_2.jpg';
      }
   else if(document.getElementById(id).name==image+'_2.jpg')
      {
      document.getElementById(id).src=path+img+'_1.jpg';
      document.getElementById(id).name=image+'_1.jpg';
      }
   }

//Bild ändern
function CHbg(id,img)
   {
   document.getElementById(id).background=img;
   hand(id);
   }
//Navigationsfarben
function ChNav(site,activecolor)
   {
   if (document.getElementById(site)!==null)
      {document.getElementById(site).style.color=activecolor;return true;}
   else
      {return false;}
   }
function pop_pics(pic)
   {
   sbowin=window.open('./img/'+pic,'sbowin','fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0,width=600,height=480,left=100,top=100');
   sbowin.focus();
   }
//Textarea dynamisch vergrößern
function textarea_dynamisch(feld_element)
   {
   document.getElementById(feld_element).rows = (Math.round((document.body.offsetHeight/18)-6));
   document.getElementById(feld_element).cols = (Math.round(document.body.offsetWidth/8.8));
   }


/* getAXAH('http://www.url.com', 'DivElementWosHineinsoll') */
function getAXAH(url,elementContainer){

 /* Optionen festlegen */
 var showPlatzhalterWhileLoading = false;
 var execJavaScriptAfterTransfer = true;
 var changeStatusbar = false;

 /* Statuszeile anpassen. */
 if (changeStatusbar == true) { window.status = 'Ajax:' + url; }

 /* Anzeigen eines Blindtextes während des Ladevorganges, aber nur wenn noch kein Inhalt im Element vorhanden ist... */
 /* Diese Zeilen können bei bedarf entfernt werden */
 if (showPlatzhalterWhileLoading == true) {
  if (document.getElementById(elementContainer).innerHTML == '') {
   document.getElementById(elementContainer).innerHTML = "Lade von " + url + " ...";
  }
 }

 var theHttpRequest = getNewHttpObject();
 theHttpRequest.onreadystatechange = function() {processAXAH(elementContainer);};

 /* Überprüfen ob eine Zufallszahl hinzugefügt werden soll, um den Inhalt nicht zu cachen. */
 /* Das hinzufügen der Zufallszahl ist deswegen notwendig, da die Inhalte sonst im Browser gecached werden, und nicht neu geladen werden. */

 /* Überprüfen ob bereits Parameter bei der Abfrage verwendet werden oder nicht */
 if (url.indexOf('?') == -1) {
  /* Wenn keine Parameter vorhanden sind wird ein komplett neuer Parameter-Satz deklariert */
  url = url + '?RANDOM' + Math.floor(Math.random()*1024*1024) + "=" + Math.floor(Math.random()*1024*1024) + Math.floor(Math.random()*1024*1024);
 } else {
  /* Wenn bereits Parameter angegeben wurden, wird hinten noch ein weiterer angehängt */
  url = url + '&RANDOM' + Math.floor(Math.random()*1024*1024) + "=" + Math.floor(Math.random()*1024*1024) + Math.floor(Math.random()*1024*1024);
 }

 theHttpRequest.open("GET", url);
 theHttpRequest.send(false);

 function processAXAH(elementContainer){
  if (theHttpRequest.readyState == 4)
  {
   if (theHttpRequest.status == 200) {
    document.getElementById(elementContainer).innerHTML = theHttpRequest.responseText;
    /* Javascript ausführen wenn eines mitgesendet wurde */
    if (execJavaScriptAfterTransfer == true) { execJS(document.getElementById(elementContainer)); }
   }
   else
   { document.getElementById(elementContainer).innerHTML="Error! Fehler: " + theHttpRequest.statusText; }
  } /* End If */
 } /* End Function */
 if (changeStatusbar == true) { window.status = ''; }
}

function getNewHttpObject() { var objType = false; try { objType = new ActiveXObject('Msxml2.XMLHTTP');}
 catch(e) {try { objType = new ActiveXObject('Microsoft.XMLHTTP'); } catch(e) { objType = new XMLHttpRequest(); }}
 return objType; }

function execJS(node) {
 /* Element auf Javascript überprüfen, und falls nötig ausführen */
 var bSaf = (navigator.userAgent.indexOf('Safari') != -1);
 var bOpera = (navigator.userAgent.indexOf('Opera') != -1);
 var bMoz = (navigator.appName == 'Netscape');
 var st = node.getElementsByTagName('script'); var strExec;

 for(var i=0;i<st.length; i++) { if (bSaf) { strExec = st[i].innerHTML; } else if (bOpera) { strExec = st[i].text; }
   else if (bMoz) { strExec = st[i].textContent; } else { strExec = st[i].text; } try { eval(strExec); } catch(e) { alert(e);}}}
