
   
   function PassoUno()
    {
      var nom = document.modulo.nome.value;
      var accom = document.modulo.sistemazione.options[document.modulo.sistemazione.selectedIndex].value;
	  var tratta = document.modulo.trattamento.options[document.modulo.trattamento.selectedIndex].value;
	  
	  var data_arr = document.modulo.day.options[document.modulo.day.selectedIndex].value+" / ";
	  data_arr += document.modulo.month.options[document.modulo.month.selectedIndex].value+" / ";
	  data_arr += document.modulo.year.options[document.modulo.year.selectedIndex].value;
	 document.modulo.data_arrivo.value=data_arr;
	 
	  var data_par = document.modulo.day2.options[document.modulo.day2.selectedIndex].value+" / ";
	  data_par += document.modulo.month2.options[document.modulo.month2.selectedIndex].value+" / ";
	  data_par += document.modulo.year2.options[document.modulo.year2.selectedIndex].value;
	  document.modulo.data_partenza.value=data_par;
	  
      if (nom == "" || nom == "undefined" || nom == "nome e cognome" )
      {
      document.modulo.nome.focus();
	 
      }
      else if (accom == "sistemazione...")
      {
          document.modulo.sistemazione.focus();
      }
      else
      {
		  
         document.getElementById('passo_uno').style.visibility = "hidden";
        document.getElementById('passo_due').style.visibility = "visible";
      }
    }
    function PassoDue()
    {
		
      var adulti = document.modulo.adulti.value;
      var bambini = document.modulo.bambini.value;
	  var eta = document.modulo.eta.value;
      if (adulti == "" || adulti == "undefined" || adulti.charAt(0) == " ")
      {
		   alert("prego inserisca numer adulti");
        document.modulo.adulti.focus();
      }
      else
      {
		  
        document.getElementById('passo_due').style.visibility = "hidden";
        document.getElementById('passo_tre').style.visibility = "visible";
      }
    }
    function Conferma()
    {
      var email = document.modulo.email.value;
      var cellulare = document.modulo.cellulare.value;
      var re = /^([a-z0-9_\.\-])+\@(([a-z0-9\-]{2,})+\.)+([a-z0-9]{2,})+$/;
      if (re.test(email) == false)
      {
        alert("prego inserisca un recapito mail");
      }
      else if (isNaN(cellulare) || cellulare == "")
      {
        alert("prego inserisca un numero di telefono");
      }
      else
      {
        var messaggio = "";
        messaggio += "<table width=\"100%\"><tr><td>Riepilogo dei dati:</td><td></td></tr><tr>";
		messaggio += "<td>&nbsp;</td><td><a href=\"#\" onclick=\"back_uno()\">[modifica nominativo e date ]</a></td></tr><tr>";
        messaggio += "<td >nome: </td><td><strong>" + document.modulo.nome.value + "</strong></td></tr><tr>";
        messaggio += "<td>sistemazione: </td><td><strong>" + document.modulo.sistemazione.value + "</strong></td></tr><tr>";
		messaggio += "<td>trattamento: </td><td><strong>" + document.modulo.trattamento.value + "</strong></td></tr><tr>";
		messaggio += "<td>data di arrivo: </td><td><strong>" + document.modulo.data_arrivo.value + "</strong></td></tr><tr>";
        messaggio += "<td>data di partenza: </td><td><strong>" + document.modulo.data_partenza.value + "</strong></td></tr><tr>";
		messaggio += "<td> </td><td> </td></tr><tr>";
		messaggio += "<td>&nbsp;</td><td><a href=\"#\" onclick=\"back_due()\">[ correggi numero ospiti ]</a></td></tr><tr>";
        messaggio += "<td>numero adulti: </td><td><strong>" + document.modulo.adulti.value + "</strong></td></tr><tr>";
        messaggio += "<td>numero bambini: </td><td><strong>" + document.modulo.bambini.value + "</strong></td></tr><tr>";
		messaggio += "<td>di anni: </td><td>"+document.modulo.eta.value+"</td></tr><tr>";
		messaggio += "<td>&nbsp;</td><td><a href=\"#\" onclick=\"back_tre()\">[ correggi mail e telefono ]</a></td></tr><tr>";
        messaggio += "<td>email: </td><td><strong>" + email + "</strong></td></tr><tr>";
        messaggio += "<td>numero di telefono: </td><td><strong>" + cellulare + "</strong></td></tr><tr>";
		messaggio += "<td> </td><td> </td></tr><tr>";
		messaggio += "<td></td><td  align=\"right\"><a  name=\"submit\" type=\"button\" onclick=\"send();\" class=\"send\">richiedi disponibilità</a></td></tr></table>";
        document.getElementById('log').innerHTML=messaggio;
	    document.getElementById('log').style.display = "block";
   
      }
	 
    }
		function back_tre(){
	  document.getElementById('passo_uno').style.visibility = "hidden";
        document.getElementById('passo_due').style.visibility = "hidden";
		document.getElementById('passo_tre').style.visibility = "visible";
		document.getElementById('log').style.display = "none";
	}
	function back_due(){
	  document.getElementById('passo_due').style.visibility = "visible";
        document.getElementById('passo_tre').style.visibility = "hidden";
		document.getElementById('passo_uno').style.visibility = "hidden";
		document.getElementById('log').style.display = "none";
	}
	function back_uno(){
	  document.getElementById('passo_uno').style.visibility = "visible";
        document.getElementById('passo_due').style.visibility = "hidden";
		document.getElementById('passo_tre').style.visibility = "hidden";
		document.getElementById('log').style.display = "none";
	}
	 function send(){
		document.modulo.method = "POST";
        document.modulo.action = "mail.php";
        document.modulo.submit();
	  }
