      window.onload=function(){
	   document.getElementById('log').style.display ="none";
   }
   
   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 == "name and surname" )
      {
      document.modulo.nome.focus();
	 
      }
      else if (accom == "accomodation...")
      {
          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) == " ")
      {
        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("please, insert a correct mail");
      }
      else if (isNaN(cellulare) || cellulare == "")
      {
        alert("please, insert your telephone number");
      }
      else
      {
        var messaggio = "";
        messaggio += "<table width=\"100%\"><tr><td>Summary data:</td><td></td></tr><tr>";
		messaggio += "<td>&nbsp;</td><td><a href=\"#\" onclick=\"back_uno()\">[modify name or date ]</a></td></tr><tr>";
        messaggio += "<td >name: </td><td><strong>" + document.modulo.nome.value + "</strong></td></tr><tr>";
        messaggio += "<td>accomodation: </td><td><strong>" + document.modulo.sistemazione.value + "</strong></td></tr><tr>";
		messaggio += "<td>boarding: </td><td><strong>" + document.modulo.trattamento.value + "</strong></td></tr><tr>";
		messaggio += "<td>arrival date: </td><td><strong>" + document.modulo.data_arrivo.value + "</strong></td></tr><tr>";
        messaggio += "<td>depart date: </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()\">[ modify number of guests ]</a></td></tr><tr>";
        messaggio += "<td>number of adults: </td><td><strong>" + document.modulo.adulti.value + "</strong></td></tr><tr>";
        messaggio += "<td>number of children: </td><td><strong>" + document.modulo.bambini.value + "</strong></td></tr><tr>";
		messaggio += "<td>age of children: </td><td>"+document.modulo.eta.value+"</td></tr><tr>";
		messaggio += "<td>&nbsp;</td><td><a href=\"#\" onclick=\"back_tre()\">[ modify mail or telephone ]</a></td></tr><tr>";
        messaggio += "<td>email: </td><td><strong>" + email + "</strong></td></tr><tr>";
        messaggio += "<td>telephone: </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\">request availability</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();
	  }
	  
