<!--

String.prototype.isValidEmail = function(){
	return !!this.match(/^([a-zA-Z0-9\_\-]{1}([a-zA-Z0-9\.\-\_]*)[a-zA-Z0-9\_-]{1})@([a-zA-Z0-9]{1}([a-zA-Z0-9\.\-\_]*)[a-zA-Z0-9]{1})\.([a-zA-Z]{2,4})$/)
}


function validateName(entered, alertbox){
if (entered.value==null || entered.value=="" || entered.value=='\n' ){
 alert(alertbox);
 return false;}
return true;
} 

function formvalidation(thisform){
if 	(!thisform.quiz1_1.checked && !thisform.quiz1_2.checked && !thisform.quiz1_3.checked){
	alert("You have to fill in an answer to the first question");
	return false;
}
else if	(!thisform.quiz2_1.checked && !thisform.quiz2_2.checked && !thisform.quiz2_3.checked){
	alert("You have to fill in an answer to the second question");
	return false;
}
else if (validateName(thisform.firstname,"You have to fill in your first name!")==false){
	thisform.firstname.focus();
	return false;
}
else if (validateName(thisform.lastname,"You have to fill in your last name!")==false){
	thisform.lastname.focus();
	return false;
}
else if (validateName(thisform.streetadress,"You have to fill in your street adress!")==false){
	thisform.streetadress.focus();
	return false;
}
else if (validateName(thisform.postalcode,"You have to fill in your postal code!")==false){
	thisform.postalcode.focus();
	return false;
}
else if (validateName(thisform.country,"You have to fill what country you are from!")==false){
	thisform.country.focus();
	return false;
}
else if (validateName(thisform.email,"You have to fill in your e-mailadress")==false){
	thisform.email.focus();
	return false;
}

else {
	if(!document.quiz2004.email.value.isValidEmail()) {

		alert('You have to fill in a valid email!');
		document.quiz2004.email.focus();
		return false;

	}
	return true;
}
}


function guestbookvalidation(form, name, message)
{
	if (!validateName(form[""+name+""],"You have to fill in your name!"))
	{
		form[""+name+""].focus();
		return false;
	}
	else if (!validateName(form[""+message+""],"You have to write a message!"))
	{
		form[""+message+""].focus();
		return false;
	}
	else
	{
		//Nada
	}
}
//-->