// JavaScript Document
  function Modulo(lng) {
	testi = new Array();
	testi["it"]= new Array("Campo \"Nome e Cognome\" obbligatorio.","Inserire un indirizzo email corretto.", "Il campo \"Cellulare\" obbligatorio, deve essere numerico e composto da almeno 10 cifre.","Campo \"Data di arrivo\" obbligatorio.","Campo \"Data di partenza\" obbligatorio.");
	testi["en"]= new Array ("Field \"Name and Surname\" compulsory.","Enter a right email address", "The Field \"Mobile\" is compulsory, it must be 9 number.","Field \"Arrival\" compulsory.","Field \"Departure\" compulsory.");
     // Variabili associate ai campi del modulo
     var nome = document.modulo.nome.value;
     var cell = document.modulo.cell.value;
	 var dal = document.modulo.dal.value;
	 var al = document.modulo.al.value;
     var email = document.modulo.email.value;
     // Espressione regolare dell'email
     var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
        //Effettua il controllo sul campo NOME
        if ((nome == "") || (nome == "undefined")) {
           alert(testi[lng][0]);
           document.modulo.nome.focus();
           return false;
        }
        else if ((email == "undefined" || email == "") || (email!=="" && !email_reg_exp.test(email))) {
           alert(testi[lng][1]);
           document.modulo.email.select();
           return false;
        }
		//Effettua il controllo sul campo cellulare
        else if ((isNaN(cell)) || (cell == "") || (cell == "undefined") || (cell.length<10)) {
           alert(testi[lng][2]);
           document.modulo.cell.value = "";
           document.modulo.cell.focus();
           return false;
        }
		//Effettua il controllo sul campo Dal
        else if ((dal == "") || (dal == "undefined")) {
           alert(testi[lng][3]);
           document.modulo.dal.value = "";
           document.modulo.dal.focus();
           return false;
        }
		//Effettua il controllo sul campo al
        else if ((al == "") || (al == "undefined")) {
           alert(testi[lng][4]);
           document.modulo.al.value = "";
           document.modulo.al.focus();
           return false;
        }
        
        //INVIA IL MODULO
        else {
           document.modulo.action = "#";
           document.modulo.submit();
        }
  }


