<!--//

function validateForm()
{
	
	//check of Naam leeg is
	if (document.form1.elements['Naam'].value == "")
	{
		alert("Vul een waarde in voor het veld Naam.");
		document.form1.elements['Naam'].focus();
		return(false);
	}
			
	//check of Email leeg is
  	if (document.form1.elements['Email'].value == "")
	{
		alert("Vul een waarde in voor het veld e-mail.");
		document.form1.elements['Email'].focus();
	    return(false);
	}
	//check of Email juist is
	if (!checkEmail(document.form1.elements['Email'].value))
	{
		alert("U dient een geldig e-mailadres in te voeren");
		document.form1.elements['Email'].focus();
		return(false);
	}		
	//check of Opmerking leeg is
	if (document.form1.elements['Bericht'].value == "")
	{
		alert("Vul een waarde in voor het veld opmerking");
		document.form1.elements['Bericht'].focus();
        return(false);
   	}

}

// deze functie controleert de juistheid van het e-mailadres op meerdere punten
function checkEmail(emailAddress) {

	var foundAtSymbol = 0;
	var foundDot = 0;
	var md;

	// Go through each character in the email address.
	for (var x=0; x<emailAddress.length - 1; x++) {
		md = emailAddress.substr(x, 1);
		
		// Is the character an @ symbol?
		if (md == '@') foundAtSymbol++;
		
		// Count how many dots there are after the @ symbol.
		if (md == '.' && foundAtSymbol == 1) foundDot++;
	};
	
	// Is there only one @ symbol, and are there more than one dots?
	if (foundDot > 0 && foundAtSymbol == 1) {
		return true;
	} else {
		return false;
	};

};

//-->
