<!--

  // © 2007 Bitpalast GmbH. All rights reserved.

  function contact_validator(theForm)
  {
    if (theForm.firstname.value == "")
    {
      alert("Please enter your first name.");
      theForm.firstname.focus();
      return (false);
    }

    if (theForm.firstname.value.length < 2)
    {
      alert("Your firstname must be at least two characters long.");
      theForm.firstname.focus();
      return (false);
    }

    if (theForm.lastname.value == "")
    {
      alert("Please enter your last name.");
      theForm.lastname.focus();
      return (false);
    }

    if (theForm.lastname.value.length < 2)
    {
      alert("Your lastname must be at least two characters long.");
      theForm.lastname.focus();
      return (false);
    }

    if (theForm.email.value == "")
    {
      alert("Please enter your e-mail address.");
      theForm.email.focus();
      return (false);
    }

    if ((theForm.email.value.indexOf("sdf") > -1) || (theForm.email.value.indexOf("jkl") > -1) || (theForm.email.value.indexOf(".") == -1) || (theForm.email.value.indexOf("@") == -1)) {
      alert("Your e-Mail addresse is invalid.");
      theForm.email.focus();
      return (false);
    }

    var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@-_.";
    var checkStr = theForm.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("As an e-mail address, please enter letters, digits and \"@-_.\" characters only.");
      theForm.email.focus();
      return (false);
    }

    if (theForm.phone.value == "")
    {
      alert("Please enter your phone number.");
      theForm.phone.focus();
      return (false);
    }

    if (theForm.phone.value.length < 7)
    {
      alert("Your phone number must be at least seven digits long.");
      theForm.phone.focus();
      return (false);
    }

    if (theForm.location.value == "")
    {
      alert("Please enter the location of your property.");
      theForm.location.focus();
      return (false);
    }

    if (theForm.location.value.length < 15)
    {
      alert("The description of the location must be at least 15 characters long.");
      theForm.location.focus();
      return (false);
    }

    return (true);
  }

//-->
