// JavaScript Document

function validate_form_NL()
	{
	if (document.bookingform.firstname.value == "")
		{alert ("Vul aub uw voornaam in");
		document.bookingform.firstname.focus();
		return false;
		}	
	if (document.bookingform.surname.value == "")
		{alert ("Vul aub uw achternaam in");
		document.bookingform.surname.focus();
		return false;
		}	
	if (document.bookingform.address1.value == "")
		{alert ("Vul aub uw adres in");
		document.bookingform.address1.focus();
		return false;
		}
	if (document.bookingform.postcode.value == "")
		{alert ("Vul aub uw postcode in");
		document.bookingform.postcode.focus();
		return false;
		}	
	if (document.bookingform.town.value == "")
		{alert ("Vul aub uw woonplaats in");
		document.bookingform.town.focus();
		return false;
		}
	if (document.bookingform.country.value == "")
		{alert ("Vul aub uw land in");
		document.bookingform.country.focus();
		return false;
		}	
	if ((document.bookingform.tele.value == "")&&(document.bookingform.mobile.value == ""))
		{alert ("Geef aub een telefoonnummer aan");
		document.bookingform.tele.focus();
		return false;
		}
	if (document.bookingform.email.value == "")
		{alert ("Vul aub een email adres in zodat we uw boeking kunnen bevestigen");
		document.bookingform.email.focus();
		return false;
		}
	if (document.bookingform.email.value != "")
		{
		i=document.bookingform.email.value.indexOf("@")
	 	j=document.bookingform.email.value.indexOf(".",i)
	 	k=document.bookingform.email.value.indexOf(",")
	 	kk=document.bookingform.email.value.indexOf(" ")
	 	jj=document.bookingform.email.value.lastIndexOf(".")+1
	 	len=document.bookingform.email.value.length
			if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3)) 
			{
 			}
 			else 
			{alert ("Vul aub een geldig email adres in");
			document.bookingform.email.focus();
			return false;
			}
 		}
	if (document.bookingform.party.value == 0)
		{alert ("Geef aub het aantal volwassenen aan");
		document.bookingform.party.focus();
		return false;
		}
	if (document.bookingform.day.value == "dd")
		{alert ("Voor welke dag wenst u uw rondleiding te boeken?");
		document.bookingform.day.focus();
		return false;
		}
	if (document.bookingform.month.value == "mm")
		{alert ("Voor welke maand wenst u uw rondleiding te boeken?");
		document.bookingform.day.focus();
		return false;
		}
	var iChars = "#[]{}<>";
	for (var i = 0; i < document.bookingform.comments.value.length; i++)
	{
  	if (iChars.indexOf(document.bookingform.comments.value.charAt(i)) != -1) 
		{
  	alert ("Uw opmerkingsbericht heeft niet toegestaande letters. \nVerwijder deze aub van uw bericht.");
  	document.bookingform.comments.focus();
	return false;
  		}
  	}
		
	
	}
	
function validate_contactform_NL()
	{
errmsg = new Array();
	if (document.contactform.email.value == "")
		{
		errmsg.push("- Vul a.u.b uw email adres in");
		}
	if (document.contactform.email.value != "")
		{
		i=document.contactform.email.value.indexOf("@")
	 	j=document.contactform.email.value.indexOf(".",i)
	 	k=document.contactform.email.value.indexOf(",")
	 	kk=document.contactform.email.value.indexOf(" ")
	 	jj=document.contactform.email.value.lastIndexOf(".")+1
	 	len=document.contactform.email.value.length
			if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3)) 
			{
 			}
 			else {
 			errmsg.push("- Vul a.u.b een geldig email adres in");
 				}
		}
	
	if (document.contactform.name.value == "")
		{
		errmsg.push("- Vul a.u.b uw naam in");
		}
	if (document.contactform.message.value == "")
		{
		errmsg.push("- Wat is uw vraag?");
		}
	var iChars = "#%^*+=[]\\\/{}|\<>";
	for (var i = 0; i < document.contactform.message.value.length; i++) 
		{
  		if (iChars.indexOf(document.contactform.message.value.charAt(i)) != -1) 
			{
  			errmsg.push("- Uw bericht heeft niet toegestane letters. \nVerwijder deze aub van uw bericht.");
			}
		}
	if (errmsg.length > 0) 
		{
		alert(("Uw formulier kan niet verstuurd worden:\n") + errmsg.join(",\n") + ("."));
	//	{
	//	alert(errmsg);
		return false
		}
	else
		{
		return true;
		}
	}

function checkdate_NL() {
	
	if ((document.bookingform.month.value == 2)&&(document.bookingform.day.value > 29))
		{alert ("In Februari zijn er 28 of 29 dagen, verander aub uw keuze.");
		document.bookingform.day.focus();
		return false;
		}
	if ((document.bookingform.month.value == 4)&&(document.bookingform.day.value == 31))
		{alert ("In April zijn er maar 30 dagen, verander aub uw keuze.");
		document.bookingform.day.focus();
		return false;
		}
	if ((document.bookingform.month.value == 6)&&(document.bookingform.day.value == 31))
		{alert ("In Juni zijn er maar 30 dagen, verander aub uw keuze.");
		document.bookingform.day.focus();
		return false;
		}
	if ((document.bookingform.month.value == 9)&&(document.bookingform.day.value == 31))
		{alert ("In September zijn er maar 30 dagen, verander aub uw keuze.");
		document.bookingform.day.focus();
		return false;
		}
	if ((document.bookingform.month.value == 11)&&(document.bookingform.day.value == 31))
		{alert ("In November zijn er maar 30 dagen, verander aub uw keuze.");
		document.bookingform.day.focus();
		}
	else
		{
		return true;
		}
}

function validate_mail_friend_NL()
	{
errmsg = new Array();
	if (document.mail_friend.email.value == "")
		{
		errmsg.push("- Vul aub uw email adres in.");
		}
	if (document.mail_friend.email.value != "")
		{
		i=document.mail_friend.email.value.indexOf("@");
	 	j=document.mail_friend.email.value.indexOf(".",i);
	 	k=document.mail_friend.email.value.indexOf(",");
	 	kk=document.mail_friend.email.value.indexOf(" ");
	 	jj=document.mail_friend.email.value.lastIndexOf(".")+1;
	 	len=document.mail_friend.email.value.length;
			if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3)) 
			{
 			}
 			else {
 			errmsg.push("- Vul aub een geldig email adres in");
 				}
		}
	if (document.mail_friend.name.value == "")
		{
		errmsg.push("- Vul aub uw naam in");
		}
	if (document.mail_friend.email_friend.value == "") 
	{
		errmsg.push("- Vul aub het email adres van uw vriend in");
		}
	if (document.mail_friend.email_friend.value != "")
		{
		i=document.mail_friend.email_friend.value.indexOf("@");
	 	j=document.mail_friend.email_friend.value.indexOf(".",i);
	 	k=document.mail_friend.email_friend.value.indexOf(",");
	 	kk=document.mail_friend.email_friend.value.indexOf(" ");
	 	jj=document.mail_friend.email_friend.value.lastIndexOf(".")+1;
	 	len=document.mail_friend.email_friend.value.length;
			if ((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3)) 
			{
 			}
 			else {
 			errmsg.push("- Vul aub een geldig email adres in voor uw vriend");
 				}
		}
	if (document.mail_friend.name_friend.value == "")
		{
		errmsg.push("- Vul aub de naam van uw vriend in");
		}
	if (errmsg.length > 0) 
		{
		alert(("Foutmelding:\n") + errmsg.join(",\n") + ("."));
		return false
		}
	else
		{
		return true;
		}
	}

