// JavaScript Document
// for kevinstrijbos.be
// by frizbee.be


function gb_formcheck(){
	if (document.formname.ab.value =="" || document.formname.ab.value == "Your name and firstname*.")
	{
	  alert("Please fill in your name and firstname.");
	  document.formname.ab.focus();
	  return false
	}
	if (!checkMail(document.formname.bem.value))
	{
	  alert("Please fill in a correct email.");
	  document.formname.bem.focus();
	  return false
	}
	if (document.formname.message.value=="" || document.formname.message.value == "Your message*.")
	{
	  alert("Please fill in a message.");
	  document.formname.message.focus();
	  return false
	}
	if (document.formname.validator.value=="" || document.formname.validator.value == "Securitycode*.")
	{
	  alert("Please fill in the securitycode you see on the left.");
	  document.formname.validator.focus();
	  return false
	}
}


function formcheck_contact(){
	
	if (document.formname.ab.value=="" || document.formname.ab.value=="Typ hier je voornaam*"){
	  alert("Gelieve je voornaam in te vullen.");
	  document.formname.ab.focus();
	  return false
	}
	if (document.formname.abc.value=="" || document.formname.abc.value=="Typ hier je naam*"){
	  alert("Gelieve je naam in te vullen.");
	  document.formname.abc.focus();
	  return false
	}
	if (!checkMail(document.formname.bem.value)){
	  alert("Gelieve een geldig email adres in te vullen.");
	  document.formname.bem.focus();
	  return false
	}
	if (document.formname.message.value=="" || document.formname.message.value=="Typ hier je bericht*"){
	  alert("Gelieve een vraag of opmerking in te vullen.");
	  document.formname.message.focus();
	  return false
	}
	if (document.formname.validator.value=="" || document.formname.validator.value=="Herhaal de code*"){
	  alert("Gelieve de code correct te herhalen.");
	  document.formname.validator.focus();
	  return false
	}

}


function checkMail(s)
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(s)) return true;
	else return false;
}