	// ************** VARIABLES ************************************************
	var portrait = 0;
	var nebel  = 1;
	
	//Ruhe  = new Array();
	//Aktiv = new Array();
	
	//Klick               = new Image();
	//Klick.src           = "http://www.astroservice.com/Bilder/Nova.jpg";
	
	//Ruhe[portrait]     = new Image();
	//Ruhe[portrait].src = "http://www.astroservice.com/Bilder/Thales.jpg";
	//Aktiv[portrait]     = new Image();
	//Aktiv[portrait].src = "http://www.astroservice.com/Bilder/Saturn.jpg";
	
	//Ruhe[nebel]     = new Image();
	//Ruhe[nebel].src = "http://www.astroservice.com/Bilder/DreiSaeulen.jpg";
	//Aktiv[nebel]     = new Image();
	//Aktiv[nebel].src = "http://www.astroservice.com/Bilder/Stupa.jpg";
	
	
	// ************** GO FUNCTION *****************************************
	function Go(x) {
	  if(x == "none") {
	    return;
	  } else {
	    OpenSubwindow(x);
	    //location.href = x;
	  }
	}
	
	
	// ************** ZEIGE FUNCTION *****************************************
	function Zeige(bildname, bildtyp) {
	  if (bildtyp == 0) {
	    window.document.images[bildname].src = Ruhe[eval(bildname)].src;
	  } else if (bildtyp == 1) {
	    window.document.images[bildname].src = Aktiv[eval(bildname)].src;
	  } else if (bildtyp == 2) {
	    window.document.images[bildname].src = Klick.src;
	  }
	}
	
	
	// ************** OpenWin FUNCTION *****************************************
	var Subwindow = null
	
	function OpenSubwindow(url) {
	  if(!Subwindow || Subwindow.closed) {
	    Subwindow=window.open(url, "places", "width=600,height=500,status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
	  } else {
	    Subwindow.focus("places");
	  }
	}
	
	
	// ************** INIT FUNCTION *****************************************
	function setTitles() {
	  // Nur MS IE; Netscape schaffts einfach nicht!
	
	  if(document.all) {
	
	    // Beide Titel setzen
	    //document.all.divTitel.innerHTML = document.anchors[0].innerText
	
	    //document-Titel nur, wenn nicht Hauptseite
	    if (document.URL.length > 29) {
	      document.title = document.title + ": " + document.anchors[0].innerText
	    }
	    
	    //window.setTimeout('document.all.divTitel.innerHTML = document.anchors[0].innerText', 1000);
	    //window.setTimeout('document.title = document.anchors[0].innerText', 1000);
	
	    // Aktuellen Link herausnehmen
	    // Dazu alle Links mit aktuellem HREF vergleichen:
	    // Wenn letztes Zeichen "/" war, muss man vorletztes Wort nehmen, sonst letztes
	    words = document.URL.split("/");
	    if (words[words.length - 1].length == 0) {
	      fileURL = words[words.length - 2];
	    } else {
	      fileURL = words[words.length - 1];
	    }
	    
	    // durch alle Links im Dokument laufen:
	    for(i=0; i < document.links.length; i++) {
	      words = document.links[i].href.split("/");
	      // wenn letztes Zeichen "/" war, muss man vorletztes Wort nehmen, sonst letztes
	      if (words[words.length - 1].length == 0) {
	        fileLink = words[words.length - 2];
	      } else {
	        fileLink = words[words.length - 1];
	      }
	
	 	// ist es der aktuelle Link, aber nicht einer von den unsichtbaren oder Bildern?
	      // den ganzen Linkausdruck holen
	      linkHTML = document.links[i].outerHTML;
	      if(fileLink.match(eval("/" + fileURL + "/"))
	        && !(linkHTML.match(eval("/unsichtbar/")))
	        && !(linkHTML.match(eval("/Zeige/"))))
	      {
	        // Linkverhalten l?schen und aktuellen Links ROT MARKIEREN,
	        // indem man andere "Umgebung" definiert:
	        document.links[i].outerHTML = document.links[i].innerText.fontcolor("#000000");
	        //document.links[i].outerHTML = "<font size=1>" + document.links[i].innerText.bold() + "</font>";
	        // set i one back, because the links are one less!!!
	        i--;
	      }
	    }
	
	  } else if(document.layers){
	    //document.divTitel.document.open();
	    //document.divTitel.document.write("ddddddddddddddd");
	    //document.divTitel.document.close();
	  }
	
	  // Netscape st?rzt ab, wenn style in input! Probleme auch bei justify
	  //if (navigator.appName != "Netscape") { 
	    //document.mantra.stopp.style.backgroundColor = "#E0F0FF";
	    //document.all.pHaupt.style.textAlign = "justify";
	    //document.all.mainTable.position = "absolute";
	    //document.all.mainTable.top = "10";
	    //document.all.pHaupt.innerText="kjhjh";
	  //}
	}


// ************** SetSummertime FUNCTION *****************************************
// modifiziert im Vgl. zu früher, weil Sommerzeit keine Radiobuttons, sondern hidden text!
// Danach Zeitzone aufrufen!

function SetSummertime() {
  var tag        = document.thales.tag.value,
      monat      = document.thales.monat.value,
      jahr       = document.thales.jahr.value;
      kontinent  = document.thales.continent.value;

  //Zuerst sommerzeit auf 0 setzen
  document.thales.sommerzeit.value = 0;

  // Europa: Wie Deutschland
  if (kontinent == "Europe") {
    if (jahr >= 1996) {
      if (monat > 3 && monat < 10 || monat == 3 && tag >= 28 || monat == 10 && tag < 28)
        document.thales.sommerzeit.value = 1;
    } else if (jahr >= 1980 && jahr <= 1995) {
      if (monat > 3 && monat < 9 || monat == 3 && tag >= 28 || monat == 9 && tag < 28)
        document.thales.sommerzeit.value = 1;
    } else if (jahr >= 1946 && jahr <= 1949) {
      if (monat > 4 && monat < 10 || monat == 4 && tag >= 12 || monat == 10 && tag < 10)
        document.thales.sommerzeit.value = 1;
    } else if (jahr >= 1943 && jahr <= 1945) {
      if (monat >= 4 && monat <= 9)
        document.thales.sommerzeit.value = 1;
    } else if (jahr >= 1940 && jahr <= 1942) {
      if (jahr == 1941 || jahr == 1940 && monat >= 4 || jahr == 1942 && monat <= 10)
        document.thales.sommerzeit.value = 1;
    } else if (jahr >= 1916 && jahr <= 1918) {
      if (monat > 4 && monat < 9 || monat == 4 && tag >= 20 || monat == 9 && tag < 21)
        document.thales.sommerzeit.value = 1;
    }
  }
  // USA
  else if (kontinent == "USA") {
    if (jahr >= 1987) {
      if (monat > 4 && monat < 10 || monat == 4 && tag >= 4 || monat == 10 && tag < 28)
        document.thales.sommerzeit.value = 1;
    } else if (jahr >= 1976 && jahr <= 1986) {
      if (monat > 4 && monat < 10 || monat == 4 && tag >= 28 || monat == 10 && tag < 28)
        document.thales.sommerzeit.value = 1;
    } else if (jahr >= 1974 && jahr <= 1975) {
      if (jahr == 1974 || monat < 5)
        document.thales.sommerzeit.value = 1;
    } else if (jahr >= 1946 && jahr <= 1973) {
      if (monat > 4 && monat < 10 || monat == 4 && tag >= 28 || monat == 10 && tag < 28)
        document.thales.sommerzeit.value = 1;
    } else if (jahr >= 1942 && jahr <= 1945) {
      if (monat > 1 && monat < 10)
        document.thales.sommerzeit.value = 1;
    } else if (jahr >= 1918 && jahr <= 1919) {
      if (monat > 3 && monat < 10 || monat == 3 && tag >= 28 || monat == 10 && tag < 28)
        document.thales.sommerzeit.value = 1;
    }
  }
  // Rest der Welt: Wie Europa, aber erst ab 1986
  else {
    if (jahr >= 1996) {
      if (monat > 3 && monat < 10 || monat == 3 && tag >= 28 || monat == 10 && tag < 28)
        document.thales.sommerzeit.value = 1;
    } else if (jahr >= 1986 && jahr <= 1995) {
      if (monat > 3 && monat < 9 || monat == 3 && tag >= 28 || monat == 9 && tag < 28)
        document.thales.sommerzeit.value = 1;
    }
  }

  // Nun noch Zeitzone aufrufen, weil Sommerzeit mit eingearbeitet wird!
  Zeitzone();
}


// Andere Zeitzone eingegeben:
function Zeitzone() {
  document.thales.zeitdifferenz.value =
    - document.thales.zeitzone.value - document.thales.sommerzeit.value;
}


function istLeer(string) {
  return (string.length == 0 || string == "null");
}

function istKeineZahl(string) {
  var i, ret;
  ret = istLeer(string);
  if (ret) return ret;
  for (i=0; i<string.length; i++) {
    ret = (string.charAt(i) == "1");
    if (i==0) ret = (ret || string.charAt(i) == "-");
    ret = (ret || string.charAt(i) == "2");
    ret = (ret || string.charAt(i) == "3");
    ret = (ret || string.charAt(i) == "4");
    ret = (ret || string.charAt(i) == "5");
    ret = (ret || string.charAt(i) == "6");
    ret = (ret || string.charAt(i) == "7");
    ret = (ret || string.charAt(i) == "8");
    ret = (ret || string.charAt(i) == "9");
    ret = (ret || string.charAt(i) == "0");
    ret = (ret || string.charAt(i) == ".");
    if (!ret) return !ret;
  }
  // Zwei Punkte drin?
  if (string.indexOf(".") != string.lastIndexOf(".")) return 1;
  return !ret;
}


function changeContinent() {
  if (document.getElementById) {
    document.getElementById('Europe').style.display = 'none';
    document.getElementById('Africa').style.display = 'none';
    document.getElementById('America').style.display = 'none';
    document.getElementById('Asia').style.display = 'none';
    document.getElementById('USA').style.display = 'none';
    document.getElementById('Australia').style.display = 'none';
    document.getElementById('Russia').style.display = 'none';
    document.getElementById(document.thales.continent.value).style.display = 'inline';
  }
  // Nun auch Zeitzone vom neuen Defaultland übernehmen!
  CheckCountry();
}


function CheckCountry() {
  // Alles OK: Zeitzone übernehmen
  land = document.getElementById(document.thales.continent.value);
  var selected = land.selectedIndex;
  var country_code = land[selected].value;
  zone = country_code.substring(2, country_code.length);
  document.thales.zeitzone.value = zone * 1; // Mit "*" in Zahl umwandeln!!!
  // Und totale Zeitzone auf Hidden Field setzen (wird leider so nicht getriggert!)
  SetSummertime();
  document.thales.ort_neu.value = "";
}


function CheckInput() {
  //var selected = document.thales.ort.options.selectedIndex,
  var zeit     = document.thales.uhrzeit.value,
      name     = document.thales.vorname.value,
         i     = name.indexOf(" ");

  // vorname, nachname, ort_neu und ort: Leerzeichen werden zu "_":
  // while (i != -1 && name.length > 0) {
  //   name = name.substring(0,i) + "_" + name.substring(i+1,name.length);
  //   document.thales.vorname.value = name;
  //   i = name.indexOf(" ");
  // }
  // name = document.thales.nachname.value;
  // i = name.indexOf(" ");
  // while (i != -1 && name.length > 0) {
  //   name = name.substring(0,i) + "_" + name.substring(i+1,name.length);
  //   document.thales.nachname.value = name;
  //   i = name.indexOf(" ");
  // }
  //name = document.thales.ort_neu.value;
  //i = name.indexOf(" ");
  //while (i != -1 && name.length > 0) {
  //  name = name.substring(0,i) + "_" + name.substring(i+1,name.length);
  //  document.thales.ort_neu.value = name;
  //  i = name.indexOf(" ");
  //}
  // Nur wenn ort selektiert ist, Leerzeichen durch "_" ersetzen:
  // !!!nicht mehr benutzt!!!
  //if (selected != -1) {
  //  name = document.thales.ort.options[selected].text;
  //  i = name.indexOf(" ");
  //  while (i != -1 && name.length > 0) {
  //    name = name.substring(0,i) + "_" + name.substring(i+1,name.length);
  //    document.thales.ort.options[selected].text = name;
  //    i = name.indexOf(" ");
  //  }
  //} else { // Ort selektieren, damit QUERY_STRING vollstaendig ist:
    if (document.thales.ort_neu.value == "" &&
	(document.thales.alt[0] == null ||
	 document.thales.alt[0].checked != true)) {
      alert("Geben Sie bitte mindestens den ersten Buchstaben\n\ndes gewünschten Orts ein!");
      return false;
    } else {
      //document.thales.ort.options.selectedIndex = 0;
      //document.thales.ort_neu.focus();
    }
  //}
  // Vorname ok?
  if (istLeer(document.thales.vorname.value)) {
    alert("Geben Sie bitte einen Vornamen ein!");
    return false;
  }
  // Name ok?
  if (istLeer(document.thales.nachname.value)) {
    alert("Geben Sie bitte einen Nachnamen ein!");
    return false;
  }
  // Tag ok?
  if (istKeineZahl(document.thales.tag.value)) {
    alert("Geben Sie den Tag bitte als Zahl ein!");
    return false;
  }
  // Monat ok?
  if (istKeineZahl(document.thales.monat.value)) {
    alert("Geben Sie den Monat bitte als Zahl ein!");
    return false;
  }
  // Jahreszahl ok?
  if (istKeineZahl(document.thales.jahr.value)
      || document.thales.jahr.value<1000) {
    alert("Geben Sie die Jahrezahl bitte im Format\n xxxx ein!"
      + " Jahre vor 1000 sind nicht zulässig.");
    return false;
  }
  // Zeit im Format x:xx wird zu x.xx:
  i = zeit.indexOf(":");
  if (i != -1 && zeit.length > 0) {
    zeit = zeit.substring(0,i) + "." + zeit.substring(i+1,zeit.length)
    document.thales.uhrzeit.value = zeit;
  }
  // Zeit eine Zahl?
  if (istKeineZahl(document.thales.uhrzeit.value)) {
    alert("Geben Sie die Uhrzeit bitte im Format\n x.xx oder x:xx ein!");
    return false;
  }
  // Zeit zwischen 0 und 24?
  if (document.thales.uhrzeit.value<0 || document.thales.uhrzeit.value>=24) {
    alert("Die Uhrzeit muss zwischen 0 und 24 liegen!");
    return false;
  }
  typ = document.thales.typ.value;
  
  // ********* BESTIMMTE FELDER NUR FüR BESTIMMTE HOROSKOPTYPEN ***************************************
  // Falls Geschlecht nötig: ok?
  if (document.thales.geschlecht) {
    if (document.thales.geschlecht.value == null) {
      if (document.thales.geschlecht[0].checked != true && document.thales.geschlecht[1].checked != true) {
        alert("Geben Sie bitte das Geschlecht an!");
        return false;
      }
    }
  }
  // Falls Versionsangabe nötig: ok?
  if (document.thales.www) {
    if (document.thales.www.value == null) {
      if (document.thales.www[0].checked != true && document.thales.www[1].checked != true) {
        alert("Geben Sie bitte die Version an!");
        return false;
      }
    }
  }
  // Falls Startdatum nötig: ok?
  if (document.thales.starttag) {
    // Tag ok?
    if (istKeineZahl(document.thales.starttag.value)) {
      alert("Geben Sie den Tag bitte als Zahl ein!");
      return false;
    }
    // Monat ok?
    if (istKeineZahl(document.thales.startmonat.value)) {
      alert("Geben Sie den Monat bitte als Zahl ein!");
      return false;
    }
    // Jahreszahl ok?
    if (istKeineZahl(document.thales.startjahr.value)
        || document.thales.startjahr.value<1000) {
      alert("Geben Sie die Jahrezahl bitte im Format\n xxxx ein!"
        + " Jahre vor 1000 sind nicht zulässig.");
      return false;
    }
  }
  // *************************************************************************

  // Eingabe OK: Fenster öffnen und Horoskop oder Orte darin ausgeben,
  // wenn User Daten bestätigt:
//  text = "Sind die folgenden Daten korrekt?\n\nName:\t\t"
//    + document.thales.vorname.value + " " + document.thales.nachname.value;
//
//  if (typ == "indisch" || typ == "voll" || typ == "basis" || typ == "liebeswoche") {
//    text += "\nGeschlecht:\t" + (document.thales.geschlecht[0].checked ? "m" : "w");
//  }
//  
//  text += "\nGeboren am:\t"
//    + document.thales.tag.value     + "." + document.thales.monat.value + "."
//    + document.thales.jahr.value + " um " + document.thales.uhrzeit.value + " Uhr";
//    
//  if (typ == "woche" || typ == "liebeswoche") {
//    text += "\nWochenhor. ab:\t"
//      + document.thales.starttag.value + "." + document.thales.startmonat.value + "."
//      + document.thales.startjahr.value;
//  }
//
//  text += "\n*Ort:\t\t" + document.thales.ort_neu.value;
//
//  if (typ == "indisch") {
//    text += "\nTodesinfos:\t" + (document.thales.www[1].checked ? "mit" : "ohne");
//  }
//
//  if (typ == "voll") {
//    text += "\nHäusertexte:\t" + (document.thales.www[0].checked ? "mit" : "ohne");
//  }
//
//  if (typ == "basis") {
//    if (document.thales.tendenz[0].checked)
//      text += "\nVersion:\t\t" + "Normal";
//    else if (document.thales.tendenz[1].checked)
//      text += "\nVersion:\t\t" + "Light";
//    else
//      text += "\nVersion:\t\t" + "Nasty";
//  }
//
//  text += "\n\n*Hinweis: \tGeben Sie nur die Anfangsbuchstaben des Ortes ein,";
//  text += "\n\tum eine Auswahl von Orten zu erhalten.";
//
//  ok = confirm(text);
//  if(ok == true) {
    //Fenster2=window.open('about:blank' , 'Fenster2',
    //  'scrollbars=yes,status=yes,resizable=yes,menubar=yes,toolbar=yes');
    document.thales.submit();
    //Fenster2.focus();
//  }
}