function testIsBlank(strValue)
{
	for(i = 0; i < strValue.length; i++)
		{
		var c = strValue.charAt(i);
		if ((c != ' ') && (c != '\n') && (c != '\t'))
		return false;
		}
	return true;
}

function validateField(frmField, sMessage) {
    if (testIsBlank(frmField.value)) {
      alert(sMessage);
      frmField.focus();
      return false;
    }

    return true;
}

function ValidateForm()
{

		if (!validateField(document.frmEmail.name, "Please enter your name.")) {
		    return;
			
		}
				if (!validateField(document.frmEmail.firstname, "Please enter your first name.")) {
		    return;
			
		}
		
				if (!validateField(document.frmEmail.street, "Please enter your street.")) {
		    return;
			
		}
		if (!validateField(document.frmEmail.postalcode, "Please enter your postal code.")) {
		    return;
			
		}
				if (!validateField(document.frmEmail.city, "Please enter your city.")) {
		    return;
			
		}

		
		if (!validateField(document.frmEmail.email, "Please enter your email.")) {
				    return;
		}

		


// ----------------------------------nieuw email check script

		if (document.frmEmail.Email.value.indexOf("@") == -1)
		{
		alert("E-mail must contain the @ character.");
		return false;
		}

// ----------------------------------oud email check script



		// construct body

		document.frmEmail.sBody.value  = 'Name: \t' + document.frmEmail.name.value + '\n';
		document.frmEmail.sBody.value += 'firstname: \t' + document.frmEmail.firstname.value + '\n';
		document.frmEmail.sBody.value += 'street: \t' + document.frmEmail.street.value + '\n';
		document.frmEmail.sBody.value += 'postalcode: \t' + document.frmEmail.postalcode.value + '\n';
		document.frmEmail.sBody.value += 'city: \t' + document.frmEmail.city.value + '\n';
		document.frmEmail.sBody.value += 'email: \t' + document.frmEmail.email.value + '\n';
		
		document.frmEmail.sKey.value = '537RQKS9BI7O363T9F9MX01S039J1P43';
		document.frmEmail.submit();

}


