// regsitratieblok tonen/verbergen

function showRegistration() {
	document.getElementById('registrationblock').style.visibility='visible';
}

function hideRegistration() {
	document.getElementById('registrationblock').style.visibility='hidden';
}

function checkData(){
	var correct = true
	var regexpemail =/^[a-zA-Z0-9\-\.\_]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; //regexp for e-mail address
	var str = document.registratieform.email.value; // value to compare
	if (document.registratieform.voornaam.value == '') {correct = false; alert("Vul uw voornaam in.");document.registratieform.voornaam.focus(); return correct}
	if (document.registratieform.achternaam.value == '') {correct = false; alert("Vul uw achternaam in.");document.registratieform.achternaam.focus(); return correct}
	if (document.registratieform.bedrijf.value == '') {correct = false; alert("Vul een bedrijfsnaam in.");document.registratieform.bedrijf.focus(); return correct}
	if (document.registratieform.functie.value == '') {correct = false; alert("Vul uw functie in.");document.registratieform.functie.focus(); return correct}
	if (document.registratieform.adres_bezoek.value == '') {correct = false; alert("Vul het bezoekadres in.");document.registratieform.adres_bezoek.focus(); return correct}
	if (document.registratieform.postcode_bezoek.value == '') {correct = false; alert("Vul de postcode van het bezoekadres in.");document.registratieform.postcode_bezoek.focus(); return correct}
	if (document.registratieform.plaats_bezoek.value == '') {correct = false; alert("Vul de plaatnaam van het bezoekadres in.");document.registratieform.plaats_bezoek.focus(); return correct}
	if (document.registratieform.telefoonnummer_algemeen.value == '') {correct = false; alert("Vul een telefoonnummer in.");document.registratieform.telefoonnummer_algemeen.focus(); return correct}
	if (document.registratieform.akkoord.checked == false) {correct = false; alert("U dient akkoord te gaan met de genoemde voorwaarden.");document.registratieform.akkoord.focus(); return correct}
	if (regexpemail.test(str) == false){
	correct = false; alert("Vul een geldig e-mailadres in.");document.registratieform.email.focus(); return correct}
	return correct;
}

function checkData_loginform(){
	var correct = true
	var regexpemail =/^[a-zA-Z0-9\-\.\_]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; //regexp for e-mail address
	var str = document.loginform.username.value; // value to compare
	if (regexpemail.test(str) == false){
	correct = false; alert("Vul uw e-mailadres in.");document.loginform.username.focus(); return correct}
	if (document.loginform.password.value == '') {correct = false; alert("Vul uw toegangscode in.");document.loginform.password.focus(); return correct}
	return correct;
}

function checkData_lostpass(){
	var correct = true
	var regexpemail =/^[a-zA-Z0-9\-\.\_]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; //regexp for e-mail address
	var str = document.lostpass.email.value; // value to compare
	if (regexpemail.test(str) == false){
	correct = false; alert("Vul uw e-mailadres in.");document.lostpass.email.focus(); return correct}
	return correct;
}
