function mailcheck(){

if (document.myForm.name.value == "") 
{
alert ("Bitte geben Sie ihre Name ein!");
document.myForm.name.focus();
return false;
}
var email=document.myForm.email.value;
if(email == ""){
alert ("Bitte geben Sie Ihre E-Mail-Adresse ein!");
document.myForm.email.focus();
return false;
}
invalidChars = "/:,;";
for (i=0; i<invalidChars.length;i++){         //does the users input contain any invalid characters?
badChar = invalidChars.charAt(i)
if (email.indexOf(badChar,0) > -1){
alert("Bitte keine unzulässigen Zeichen in Ihrer E-Mail-Adresse verwenden!");
document.myForm.email.focus();
return false
}
}
atPos = email.indexOf("@",1)         //there has to be a @ symbol 
if (atPos == -1){
alert("In Ihrer E-Mail-Adresse muß ein \@ -Symbol geben!");
document.myForm.email.focus();
return false
}
if (email.indexOf("@",atPos+1) != -1){         //only one @ symbol 
alert("Bitte nur ein \@-Symbol!");
document.myForm.email.focus();
return false
}

periodPos = email.indexOf(".",atPos)
if (periodPos == -1){         //and at least one "." after the @ sign
alert("Nach @-Zeichen muß mindestens ein \".\" sein!");
document.myForm.email.focus();
return false
}
if (periodPos+3 > email.length){         //must be at least two characters after the "."
alert("Nach \"\.\" müssen mindestens 2 Buchstaben sein!")
document.myForm.email.focus();
return false;
}
if (document.myForm.comments.value == ""){
alert ("Sie haben ihre Anfrage vergessen!");
document.myForm.comments.focus();
return false;
}
document.myForm.submit();
return true;
}

