<!-- Pruefung Formular -->


        function verify(form)
        {
           var passed = false;
        var blnRetval, intAtSign, intDot, intComma, intSpace, intLastDot, intDomain, intStrLen;
        if (form.Email){
                       intAtSign=form.Email.value.indexOf("@");
                        intDot=form.Email.value.indexOf(".",intAtSign);
                        intComma=form.Email.value.indexOf(",");
                        intSpace=form.Email.value.indexOf(" ");
                        intLastDot=form.Email.value.lastIndexOf(".");
                        intDomain=intDot-intAtSign;
                        intStrLen=form.Email.value.length;
                // *** CHECK FOR BLANK EMAIL VALUE
                   if (form.Email.value == "" )
                   {
                alert("Bitte E-Mail Adresse eingeben.");
                form.Email.focus();
                passed = false;
                }
                // **** CHECK FOR THE  @ SIGN?
                else if (intAtSign == -1)
                {

                alert("Ihre E-Mail Adresse muss ein \"@\" enthalten.");
                        form.Email.focus();
                passed = false;

                }
                // **** Check for commas ****

                else if (intComma != -1)
                {
                alert("Ihre E-Mail Adresse darf kein Komma enthalten.");
                form.Email.focus();
                passed = false;
                }

                // **** Check for a space ****

                else if (intSpace != -1)
                {
                alert("Ihre E-Mail Adresse darf kein Leerzeichen enthalten.");
                form.Email.focus();
                passed = false;
                }

                // **** Check for char between the @ and dot, chars between dots, and at least 1 char after the last dot ****

                else if ((intDot <= 2) || (intDomain <= 1)  || (intStrLen-(intLastDot+1) < 2))
                {
                alert("Bitte gueltige E-Mail Adresse eingeben.\n" + form.Email.value + " ist ungueltig.");
                form.Email.focus();
                passed = false;
              }
                else if (form.lastname.value == "")
                {
                alert("Bitte geben Sie Ihren Namen an.");
                form.lastname.focus();
                passed = false;

                }

                 else {
                 passed = true;
                }
        	} else    {
              passed = true;
        }  return passed;
  }
  
function Validate(theForm){

  var Arr=new Array("text","email","land","ort","plz","strasse","vorname","name");

  for(var a=0; a<Arr.length; a++){
    obj=eval("document.forms[0]."+Arr[a]);
   if(theForm.name.value==""){
    alert("Bitte geben Sie einen Nachnamen ein.");
    theForm.name.focus();
    return false;
   }
   if(theForm.vorname.value==""){
    alert("Bitte geben Sie einen Vornamen ein.");
    theForm.vorname.focus();
    return false;
   }
    if(theForm.strasse.value==""){
    alert("Bitte geben Sie eine Straße ein.");
    theForm.strasse.focus();
    return false;
   }
    if(theForm.plz.value==""){
    alert("Bitte geben Sie eine PLZ ein.");
    theForm.plz.focus();
    return false;
   }

    if(theForm.ort.value==""){
    alert("Bitte geben Sie einen Ort ein.");
    theForm.ort.focus();
    return false;
   }
    if(theForm.land.value==""){
    alert("Bitte geben Sie einen Land ein.");
    theForm.land.focus();
    return false;
   }
   if(theForm.text.value==""){
    alert("Bitte geben Sie eine Nachricht ein.");
    theForm.text.focus();
    return false;
   }
    if(theForm.email.value==""){
    alert("Bitte geben Sie eine E-MAIL ein.");
    theForm.email.focus();
    return false;
   }

  }
  return true;
}


