   function submitForm(currentForm) {
//function to run checks on form before submission
//first check that key fields are completed
   if (checkComplete(currentForm)) {
	//then check with the user their details are correct
	if (confirmDetails(currentForm)) {
		//if all ok, then form can be submitted
		//set up timer to run the thanks function
		//and then return true so the form will be submitted
		setTimeout('thanks()',5000);
		return true; }
	}
		//in any other case set return to false so form won't submit
	return false;
   }

function checkComplete(currentForm) {
	//function to check the form is complete
	//create a variable for composing a message
	message = " e poi selezionare 'Invio' per spedire questo modulo.";
	//check the visitor has entered their name
	if (currentForm.nome.value==""){
		alert("Inserire nome" + message);
		currentForm.nome.focus();
		return false; }
		
	if (currentForm.comune.value==""){
		alert("Inserire comune" + message);
		currentForm.nome.focus();
		return false; }	
	if (currentForm.email.value==""){
		alert("Inserire e-mail" + message);
		currentForm.email.focus();
		return false; }
	
	//if all is ok, then submission can continue
		return true;}

function confirmDetails(currentForm) {
	//confirm with the visitor that the details are correct
	//create a variable for composing the message
	newLine = "\n"
	confirmMessage = "Prego controllare i dati:" + newLine;
//	confirmMessage = "Please check your entries:" + newLine;
//	confirmMessage = "Please check your entries:" + newLine;
//	confirmMessage = "Please check your entries:" + newLine;
	//display the message to the user to check details
	confirmMessage += "\nI dati inseriti sono corretti ?";
//	confirmMessage += "\nAre these details correct?";
//	confirmMessage += "\nAre these details correct?";
//	confirmMessage += "\nAre these details correct?";
	//return true to calling function if submission should continue 
	if (confirm(confirmMessage)) {
		 return true;}
	//return false to calling function if submission should not continue 
	return false; }

function thanks() {
	//location.href="Regthanks.htm"; 
	}