function controlla(form) {
		//if(!controlla_hotel(form)) { return false; }
		//if(!controlla_nome(form)) { return false; }
		//if(!controlla_cognome(form)) { return false; }
		//if(!controlla_telefono(form)) { return false; }
		if(!controlla_email(form)) { return false; }
		//if(!controlla_arrivo(form)) { return false; }
		//if(!controlla_partenza(form)) { return false; }
		//if(!controlla_validita(form)) { return false; }
		//if(!controlla_check(form)) { return false; }
		return true;
	}
	function controlla_hotel(form) {
	  if (document.getElementById('Hotel_scelto').value=="") {
		alert("Devi selezionare l'hotel!");
		return false;
	  }
	return true;
	}
	function controlla_nome(form) {
	  if (document.getElementById('nome').value=="") {
		alert("Devi inserire il nome!");
		document.getElementById('nome').focus();
		document.getElementById('nome').select();
		return false;
	  }
	return true;
	}
	function controlla_cognome(form) {
	  if (document.getElementById('cognome').value=="") {
		alert("Devi inserire il cognome!");
		document.getElementById('cognome').focus();
		document.getElementById('cognome').select();
		return false;
	  }
	return true;
	}
	function controlla_telefono(form) {
	  if (document.getElementById('telefono').value=="") {
		alert("Devi inserire il telefono!");
		document.getElementById('telefono').focus();
		document.getElementById('telefono').select();
		return false;
	  }
	return true;
	}
	function controlla_email(form) {
	   if (document.getElementById('email').value=="") {
		alert("Devi inserire l'e-mail!");
		return false;
	  }
	  else
	  {
		  if (document.getElementById('email').value!="")
		  {
			var filter =/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
			if(!filter.test(document.getElementById('email').value)){
			alert("Inserire una e-mail valida");
			document.getElementById('email').focus();
			document.getElementById('email').select();
			return false;
			}
		  }
	  }
	return true;
	}
	
	function controlla_arrivo(form) {
	  if (document.getElementById('dal').value=="")
	  {     
	    var espressione =/^(0[1-9]|[1-2]\d|3[0-1])\/(0[1-9]|1[0-2])\/([0-9][0-9][0-9][0-9])$/;    
		//var espressione = /([0-9]{2})(-)([0-9]{2})+(-)([0-9]{4})/;

	    if (!espressione.test(document.getElementById('dal').value))
	    {
	    alert("La data di arrivo ha un formato sbagliato. Inserire la data nel formato gg/mm/aaaa.");
		document.getElementById('dal').focus();
		document.getElementById('dal').select();
		return false;
	    }
	  }
	return true;
	}
	
	function controlla_partenza(form) {
	  if (document.getElementById('al').value!="") 
	  {     
	    var espressione =/^(0[1-9]|[1-2]\d|3[0-1])\/(0[1-9]|1[0-2])\/([0-9][0-9][0-9][0-9])$/;    
		//var espressione = /([0-9]{2})(-)([0-9]{2})+(-)([0-9]{4})/;

	    if (!espressione.test(document.getElementById('al').value))
	    {
	    alert("La data di partenza ha un formato sbagliato. Inserire la data nel formato gg/mm/aaaa.");
		document.getElementById('al').focus();
		document.getElementById('al').select();
		return false;
	    }
	  }
	return true;
	}
	
	function controlla_validita() {
	var Da=document.getElementById('dal').value;
	v_Domanda = Da.split("/");
	var Da = new Date(v_Domanda[2],v_Domanda[1]-1,v_Domanda[0]);
	var A=document.getElementById('al').value;
	v_Domanda = A.split("/");
	var A = new Date(v_Domanda[2],v_Domanda[1]-1,v_Domanda[0]);
	if(A<=Da) {
		alert("La data di partenza non puņ essere inferiore o uguale a quella di arrivo!");
		document.getElementById('dal').focus();
		document.getElementById('dal').select();
		return false;
	}
	return true;
	}
	
	function controlla_check(form) {
	  if (!document.getElementById('Consenso_Trattamento_Dati').checked) {
		alert("Devi accettare i termini e le condizioni!");
		return false;
	  }
	return true;
	}