function Check(theForm) {

if (theForm.voornaam.value == "") {
	alert("Voornaam is verplicht.");
	theForm.voornaam.focus();
return (false);
}
if (theForm.achternaam.value == "") {
	alert("Achternaam is verplicht.");
	theForm.achternaam.focus();
return (false);
}
if (theForm.straat.value == "") {
	alert("Straat en huisnummer.");
	theForm.straat.focus();
return (false);
}
if (theForm.postcode.value == "") {
	alert("Postcode is verplicht.");
	theForm.postcode.focus();
return (false);
}
if (theForm.woonplaats.value == "") {
	alert("Woonplaats is verplicht.");
	theForm.woonplaats.focus();
return (false);
}
if (theForm.telefoon.value == "") {
	alert("Telefoon is verplicht.");
	theForm.telefoon.focus();
return (false);
}
if (theForm.email.value == "") {
	alert("Email is verplicht.");
	theForm.email.focus();
return (false);
}

// test if valid email address, must have @ and .
var checkEmail = "@.";
var checkStr = theForm.email.value;
var EmailValid = false;
var EmailAt = false;
var EmailPeriod = false;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkEmail.length;  j++)
{
if (ch == checkEmail.charAt(j) && ch == "@")
EmailAt = true;
if (ch == checkEmail.charAt(j) && ch == ".")
EmailPeriod = true;
	  if (EmailAt && EmailPeriod)
		break;
	  if (j == checkEmail.length)
		break;
	}
	// if both the @ and . were in the string
if (EmailAt && EmailPeriod)
{
		EmailValid = true
		break;
	}
}
if (!EmailValid) {
	alert("Dit is geen geldig e-mailadres.");
	theForm.email.focus();
return (false);
}

// check if both password fields are the same
if (theForm.email.value != theForm.replay.value)	{
	alert("de emailadressen komen niet overeen.");
	theForm.replay.focus();
return (false);
	}
}
// einde einde einde einde einde einde einde einde einde einde


function Contact(theForm) {


if (theForm.naam.value == "") {
	alert("Naam is verplicht.");
	theForm.naam.focus();
return (false);
}

if (theForm.email.value == "") {
	alert("Email is verplicht.");
	theForm.email.focus();
return (false);
}

// test if valid email address, must have @ and .
var checkEmail = "@.";
var checkStr = theForm.email.value;
var EmailValid = false;
var EmailAt = false;
var EmailPeriod = false;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkEmail.length;  j++)
{
if (ch == checkEmail.charAt(j) && ch == "@")
EmailAt = true;
if (ch == checkEmail.charAt(j) && ch == ".")
EmailPeriod = true;
	  if (EmailAt && EmailPeriod)
		break;
	  if (j == checkEmail.length)
		break;
	}
	// if both the @ and . were in the string
if (EmailAt && EmailPeriod)
{
		EmailValid = true
		break;
	}
}
if (!EmailValid) {
	alert("Dit is geen geldig e-mailadres.");
	theForm.email.focus();
return (false);
}

// check if both password fields are the same
if (theForm.email.value != theForm.replay.value)	{
	alert("de emailadressen komen niet overeen.");
	theForm.replay.focus();
return (false);
	}

}
// einde einde einde einde einde einde einde einde einde einde
