function mailcheck(){

if (document.myForm.Name.value == "") 
{
alert ("Fill in your name!");
document.myForm.Name.focus();
return false;
}
var email=document.myForm.email.value;
if(email == ""){
alert ("Fill in your e-mail address!");
document.myForm.email.focus();
return false;
}
invalidChars = "/:,;"
if (email == ""){         //email can't be empty
alert("Enter your e-mail address!");
document.myForm.email.focus();
return false
}
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("Do not use invalid characters in e-mail address!");
document.myForm.email.focus();
return false
}
}
atPos = email.indexOf("@",1)         //there has to be a @ symbol 
if (atPos == -1){
alert("In e-mail address, there must be a \@ character!");
document.myForm.email.focus();
return false
}
if (email.indexOf("@",atPos+1) != -1){         //only one @ symbol 
alert("Only one \@ symbol!");
document.myForm.email.focus();
return false
}

periodPos = email.indexOf(".",atPos)
if (periodPos == -1){         //and at least one "." after the @ sign
alert("There has to be at least one \"\.\" after \@ character!");
document.myForm.email.focus();
return false
}
if (periodPos+3 > email.length){         //must be at least two characters after the "."
alert("There must be at least two characters after the \"\.\"")
document.myForm.email.focus();
return false;
}

var postcode=document.myForm.Zip_Code.value;
if (postcode=="")
{
alert ("Please fill in your postcode!");
document.myForm.Zip_Code.focus();
return false;
}

/*
var myCode=postcode.substr(0,2);
document.myForm.kood.value=myCode;
*/
//validate reference
if (document.myForm.source.value ==""){
alert("Select your source!");
document.myForm.source.focus();
return (false);
}


if (document.myForm.comments.value == ""){
alert ("Don't forget your message!");
document.myForm.comments.focus();
return false;
}
document.myForm.submit();
return true;
}

