function validate_form(t_form){
var err=false;
var radioSelected=false;
var msg="";
var colOK = "";
var colERR = "#FF6600";
var Act1 = document.forms.pform.activity;
var YachtSel = document.forms.pform.yacht;
var HolType = Act1.options[Act1.selectedIndex].text;
var YachtType = YachtSel.options[YachtSel.selectedIndex].text;

/* Skipper Details*/
	if (t_form.skipname.value==""){
		msg+="- Skipper per favore.\n";
		err=true;
		t_form.skipname.style.backgroundColor=colERR;
		t_form.skipname.focus();
	}
	else t_form.skipname.style.backgroundColor=colOK;

	if (t_form.dob.value==""){
		msg+="- Data di nascita per favore.\n";
		err=true;
		t_form.dob.style.backgroundColor=colERR;
		t_form.dob.focus();
	}
	else t_form.dob.style.backgroundColor=colOK;
	
	if (t_form.place.value==""){
		msg+="- Luogo di nascita per favore.\n";
		err=true;
		t_form.place.style.backgroundColor=colERR;
		t_form.place.focus();
	}
	else t_form.place.style.backgroundColor=colOK;

	if (t_form.nationality.value==""){
		msg+="- Nazionalità per favore.\n";
		err=true;
		t_form.nationality.style.backgroundColor=colERR;
		t_form.nationality.focus();
	}
	else t_form.nationality.style.backgroundColor=colOK;
		
	if (t_form.passport.value==""){
		msg+="- Passaporto num per favore.\n";
		err=true;
		t_form.passport.style.backgroundColor=colERR;
		t_form.passport.focus();
	}
	else t_form.passport.style.backgroundColor=colOK;
	
	if (t_form.address.value==""){
		msg+="- Indirizzo per favore.\n";
		err=true;
		t_form.address.style.backgroundColor=colERR;
		t_form.address.focus();
	}
	else t_form.address.style.backgroundColor=colOK;
	
	if (t_form.postcode.value==""){
		msg+="- Codice postale per favore.\n";
		err=true;
		t_form.postcode.style.backgroundColor=colERR;
		t_form.postcode.focus();
	}
	else t_form.postcode.style.backgroundColor=colOK;
	
	if (t_form.email.value==""){
		msg+="- E-mail per favore.\n";
		err=true;
		t_form.email.style.backgroundColor=colERR;
	}
	else{
	//t_form.email.style.backgroundColor=colOK;
		if (!isEmail(t_form.email.value)){
			msg += "- E-mail inserito in modo errato,  e.g. nome@ISP_nome.it\n";
			err = true;
			t_form.email.style.backgroundColor=colERR;
		}
		else t_form.email.style.backgroundColor=colOK;
	}

	if (t_form.reconfirm_email.value==""){
		msg+="- Riconferma E-mail per favore.\n";
		err=true;
		t_form.reconfirm_email.style.backgroundColor=colERR;
	}
	else{
		//t_form.reconfirm_email.style.backgroundColor=colOK;
		if (!isEmail(t_form.reconfirm_email.value)){
			msg += "- Riconferma e-mail inserito in modo errato,  e.g. nome@ISP_nome.it\n";
			err = true;
			t_form.reconfirm_email.style.backgroundColor=colERR;
		}
		else t_form.reconfirm_email.style.backgroundColor=colOK;
	}	
	
	if (t_form.email.value!=t_form.reconfirm_email.value){
		msg+="- E-mail e Riconferma E-mail non stanno corrispondendo.\n";
		err=true;
		t_form.email.style.backgroundColor=colERR;
		t_form.reconfirm_email.style.backgroundColor=colERR;
	}
	else{
		t_form.email.style.backgroundColor=colOK;
		t_form.reconfirm_email.style.backgroundColor=colOK;
	}
		
	if (t_form.tel.value==""){
		msg+="- Telephono per favore.\n";
		err=true;
		t_form.tel.style.backgroundColor=colERR;
		t_form.tel.focus();
	}
	else t_form.tel.style.backgroundColor=colOK;

	if (t_form.Sail_Experience.value==""){
		msg+="- Esperienza dello Skipper per favore.\n";
		err=true;
		t_form.Sail_Experience.style.backgroundColor=colERR;
		t_form.Sail_Experience.focus();
	}
	else t_form.Sail_Experience.style.backgroundColor=colOK;

	if (t_form.country.value==""){
		msg += "- Destinazione per favore.\n";
		err=true;
		t_form.country.style.backgroundColor=colERR;
	}
	else{
		t_form.country.style.backgroundColor=colOK;
	}

	if (HolType=="Tipo di vacanza") {
		msg+= "- Tipo di vacanza per favore.\n";
		err=true;
		Act1.style.backgroundColor=colERR;
	}
	else{
		Act1.style.backgroundColor=colOK;
	}
	
	if ((YachtType=="Barca richiesta")||(YachtType=="Catamarani richiesta")||(YachtType=="Imbarcazione a motore richiesta")){
		msg+= "- Barca richiesta per favore.\n";
		err=true;
		YachtSel.style.backgroundColor=colERR;
	}
	else{
		YachtSel.style.backgroundColor=colOK;
	}
	
	if (t_form.NoofCrew.value==""){
		msg+="- Numero di gente sulla barca per favore.\n";
		err=true;
		t_form.NoofCrew.style.backgroundColor=colERR;
	}
	else{
		t_form.NoofCrew.style.backgroundColor=colOK;
	}
		
	if ((t_form.startday.value=="")||(t_form.startmonth.value=="")||(t_form.startyear.value=="")){
		msg+="- Data di arrivo per favore.\n";
		err=true;
		t_form.startday.style.backgroundColor=colERR;
		t_form.startmonth.style.backgroundColor=colERR;
		t_form.startyear.style.backgroundColor=colERR;
	}
	else{
		t_form.startday.style.backgroundColor=colOK;
		t_form.startmonth.style.backgroundColor=colOK;
		t_form.startyear.style.backgroundColor=colOK;
	}
	
	if (t_form.weeks.value==""){
		msg+="- Numero di settimane per favore.\n";
		err=true;
		t_form.weeks.style.backgroundColor=colERR;
	}
	else{
		t_form.weeks.style.backgroundColor=colOK;
	}
	
	/*Crew - If name specified, check that other details provided*/
	//1
	if (t_form.crew1.value!=""){
		if (t_form.nationality1.value==""){
			msg+="- Partecipanti 1 - Nazionalità per favore.\n";
			err=true;
			t_form.nationality1.style.backgroundColor=colERR;
		}
		else t_form.nationality1.style.backgroundColor=colOK;
		
		if (t_form.crewage1.value==""){
			msg+="- Partecipanti 1 - Data di nascita per favore.\n";
			err=true;
			t_form.crewage1.style.backgroundColor=colERR;
		}
		else t_form.crewage1.style.backgroundColor=colOK;		

		if (t_form.place1.value==""){
			msg+="- Partecipanti 1 - Luogo di nascita per favore.\n";
			err=true;
			t_form.place1.style.backgroundColor=colERR;
		}
		else t_form.place1.style.backgroundColor=colOK;	
		
		if (t_form.Passport1.value==""){
			msg+="- Partecipanti 1 - Passaporto Num per favore.\n";
			err=true;
			t_form.Passport1.style.backgroundColor=colERR;
		}
		else t_form.Passport1.style.backgroundColor=colOK;	
	}

	//2
	if (t_form.crew2.value!=""){
		if (t_form.nationality2.value==""){
			msg+="- Partecipanti 2 - Nazionalità per favore\n";
			err=true;
			t_form.nationality2.style.backgroundColor=colERR;
		}
		else t_form.nationality2.style.backgroundColor=colOK;
		
		if (t_form.crewage2.value==""){
			msg+="- Partecipanti 2 - Data di nascita per favore.\n";
			err=true;
			t_form.crewage2.style.backgroundColor=colERR;
		}
		else t_form.crewage2.style.backgroundColor=colOK;		

		if (t_form.place2.value==""){
			msg+="- Partecipanti 2 - Luogo di nascita per favore.\n";
			err=true;
			t_form.place2.style.backgroundColor=colERR;
		}
		else t_form.place2.style.backgroundColor=colOK;	
		
		if (t_form.Passport2.value==""){
			msg+="- Partecipanti 2 - Passaporto Num per favore.\n";
			err=true;
			t_form.Passport2.style.backgroundColor=colERR;
		}
		else t_form.Passport2.style.backgroundColor=colOK;	
	}
	
	//3
	if (t_form.crew3.value!=""){
		if (t_form.nationality3.value==""){
			msg+="- Partecipanti 3 - Nazionalità per favore\n";
			err=true;
			t_form.nationality3.style.backgroundColor=colERR;
		}
		else t_form.nationality3.style.backgroundColor=colOK;
		
		if (t_form.crewage3.value==""){
			msg+="- Partecipanti 3 - Data di nascita per favore.\n";
			err=true;
			t_form.crewage3.style.backgroundColor=colERR;
		}
		else t_form.crewage3.style.backgroundColor=colOK;		

		if (t_form.place3.value==""){
			msg+="- Partecipanti 3 - Luogo di nascita per favore.\n";
			err=true;
			t_form.place3.style.backgroundColor=colERR;
		}
		else t_form.place3.style.backgroundColor=colOK;	
		
		if (t_form.Passport3.value==""){
			msg+="- Partecipanti 3 - Passaporto Num per favore.\n";
			err=true;
			t_form.Passport3.style.backgroundColor=colERR;
		}
		else t_form.Passport3.style.backgroundColor=colOK;	
	}	
	
	//4
	if (t_form.crew4.value!=""){
		if (t_form.nationality4.value==""){
			msg+="- Partecipanti 4 - Nazionalità per favore.\n";
			err=true;
			t_form.nationality4.style.backgroundColor=colERR;
		}
		else t_form.nationality4.style.backgroundColor=colOK;
		
		if (t_form.crewage4.value==""){
			msg+="- Partecipanti 4 - Data di nascita per favore.\n";
			err=true;
			t_form.crewage4.style.backgroundColor=colERR;
		}
		else t_form.crewage4.style.backgroundColor=colOK;		

		if (t_form.place4.value==""){
			msg+="- Partecipanti 4 - Luogo di nascita per favore.\n";
			err=true;
			t_form.place4.style.backgroundColor=colERR;
		}
		else t_form.place4.style.backgroundColor=colOK;	
		
		if (t_form.Passport4.value==""){
			msg+="- Partecipanti 4 - Passaporto Num per favore.\n";
			err=true;
			t_form.Passport4.style.backgroundColor=colERR;
		}
		else t_form.Passport4.style.backgroundColor=colOK;	
	}		
	//5
	if (t_form.crew5.value!=""){
		if (t_form.nationality5.value==""){
			msg+="- Partecipanti 5 - Nazionalità per favore.\n";
			err=true;
			t_form.nationality5.style.backgroundColor=colERR;
		}
		else t_form.nationality5.style.backgroundColor=colOK;
		
		if (t_form.crewage5.value==""){
			msg+="- Partecipanti 5 - Data di nascita per favore.\n";
			err=true;
			t_form.crewage5.style.backgroundColor=colERR;
		}
		else t_form.crewage5.style.backgroundColor=colOK;		

		if (t_form.place5.value==""){
			msg+="- Partecipanti 5 - Luogo di nascita per favore.\n";
			err=true;
			t_form.place5.style.backgroundColor=colERR;
		}
		else t_form.place5.style.backgroundColor=colOK;	
		
		if (t_form.Passport5.value==""){
			msg+="- Partecipanti 5 - Passaporto Num per favore.\n";
			err=true;
			t_form.Passport5.style.backgroundColor=colERR;
		}
		else t_form.Passport5.style.backgroundColor=colOK;	
	}
	//6
	if (t_form.crew6.value!=""){
		if (t_form.nationality6.value==""){
			msg+="- Partecipanti 6 - Nazionalità per favore.\n";
			err=true;
			t_form.nationality6.style.backgroundColor=colERR;
		}
		else t_form.nationality6.style.backgroundColor=colOK;
		
		if (t_form.crewage6.value==""){
			msg+="- Partecipanti 6 - Data di nascita per favore.\n";
			err=true;
			t_form.crewage6.style.backgroundColor=colERR;
		}
		else t_form.crewage6.style.backgroundColor=colOK;		

		if (t_form.place6.value==""){
			msg+="- Partecipanti 6 - Luogo di nascita per favore.\n";
			err=true;
			t_form.place6.style.backgroundColor=colERR;
		}
		else t_form.place6.style.backgroundColor=colOK;	
		
		if (t_form.Passport6.value==""){
			msg+="- Partecipanti 6 - Passaporto Num per favore.\n";
			err=true;
			t_form.Passport6.style.backgroundColor=colERR;
		}
		else t_form.Passport6.style.backgroundColor=colOK;	
	}
	if (t_form.crew7.value!=""){
		if (t_form.nationality7.value==""){
			msg+="- Partecipanti 7 - Nazionalità per favore.\n";
			err=true;
			t_form.nationality7.style.backgroundColor=colERR;
		}
		else t_form.nationality7.style.backgroundColor=colOK;
		
		if (t_form.crewage7.value==""){
			msg+="- Partecipanti 7 - Data di nascita per favore.\n";
			err=true;
			t_form.crewage7.style.backgroundColor=colERR;
		}
		else t_form.crewage7.style.backgroundColor=colOK;		

		if (t_form.place7.value==""){
			msg+="- Partecipanti 7 - Luogo di nascita per favore.\n";
			err=true;
			t_form.place7.style.backgroundColor=colERR;
		}
		else t_form.place7.style.backgroundColor=colOK;	
		
		if (t_form.Passport7.value==""){
			msg+="- Partecipanti 7 - Passaporto Num per favore.\n";
			err=true;
			t_form.Passport7.style.backgroundColor=colERR;
		}
		else t_form.Passport7.style.backgroundColor=colOK;	
	}	
	
	/* Terms Conditions*/
	if (!t_form.terms_conditions.checked){
		msg+="*** La preghiamo di barrare la casella di lettura e accettazione delle condizioni di noleggio ***\n";
		err=true;
	}
	
	if (err){
		alert('La preghiamo di verificare che le seguenti informazioni siano state correttamente fornite.\n' + msg);
		return false;
	}
	return true;
}
