function checkform() {
var out = true;
var name = document.mailform.naam;
var adres = document.mailform.adres;
var postcode = document.mailform.postcode;
var plaats = document.mailform.plaats;
var email = document.mailform.email;

if ((name.value == '') || (name.value == 'Verplichte velden')) { name.style.background = 'url(fileadmin/mform/images/input-warn-bg.jpg) no-repeat'; out = false; name.value = 'Verplichte velden'; name.style.color = '#F70724';} else name.style.background = 'url(fileadmin/mform/images/input-bg.jpg) no-repeat';
if ((adres.value == '') || (adres.value == 'Verplichte velden')){ adres.style.background = 'url(fileadmin/mform/images/input-warn-bg.jpg) no-repeat'; out = false; adres.value = 'Verplichte velden'; adres.style.color = '#F70724';} else adres.style.background = 'url(fileadmin/mform/images/input-bg.jpg) no-repeat';

if ((postcode.value == '') || (postcode.value == 'Verplichte velden')) { postcode.style.background = 'url(fileadmin/mform/images/input-warn-bg.jpg) no-repeat'; out = false; postcode.value = 'Verplichte velden'; postcode.style.color = '#F70724';} else postcode.style.background = 'url(fileadmin/mform/images/input-bg.jpg) no-repeat';

if ((plaats.value == '') || (plaats.value == 'Verplichte velden')) { plaats.style.background = 'url(fileadmin/mform/images/input-warn-bg.jpg) no-repeat'; out = false; plaats.value = 'Verplichte velden'; plaats.style.color = '#F70724';} else plaats.style.background = 'url(fileadmin/mform/images/input-bg.jpg) no-repeat';

if ((email.value == '') || (email.value == 'Verplichte velden')) { email.style.background = 'url(fileadmin/mform/images/input-warn-bg.jpg) no-repeat'; out = false; email.value = 'Verplichte velden'; email.style.color = '#F70724';} else { 
	if (!isValidEmail(email.value)) { out = false;  email.style.background = 'url(fileadmin/mform/images/input-warn-bg.jpg) no-repeat'; } else email.style.background = 'url(fileadmin/mform/images/input-bg.jpg) no-repeat';
}

return out;
}

//function to check valid email address
function isValidEmail(strEmail){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  
   // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1) 
   {
      //alert('A valid e-mail address is required.\nPlease amend and retry');
      return false;
    } 
    return true; 
}

