<!--

  // İ 2007 Bitpalast GmbH. Alle Rechte vorbehalten.

  function invaliddeparturedate(documentform)
  {
	var arrivaldate=(documentform.anreise.value.substr(6,4)*365)+(documentform.anreise.value.substr(3,2)*12)+(documentform.anreise.value.substr(0,2));
	var departuredate=(documentform.abreise.value.substr(6,4)*365)+(documentform.abreise.value.substr(3,2)*12)+(documentform.abreise.value.substr(0,2));
	return(departuredate<=arrivaldate);
  }

  function booking_validator_1(documentform)
  {
	if (documentform.anreise.value=='') {
		alert('Please select the date of your arrival.\nClick on the "select" link to the right of the input line.');
		return (false);
	} else if (documentform.abreise.value=='') {
		alert('Please select the date of your departure.\nClick on the "select" link to the right of the input line.');
		return (false);
	} else if (invaliddeparturedate(documentform)) {
		alert('The departure must be later than the arrival.\nPlease correct your selection.');
		return (false);
	} else {
		return (true);
	}
  }

  function setbooking(documentform)
  {
    if(document.location.search != "") {
      previouslocation=document.location.search;
      bookingdata=previouslocation.substring(1,previouslocation.length);
      documentform.anreise.value=bookingdata.slice(bookingdata.indexOf("anreise=")+8,bookingdata.indexOf("&abreise="));
      documentform.abreise.value=bookingdata.slice(bookingdata.indexOf("&abreise=")+9,bookingdata.indexOf("&erwachsene="));
      documentform.erwachsene.value=bookingdata.slice(bookingdata.indexOf("&erwachsene=")+12,bookingdata.indexOf("&kinder="));
      documentform.kinder.value=bookingdata.slice(bookingdata.indexOf("&kinder=")+8);
    }
    else {
      alert('No booking data found.\n\nYour browser may not be capable for this availability check.\n\nPlease call us: Phone +49 7633 9266-0.');
      window.location="javascript:history(-1);";
    }
  }  

  function setbookingdirect(documentform)
  {
    if(document.location.search != "") {
      previouslocation=document.location.search;
      bookingdata=previouslocation.substring(1,previouslocation.length);
      documentform.zimmertyp.value=bookingdata.slice(bookingdata.indexOf("zimmertyp=")+10);
    }
    else {
      alert('No booking data found.\n\nYour browser may not be capable for this availability check.\n\nPlease call us: Phone +49 7633 9266-0.');
      window.location="javascript:history(-1);";
    }
  }  

  function booking_validator_2(documentform)
  {
	if (invaliddeparturedate(documentform)) {
		alert('The departure must be later than the arrival.\nPlease correct your selection.');
		return (false);
	} else {

		if ((documentform.zimmertyp.value.indexOf("---") > -1) || (documentform.zimmertyp.value.indexOf("pick") > -1)) {
	      alert("Please select a room or a package.");
	      documentform.zimmertyp.focus();
	      return (false);
		}

	    if (documentform.name.value == "")
	    {
	      alert("Please enter your last name.");
	      documentform.name.focus();
	      return (false);
	    }

	    if (documentform.vorname.value.length== "")
	    {
	      alert("Please enter your first name.");
	      documentform.vorname.focus();
	      return (false);
	    }

	    if (documentform.anschrift.value == "")
	    {
	      alert("Please enter your address (street + zip code + city).");
	      documentform.anschrift.focus();
	      return (false);
	    }

	    if (documentform.anschrift.value.length < 15)
	    {
	      alert("Your address must be at least 15 characters long.\nPlease enter street + zip code + city.");
	      documentform.anschrift.focus();
	      return (false);
	    }

		if (documentform.anschrift.value.indexOf("@") > -1)
	    {
	      alert("'Address' means your street address (street + zip code + city).\nThe e-mail address can be entered into the 'E-mail addresse' field below.");
	      documentform.anschrift.focus();
	      return (false);
	    }
		
	    if (documentform.telefon.value == "")
	    {
	      alert("Please enter your phone number.");
	      documentform.telefon.focus();
	      return (false);
	    }

	    if (documentform.telefon.value.length < 7)
	    {
	      alert("Your phone number must be at least seven digits long.");
	      documentform.telefon.focus();
	      return (false);
	    }

	    if (documentform.email.value == "")
	    {
	      alert("Please enter your e-mail address.");
	      documentform.email.focus();
	      return (false);
	    }

	    if (documentform.email.value.length < 8)
	    {
	      alert("Your e-mail address must be at least eight characters long.");
	      documentform.email.focus();
	      return (false);
	    }

	    if ((documentform.email.value.indexOf("sdf") > -1) || (documentform.email.value.indexOf("jkl") > -1) || (documentform.email.value.indexOf(".") == -1) || (documentform.email.value.indexOf("@") == -1)) {
	      alert("Your e-mail address is invalid.");
	      documentform.email.focus();
	      return (false);
	    }

	    var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@-_.";
	    var checkStr = documentform.email.value;
	    var allValid = true;
	    var validGroups = true;
	    for (i = 0;  i < checkStr.length;  i++)
	    {
	      ch = checkStr.charAt(i);
	      for (j = 0;  j < checkOK.length;  j++)
	        if (ch == checkOK.charAt(j))
	          break;
	      if (j == checkOK.length)
	      {
	        allValid = false;
	        break;
	      }
	    }
	    if (!allValid)
	    {
	      alert("Please enter letters, digits, and \"@-_.\" characters only into the e-mail address.");
	      documentform.email.focus();
	      return (false);
	    }
		
		if (documentform.transaktion[1].checked) {
			if (documentform.stornobedingungenakzeptiert.checked==false) {
				alert("You must accept the cancellation terms to make a reservation.\n\nIf you want to accept the terms, click the mouse\ninto the checkbox befor the cancellation notice, to check it.");
				return (false);
			}
		}
	}
	return (true);
  }

  function booking_validator_3(documentform)
  {
	if (invaliddeparturedate(documentform)) {
		alert('The departure must be later than the arrival.\nPlease correct your selection.');
		return (false);
	} else {

	    if (documentform.name.value == "")
	    {
	      alert("Please enter your last name.");
	      documentform.name.focus();
	      return (false);
	    }

	    if (documentform.vorname.value.length== "")
	    {
	      alert("Please enter your first name.");
	      documentform.vorname.focus();
	      return (false);
	    }

	    if (documentform.anschrift.value == "")
	    {
	      alert("Please enter your address (street + zip code + city).");
	      documentform.anschrift.focus();
	      return (false);
	    }

	    if (documentform.anschrift.value.length < 15)
	    {
	      alert("Your address must be at least 15 characters long.\nPlease enter street + zip code + city.");
	      documentform.anschrift.focus();
	      return (false);
	    }

		if (documentform.anschrift.value.indexOf("@") > -1)
	    {
	      alert("'Address' means your street address (street + zip code + city).\nThe e-mail address can be entered into the 'E-mail addresse' field below.");
	      documentform.anschrift.focus();
	      return (false);
	    }
		
	    if (documentform.telefon.value == "")
	    {
	      alert("Please enter your phone number.");
	      documentform.telefon.focus();
	      return (false);
	    }

	    if (documentform.telefon.value.length < 7)
	    {
	      alert("Your phone number must be at least seven digits long.");
	      documentform.telefon.focus();
	      return (false);
	    }

	    if (documentform.email.value == "")
	    {
	      alert("Please enter your e-mail address.");
	      documentform.email.focus();
	      return (false);
	    }

	    if (documentform.email.value.length < 8)
	    {
	      alert("Your e-mail address must be at least eight characters long.");
	      documentform.email.focus();
	      return (false);
	    }

	    if ((documentform.email.value.indexOf("sdf") > -1) || (documentform.email.value.indexOf("jkl") > -1) || (documentform.email.value.indexOf(".") == -1) || (documentform.email.value.indexOf("@") == -1)) {
	      alert("Your e-mail address is invalid.");
	      documentform.email.focus();
	      return (false);
	    }

	    var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@-_.";
	    var checkStr = documentform.email.value;
	    var allValid = true;
	    var validGroups = true;
	    for (i = 0;  i < checkStr.length;  i++)
	    {
	      ch = checkStr.charAt(i);
	      for (j = 0;  j < checkOK.length;  j++)
	        if (ch == checkOK.charAt(j))
	          break;
	      if (j == checkOK.length)
	      {
	        allValid = false;
	        break;
	      }
	    }
	    if (!allValid)
	    {
	      alert("Please enter letters, digits, and \"@-_.\" characters only into the e-mail address.");
	      documentform.email.focus();
	      return (false);
	    }
		
		if (documentform.transaktion[1].checked) {
			if (documentform.stornobedingungenakzeptiert.checked==false) {
				alert("You must accept the cancellation terms to make a reservation.\n\nIf you want to accept the terms, click the mouse\ninto the checkbox befor the cancellation notice, to check it.");
				return (false);
			}
		}
	}
	return (true);
  }



  function printpage() {
    printlocation="http://www.atrium-baden.com/phprint.php?page="+window.location;
    window.open(printlocation,'','width=770,height=520,toolbar=1,menubar=1,scrollbars=1,status=0,resizable=0');
  }



  function setreferral() {
    if(document.location.search != "") {
      previouslocation=document.location.search;
      document.referralform.url.value=previouslocation.substring(1,previouslocation.length);
    }
    else document.referralform.url.value='http://www.atrium-baden.com/';
  }  



  function tellafriend() {
    window.location="http://www.atrium-baden.com/service/referral.html?"+window.location;
  }



  function sendreferral(theForm)
  {
    if (theForm.senderemail.value.length < 7)
    {
      alert("Please enter at least 7 characters as \"Your own e-mail address\".");
      theForm.senderemail.focus();
      return (false);
    }

    var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-@";
    var checkStr = theForm.senderemail.value;
    var allValid = true;
    var validGroups = true;
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Please enter letters, digits, and \"@-_.\" characters only as your own e-mail address.");
      theForm.senderemail.focus();
      return (false);
    }

    if (theForm.recipientemail.value.length < 7)
    {
      alert("Please enter at least 7 characters as the \"Recipient's address\".");
      theForm.recipientemail.focus();
      return (false);
    }

    if ((theForm.recipientemail.value.indexOf("sdf") > -1) || (theForm.recipientemail.value.indexOf("jkl") > -1) || (theForm.recipientemail.value.indexOf(".") == -1) || (theForm.recipientemail.value.indexOf("@") == -1)) {
      alert("The recipient's address is invalid.");
      theForm.recipientemail.focus();
      return (false);
    }

    var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.@";
    var checkStr = theForm.recipientemail.value;
    var allValid = true;
    var validGroups = true;
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Please enter letters, digits, and \"@-_.\" characters only as the recipient's e-mail address.");
      theForm.recipientemail.focus();
      return (false);
    }
    return (true);
  }



  function contact_validator(documentform)
  {
    if (documentform.mitteilung.value == "")
    {
      alert("Please enter your message.");
      documentform.mitteilung.focus();
      return (false);
    }

    if (documentform.mitteilung.value.length < 20)
    {
      alert("Your message must be at least 20 characters long.");
      documentform.mitteilung.focus();
      return (false);
    }

    if (documentform.telefon.value == "")
    {
      alert("Please enter your phone number.");
      documentform.telefon.focus();
      return (false);
    }

    if (documentform.telefon.value.length < 7)
    {
      alert("Your phone number must have at least seven digits.");
      documentform.telefon.focus();
      return (false);
    }

    if (documentform.email.value == "")
    {
      alert("Please enter your e-mail address.");
      documentform.email.focus();
      return (false);
    }

    if (documentform.email.value.length < 8)
    {
      alert("Your e-mail address must be at least eight characters long.");
      documentform.email.focus();
      return (false);
    }

    if ((documentform.email.value.indexOf("sdf") > -1) || (documentform.email.value.indexOf("jkl") > -1) || (documentform.email.value.indexOf(".") == -1) || (documentform.email.value.indexOf("@") == -1)) {
      alert("Your e-mail address is invalid.");
      documentform.email.focus();
      return (false);
    }

    var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@-_.";
    var checkStr = documentform.email.value;
    var allValid = true;
    var validGroups = true;
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Please enter letters, digits, and \"@-_.\" characters only as the recipient's e-mail address.");
      documentform.email.focus();
      return (false);
    }

    return (true);
  }

//-->