//------------------------------------------------------------------------------------------
//CONTROLE-SCRIPT VOOR CONTACTFORMULIER
//------------------------------------------------------------------------------------------

function controle()
{
vandaag = new Date();
if (document.contact.anaam.value == "")
	{
	alert ("Geen ACHTERNAAM opgegeven\n\nInvullen is VERPLICHT !!");
	document.contact.anaam.focus();
	return false;
	}
if (document.contact.geslacht[0].checked == false && document.contact.geslacht[1].checked == false)
	{
	alert("Geen GESLACHT aangegeven\n\nInvullen is VERPLICHT !!");
	document.contact.geslacht[0].focus();
	return false;
	}
if (document.contact.vnaam.value == "")
	{
	alert("Geen VOORNAAM opgegeven\n\nInvullen is VERPLICHT !!");
	document.contact.vnaam.focus();
	return false;
	}
if (document.contact.vlett.value == "")
	{
	alert("Geen VOORLETTERS opgegeven\n\nInvullen is VERPLICHT !!");
	document.contact.vlett.focus();
	return false;
	}
if (document.contact.gebdag.value == "")
	{
	alert("Geen GEBOORTEDAG opgegeven\n\nInvullen is VERPLICHT !!");
	document.contact.gebdag.focus();
	return false;
	}
if (isNaN(document.contact.gebdag.value))
	{
	alert("GEBOORTEDAG: alleen CIJFERS invullen !!");
	document.contact.gebdag.value = "";
	document.contact.gebdag.focus();
	return false;
	}
if (document.contact.gebdag.value < 1 || document.contact.gebdag.value > 31 )
	{
	alert("GEBOORTEDAG dient tussen 1 en 31 te liggen !");
	document.contact.gebdag.value = "";
	document.contact.gebdag.focus();
	return false;
	}
if (document.contact.gebmnd.value == "")
	{
	alert("Geen GEBOORTEMAAND opgegeven\n\nInvullen is VERPLICHT !!");
	document.contact.gebmnd.focus();
	return false;
	}
if (isNaN(document.contact.gebmnd.value))
	{
	alert("GEBOORTEMAAND: alleen CIJFERS invullen !!");
	document.contact.gebmnd.value = "";
	document.contact.gebmnd.focus();
	return false;
	}
if (document.contact.gebmnd.value < 1 || document.contact.gebmnd.value > 12 )
	{
	alert("GEBOORTEMAAND dient tussen 1 en 12 te liggen !");
	document.contact.gebmnd.value = "";
	document.contact.gebmnd.focus();
	return false;
	}
if (document.contact.gebjaar.value == "")
	{
	alert("Geen GEBOORTEJAAR opgegeven\n\nInvullen is VERPLICHT !!");
	document.contact.gebjaar.focus();
	return false;
	}
if (isNaN(document.contact.gebjaar.value))
	{
	alert("GEBOORTEJAAR: alleen CIJFERS invullen !!");
	document.contact.gebjaar.value = "";
	document.contact.gebjaar.focus();
	return false;
	}
if (document.contact.gebjaar.value < (vandaag.getFullYear()-70) || document.contact.gebjaar.value > vandaag.getFullYear()-18)
	{
	alert("GEBOORTEJAAR ongewone waarde !!");
	document.contact.gebjaar.value = "";
	document.contact.gebjaar.focus();
	return false;
	}
if (document.contact.instel.value == "")
	{
	alert("Geen INSTELLING opgegeven\n\nInvullen is VERPLICHT !!");
	document.contact.instel.focus();
	return false;
	}
if (document.contact.adres.value == "")
	{
	alert("Geen POST-ADRES opgegeven\n\nInvullen is VERPLICHT !!");
	document.contact.adres.focus();
	return false;
	}
if (document.contact.huisnr.value == "")
	{
	alert("Geen HUISNR opgegeven\n\nInvullen is VERPLICHT !!");
	document.contact.huisnr.focus();
	return false;
	}
if (document.contact.post.value == "" || document.contact.code.value == "")
	{
	alert("Geen POSTCODE opgegeven\n\nInvullen is VERPLICHT !!");
	document.contact.post.focus();
	return false;
	}
if (document.contact.plaats.value == "")
	{
	alert("Geen WOONPLAATS opgegeven\n\nInvullen is VERPLICHT !!");
	document.contact.plaats.focus();
	return false;
	}
if (document.contact.fadres.value == "")
	{
	document.contact.fadres.value = document.contact.adres.value;
	}
if (document.contact.fhuisnr.value == "")
	{
	document.contact.fhuisnr.value = document.contact.huisnr.value;
	}
if (document.contact.fpost.value == "")
	{
	document.contact.fpost.value = document.contact.post.value;
	}
if (document.contact.fcode.value == "")
	{
	document.contact.fcode.value = document.contact.code.value;
	}
if (document.contact.fplaats.value == "")
	{
	document.contact.fplaats.value = document.contact.plaats.value;
	}
if (document.contact.telwerk.value == "")
	{
	alert("Geen TELEFOON WERK opgegeven\n\nInvullen is VERPLICHT !!");
	document.contact.telwerk.focus();
	return false;
	}
if (document.contact.functie.value == "")
	{
	alert("Geen FUNCTIEOMSCHRIJVING opgegeven\n\nInvullen is VERPLICHT !!");
	document.contact.functie.focus();
	return false;
	}
if (document.contact.funcond.value == "" && document.contact.funcbed.value == "")
	{
	alert("Geen FUNCTIE geselecteerd\n\nInvullen is VERPLICHT !!");
	document.contact.funcond.focus();
	return false;
	}
if (document.contact.funcond.value != "" && document.contact.sector.value == "")
	{
	alert("Geen SECTOR geselecteerd\n\nInvullen is VERPLICHT !!");
	document.contact.sector.focus();
	return false;
	}
if (document.contact.mail.value == "")
	{
	alert("Geen EMAIL-ADRES opgegeven\n\nInvullen is VERPLICHT !!");
	document.contact.mail.focus();
	return false;
	}
return true;
}
