// JavaScript Document
<!--
  var http_request = false;
  function Init() {
    var c = document.getElementById("main_body");
    switch (document.URL.substr(document.URL.search(/#/)+1,document.URL.length)) {
      case "Home": macheRequest("content_home.php"); break;
      case "Autor": macheRequest("content_autor.php"); break;
      case "Leseproben": macheRequest("content_leseproben.php"); break;
      case "Aktuelles": macheRequest("content_aktuell.php"); break;
      case "Praesentationen": macheRequest("content_praesentation.php"); break;
      case "Presse": macheRequest("content_presse.php"); break;
      case "Links": macheRequest("content_links.php"); break;
      case "Galerie": macheRequest("content_galerie.php"); break;
      case "Galerie_top": macheRequest("content_galerie.php"); break;
      case "Kontakt": macheRequest("content_kontakt.php"); break;
      case "Impressum": macheRequest("content_impressum.php"); break;
      case "FAQ": macheRequest("content_faq.php"); break;
      case "FAQ_top": macheRequest("content_faq.php"); break;
      default: break;
    }
    if (window.innerWidth) {
      Ausrichten();
    } else if (document.body && document.body.offsetWidth) {
      Ausrichten();
    } 
  }
  function Ausrichten () {
    elem = document.getElementById("hoehe");
    Weite = Fensterweite();
    Hoehe = (Fensterhoehe()-300)+'px';
//    alert(Hoehe);
    if (Hoehe > 0) {
      elem.style.height = Hoehe;
      location.href = location.href;
    }
  }
  function Fensterweite () {
    if (window.innerWidth) {
      return window.innerWidth;
    } else if (document.body && document.body.offsetWidth) {
      return document.body.offsetWidth;
    } else {
      return 0;
    }
  }
  function Fensterhoehe () {
    if (window.innerHeight) {
      return window.innerHeight;
    } else if (document.body && document.body.offsetHeight) {
      return document.body.offsetHeight;
    } else {
      return 0;
    }
  }
  function neuAufbau () {
    if (Weite != Fensterweite() || Hoehe != Fensterhoehe())
      location.href = location.href;
      Ausrichten ();
  }
  function Fenster(ordner,bildname) {
    neuesFenster = open("bild.php?ordner="+ordner+"&bild="+bildname, "anzeigeFenster", "height=600, width=800");
    neuesFenster.focus();
  }
  function xmlConnect () {  
    http_request = false;  
    if (window.XMLHttpRequest) {    
      // .....  Normale Uebertragungstypen - Mozilla, Safari,...    
      http_request = new XMLHttpRequest();    
      if (http_request.overrideMimeType) {       
        http_request.overrideMimeType('text/xml');    
      }  
    } else if (window.ActiveXObject) {    
      // .....  IE hat seinen Uebertragungstyp!    
      try {      
        http_request = new ActiveXObject("Msxml2.XMLHTTP");    
      } catch (e) {      
        try {        
          http_request = new ActiveXObject("Microsoft.XMLHTTP");      
        } catch (e) {}    
      }  
    }
  }
  function macheRequest(url) {  
    xmlConnect();  
    if (!http_request) {    
      alert('Ende :( Kann keine XMLHTTP-Instanz erzeugen');    
      return false;  
    } else {    
      http_request.onreadystatechange = alertInhalt;    
      http_request.open('GET', url, true);    
      http_request.send(null);  
    }
  }
  function alertInhalt() {  
    if (http_request.readyState == 4) {    
      if (http_request.status == 200) {      
        document.getElementById('main_body').innerHTML = http_request.responseText;    
      } else {      
        return false;      
        alert('Das aufzurufende html-File existiert nicht!');    
      }  
    }
  }
	function OpenLoginWindow() {
		LoginWindow = window.open("login.html", "Login", "width=308,height=230,left=100,top=200");
		LoginWindow.focus();
	}
	function OpenLoginWindow2() {
		LoginWindow = window.open("admin/login.html", "Login", "width=308,height=230,left=100,top=200");
		LoginWindow.focus();
	}
	function OpenRegisterWindow() {
		RegisterWindow = window.open("register.html", "Registrieren", "width=308,height=273,left=100,top=200");
		RegisterWindow.focus();
	}
	var message="";
  function check_form(){ 
    abort = new Boolean();
    abort = false;
    if(document.formular.name.value == ""){ 
      alert("Bitte füllen Sie das Feld Sender-Name aus"); 
      abort = true; 
    } 
    if(document.formular.email.value == "" || document.formular.email.value.indexOf('@') == -1 || document.formular.email.value.indexOf('.') == -1 ){ 
      alert("Bitte füllen Sie das Feld Sender-Mail aus"); 
      abort = true; 
    } 
    if(document.formular.mitteilung.value == ""){ 
      alert("Bitte füllen Sie das Feld Mitteilung aus"); 
      abort = true; 
    } 
    if(abort == true) { 
      return false; 
    } else {
      return true; 
    }
  } 
//-->