// JavaScript Document
 
function CampiObbligatoriContatti(){
		Form = document.forms["formcontatti"];
		var Nome =Form.nome.value;
		var Cognome =Form.cognome.value;
		var Email=Form.email.value;
		var Phone=Form.tel.value;
		var Message=Form.messaggio.value;
		var Code=Form.security_code.value;
		
		if ((Nome == "") || (Nome == "undefined")) {
   			alert("Il campo Nome e' obbligatorio.");
   			return false;
		} 
		else if ((Cognome == "") || (Cognome == "undefined")) {
   			alert("Il campo Cognome e' obbligatorio.");
   			return false;
		}
		else if ((Email == "") || (Email == "undefined")) {
   			alert("Il campo Email e' obbligatorio.");
   			return false;
		} 
		else if ((Phone == "") || (Phone == "undefined")) {
   			alert("Il campo Telefono e' obbligatorio.");
   			return false;
		} 
		else if ((Message == "") || (Message == "undefined")) {
   			alert("Il Messaggio e' obbligatorio.");
   			return false;
		}
		else if ((Code == "") || (Code == "undefined")) {
   			alert("Il Codice di Sicurezza e' obbligatorio.");
   			return false;
		}
		else {
			Form.submit();
		}
	}
	
	
	
function CampiObbligatoriReport(){
		Form = document.forms["formcontatti"];
		var Nome=Form.nome.value;
		var Cognome=Form.cognome.value;
		var Email=Form.email.value;
		var Phone=Form.tel.value;
		var Azienda=Form.azienda.value;
		var Code=Form.security_code.value;
		
		if ((Nome == "") || (Nome == "undefined")) {
   			alert("Il campo NOME e' obbligatorio.");
   			return false;
		} 
		else if ((Cognome == "") || (Cognome == "undefined")) {
   			alert("Il campo COGNOME e' obbligatorio.");
   			return false;
		}
		else if ((Azienda == "") || (Azienda == "undefined")) {
   			alert("Il campo AZIENDA e' obbligatorio.");
   			return false;
		}
		else if ((Email == "") || (Email == "undefined")) {
   			alert("Il campo EMAIL e' obbligatorio.");
   			return false;
		} 
		else if ((Phone == "") || (Phone == "undefined")) {
   			alert("Il campo TELEFONO e' obbligatorio.");
   			return false;
		} 
		else if ((Code == "") || (Code == "undefined")) {
   			alert("Il Codice di Sicurezza e' obbligatorio.");
   			return false;
		}
		else {
			Form.submit();
		}
	}
	
function CampiObbligatoriTuaricerca(){
		Form = document.forms["formcontatti"];
		var Titolo=Form.titolo.value;
		var Attivita=Form.attivita.value;
		var Studio=Form.studio.value;
		var Eta=Form.eta.value;
		var Profilo=Form.profilo.value;
		var Contratto=Form.contratto.value;
		var Range=Form.range.value;
		var Code=Form.security_code.value;
		
		
		if ((Titolo == "") || (Titolo == "undefined")) {
   			alert("Il campo TITOLO DELLA POSIZIONE e' obbligatorio.");
   			return false;
		}
		else if ((Attivita == "") || (Attivita == "undefined")) {
   			alert("Il campo ATTIVITA' ASSEGNATE e' obbligatorio.");
   			return false;
		}
		else if ((Studio == "") || (Studio == "undefined")) {
   			alert("Il campo  TITOLO DI STUDIO E FORMAZIONE e' obbligatorio.");
   			return false;
		}
		else if ((Eta == "") || (Eta == "undefined")) {
   			alert("Il campo ETA' e' obbligatorio.");
   			return false;
		}
		else if ((Profilo == "") || (Profilo == "undefined")) {
   			alert("Il campo PROFILO DEL CANDIDATO e' obbligatorio.");
   			return false;
		}
		else if ((Contratto == "") || (Contratto == "undefined")) {
   			alert("Il campo CONTRATTO DI INSERIMENTO e' obbligatorio.");
   			return false;
		}
		else if ((Range == "") || (Range == "undefined")) {
   			alert("Il campo RANGE e' obbligatorio.");
   			return false;
		}
		else if ((Code == "") || (Code == "undefined")) {
   			alert("Il Codice di Sicurezza e' obbligatorio.");
   			return false;
		}
		else {
			Form.submit();
		}
	}
	
	function InviaCv(){
		Form = document.forms["formcontatti"];
		var Nome =Form.nome.value;
		var Cognome =Form.cognome.value;
		var Email=Form.email.value;
		var Phone=Form.tel.value;
		var Code=Form.security_code.value;
		
		if ((Nome == "") || (Nome == "undefined")) {
   			alert("Il campo Nome e' obbligatorio.");
   			return false;
		} 
		else if ((Cognome == "") || (Cognome == "undefined")) {
   			alert("Il campo Cognome e' obbligatorio.");
   			return false;
		}
		else if ((Email == "") || (Email == "undefined")) {
   			alert("Il campo Email e' obbligatorio.");
   			return false;
		} 
		else if ((Phone == "") || (Phone == "undefined")) {
   			alert("Il campo Telefono e' obbligatorio.");
   			return false;
		} 
		else if ((Code == "") || (Code == "undefined")) {
   			alert("Il Codice di Sicurezza e' obbligatorio.");
   			return false;
		}
		else {
			Form.submit();
		}
	}

	
	
	function PopupContattiSelezione(){
		Form = document.forms["formcontatti"];
		var Nome =Form.nome.value;
		var Cognome =Form.cognome.value;
		var Email=Form.email.value;
		var Phone=Form.tel.value;
		var Message=Form.messaggio.value;
		
		if ((Nome == "") || (Nome == "undefined")) {
   			alert("Il campo Nome e' obbligatorio.");
   			return false;
		} 
		else if ((Cognome == "") || (Cognome == "undefined")) {
   			alert("Il campo Cognome e' obbligatorio.");
   			return false;
		}
		else if ((Email == "") || (Email == "undefined")) {
   			alert("Il campo Email e' obbligatorio.");
   			return false;
		} 
		else if ((Phone == "") || (Phone == "undefined")) {
   			alert("Il campo Telefono e' obbligatorio.");
   			return false;
		} 
		else if ((Message == "") || (Message == "undefined")) {
   			alert("Il Messaggio e' obbligatorio.");
   			return false;
		}
		else {
			
			$.post("../ajax/contatti_selezione_2.php", $("#formcontatti").serialize(),
			function(data){
				
				//$(document).trigger('close.facebox');
				jQuery.facebox(data);
			}
			);
			
		}
	}
	
	function PopupContattiFondi(){
		Form = document.forms["formcontatti"];
		var Nome =Form.nome.value;
		var Cognome =Form.cognome.value;
		var Email=Form.email.value;
		var Phone=Form.tel.value;
		var Message=Form.messaggio.value;
		
		if ((Nome == "") || (Nome == "undefined")) {
   			alert("Il campo Nome e' obbligatorio.");
   			return false;
		} 
		else if ((Cognome == "") || (Cognome == "undefined")) {
   			alert("Il campo Cognome e' obbligatorio.");
   			return false;
		}
		else if ((Email == "") || (Email == "undefined")) {
   			alert("Il campo Email e' obbligatorio.");
   			return false;
		} 
		else if ((Phone == "") || (Phone == "undefined")) {
   			alert("Il campo Telefono e' obbligatorio.");
   			return false;
		} 
		else if ((Message == "") || (Message == "undefined")) {
   			alert("Il Messaggio e' obbligatorio.");
   			return false;
		}
		else {
			
			$.post("../ajax/contatti_fondi2.php", $("#formcontatti").serialize(),
			function(data){
				
				//$(document).trigger('close.facebox');
				jQuery.facebox(data);
			}
			);
			
		}
	}
	
	function PopupContatti236(){
		Form = document.forms["formcontatti"];
		var Nome =Form.nome.value;
		var Cognome =Form.cognome.value;
		var Email=Form.email.value;
		var Phone=Form.tel.value;
		var Message=Form.messaggio.value;
		
		if ((Nome == "") || (Nome == "undefined")) {
   			alert("Il campo Nome e' obbligatorio.");
   			return false;
		} 
		else if ((Cognome == "") || (Cognome == "undefined")) {
   			alert("Il campo Cognome e' obbligatorio.");
   			return false;
		}
		else if ((Email == "") || (Email == "undefined")) {
   			alert("Il campo Email e' obbligatorio.");
   			return false;
		} 
		else if ((Phone == "") || (Phone == "undefined")) {
   			alert("Il campo Telefono e' obbligatorio.");
   			return false;
		} 
		else if ((Message == "") || (Message == "undefined")) {
   			alert("Il Messaggio e' obbligatorio.");
   			return false;
		}
		else {
			
			$.post("../ajax/contatti_2362.php", $("#formcontatti").serialize(),
			function(data){
				
				//$(document).trigger('close.facebox');
				jQuery.facebox(data);
			}
			);
			
		}
	}
	
	function PopupContattiDoti(){
		Form = document.forms["formcontatti"];
		var Nome =Form.nome.value;
		var Cognome =Form.cognome.value;
		var Email=Form.email.value;
		var Phone=Form.tel.value;
		var Message=Form.messaggio.value;
		
		if ((Nome == "") || (Nome == "undefined")) {
   			alert("Il campo Nome e' obbligatorio.");
   			return false;
		} 
		else if ((Cognome == "") || (Cognome == "undefined")) {
   			alert("Il campo Cognome e' obbligatorio.");
   			return false;
		}
		else if ((Email == "") || (Email == "undefined")) {
   			alert("Il campo Email e' obbligatorio.");
   			return false;
		} 
		else if ((Phone == "") || (Phone == "undefined")) {
   			alert("Il campo Telefono e' obbligatorio.");
   			return false;
		} 
		else if ((Message == "") || (Message == "undefined")) {
   			alert("Il Messaggio e' obbligatorio.");
   			return false;
		}
		else {
			
			$.post("../ajax/contatti_doti2.php", $("#formcontatti").serialize(),
			function(data){
				
				//$(document).trigger('close.facebox');
				jQuery.facebox(data);
			}
			);
			
		}
	}
	
	
	
		function PopupContattiSeminari(){
		Form = document.forms["formcontatti"];
		var Nome =Form.nome.value;
		var Cognome =Form.cognome.value;
		var Email=Form.email.value;
		var Phone=Form.tel.value;
		var Message=Form.messaggio.value;
		
		if ((Nome == "") || (Nome == "undefined")) {
   			alert("Il campo Nome e' obbligatorio.");
   			return false;
		} 
		else if ((Cognome == "") || (Cognome == "undefined")) {
   			alert("Il campo Cognome e' obbligatorio.");
   			return false;
		}
		else if ((Email == "") || (Email == "undefined")) {
   			alert("Il campo Email e' obbligatorio.");
   			return false;
		} 
		else if ((Phone == "") || (Phone == "undefined")) {
   			alert("Il campo Telefono e' obbligatorio.");
   			return false;
		} 
		else if ((Message == "") || (Message == "undefined")) {
   			alert("Il Messaggio e' obbligatorio.");
   			return false;
		}
		else {
			
			$.post("../ajax/contatti_seminari2.php", $("#formcontatti").serialize(),
			function(data){
				
				//$(document).trigger('close.facebox');
				jQuery.facebox(data);
			}
			);
			
		}
	}
	
	
	
	function PopupContattiPersonal(){
		Form = document.forms["formcontatti"];
		var Nome =Form.nome.value;
		var Cognome =Form.cognome.value;
		var Email=Form.email.value;
		var Phone=Form.tel.value;
		var Message=Form.messaggio.value;
		
		if ((Nome == "") || (Nome == "undefined")) {
   			alert("Il campo Nome e' obbligatorio.");
   			return false;
		} 
		else if ((Cognome == "") || (Cognome == "undefined")) {
   			alert("Il campo Cognome e' obbligatorio.");
   			return false;
		}
		else if ((Email == "") || (Email == "undefined")) {
   			alert("Il campo Email e' obbligatorio.");
   			return false;
		} 
		else if ((Phone == "") || (Phone == "undefined")) {
   			alert("Il campo Telefono e' obbligatorio.");
   			return false;
		} 
		else if ((Message == "") || (Message == "undefined")) {
   			alert("Il Messaggio e' obbligatorio.");
   			return false;
		}
		else {
			
			$.post("../ajax/contatti_personal2.php", $("#formcontatti").serialize(),
			function(data){
				
				//$(document).trigger('close.facebox');
				jQuery.facebox(data);
			}
			);
			
		}
	}
	
	function PopupContattiAziendali(){
		Form = document.forms["formcontatti"];
		var Nome =Form.nome.value;
		var Cognome =Form.cognome.value;
		var Email=Form.email.value;
		var Phone=Form.tel.value;
		var Message=Form.messaggio.value;
		
		if ((Nome == "") || (Nome == "undefined")) {
   			alert("Il campo Nome e' obbligatorio.");
   			return false;
		} 
		else if ((Cognome == "") || (Cognome == "undefined")) {
   			alert("Il campo Cognome e' obbligatorio.");
   			return false;
		}
		else if ((Email == "") || (Email == "undefined")) {
   			alert("Il campo Email e' obbligatorio.");
   			return false;
		} 
		else if ((Phone == "") || (Phone == "undefined")) {
   			alert("Il campo Telefono e' obbligatorio.");
   			return false;
		} 
		else if ((Message == "") || (Message == "undefined")) {
   			alert("Il Messaggio e' obbligatorio.");
   			return false;
		}
		else {
			
			$.post("../ajax/contatti_aziendali2.php", $("#formcontatti").serialize(),
			function(data){
				
				//$(document).trigger('close.facebox');
				jQuery.facebox(data);
			}
			);
			
		}
	}
	
function PopupContattiFormazione(){
		Form = document.forms["formcontatti"];
		var Nome =Form.nome.value;
		var Cognome =Form.cognome.value;
		var Email=Form.email.value;
		var Phone=Form.tel.value;
		var Message=Form.messaggio.value;
		
		if ((Nome == "") || (Nome == "undefined")) {
   			alert("Il campo Nome e' obbligatorio.");
   			return false;
		} 
		else if ((Cognome == "") || (Cognome == "undefined")) {
   			alert("Il campo Cognome e' obbligatorio.");
   			return false;
		}
		else if ((Email == "") || (Email == "undefined")) {
   			alert("Il campo Email e' obbligatorio.");
   			return false;
		} 
		else if ((Phone == "") || (Phone == "undefined")) {
   			alert("Il campo Telefono e' obbligatorio.");
   			return false;
		} 
		else if ((Message == "") || (Message == "undefined")) {
   			alert("Il Messaggio e' obbligatorio.");
   			return false;
		}
		else {
			
			$.post("../ajax/contatti_formazione2.php", $("#formcontatti").serialize(),
			function(data){
				
				//$(document).trigger('close.facebox');
				jQuery.facebox(data);
			}
			);
			
		}
}

function PopupContattiMigliori(){
		Form = document.forms["formcontatti"];
		var Nome =Form.nome.value;
		var Cognome =Form.cognome.value;
		var Email=Form.email.value;
		var Phone=Form.tel.value;
		var Message=Form.messaggio.value;
		
		if ((Nome == "") || (Nome == "undefined")) {
   			alert("Il campo Nome e' obbligatorio.");
   			return false;
		} 
		else if ((Cognome == "") || (Cognome == "undefined")) {
   			alert("Il campo Cognome e' obbligatorio.");
   			return false;
		}
		else if ((Email == "") || (Email == "undefined")) {
   			alert("Il campo Email e' obbligatorio.");
   			return false;
		} 
		else if ((Phone == "") || (Phone == "undefined")) {
   			alert("Il campo Telefono e' obbligatorio.");
   			return false;
		} 
		else if ((Message == "") || (Message == "undefined")) {
   			alert("Il Messaggio e' obbligatorio.");
   			return false;
		}
		else {
			
			$.post("../ajax/contatti_migliori2.php", $("#formcontatti").serialize(),
			function(data){
				
				//$(document).trigger('close.facebox');
				jQuery.facebox(data);
			}
			);
			
		}
}
	
	
	function Newsletter(){
		var email=$('#newsemail').attr('value');
		if ((email == "") || (email == "undefined")){
			alert("Devi inserire un indirizzo email per proseguire.");
			return;
		}
		if (!($('#newscheck').is(':checked'))){
			alert("Devi accettare l'informativa sulla privacy per proseguire.");
			return;
		}
		jQuery.facebox({ ajax: '/ajax/newsletter.php?mail='+email });
		
	}
	
	function SendNewsletter(){
		$.post("/ajax/newsletter_2.php", $("form").serialize(),
			function(data){
				jQuery.facebox(data);
			});
	}
	
	
	function CercoCorsi2(){
		Form = document.forms["formcontatti"];
		var Nome =Form.nome.value;
		var Cognome =Form.cognome.value;
		var Email=Form.email.value;
		var Phone=Form.tel.value;
		var Message=Form.messaggio.value;
		
		if ((Nome == "") || (Nome == "undefined")) {
   			alert("Il campo Nome e' obbligatorio.");
   			return false;
		} 
		else if ((Cognome == "") || (Cognome == "undefined")) {
   			alert("Il campo Cognome e' obbligatorio.");
   			return false;
		}
		else if ((Email == "") || (Email == "undefined")) {
   			alert("Il campo Email e' obbligatorio.");
   			return false;
		} 
		else if ((Phone == "") || (Phone == "undefined")) {
   			alert("Il campo Telefono e' obbligatorio.");
   			return false;
		} 
		else if ((Message == "") || (Message == "undefined")) {
   			alert("Il Messaggio e' obbligatorio.");
   			return false;
		}
		else {
			
			$.post("../ajax/cerco_corsi_2.php", $("#formcontatti").serialize(),
			function(data){
				
				//$(document).trigger('close.facebox');
				jQuery.facebox(data);
			}
			);
			
		}
		
	}



	function controlla_codice(campo){
   caratteri= new Array ("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")
   pari= new Array (0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25)
   dispari=new Array (1,0,5,7,9,13,15,17,19,21,1,0,5,7,9,13,15,17,19,21,2,4,18,20,11,3,6,8,12,14,16,10,22,25,24,23)
   cod=campo.toLowerCase();
   check=true;
   if (cod.length!=16){
      check=false
      }
     else
      {
      lettere=cod.substr(0,6)+cod.substr(8,1)+cod.substr(11,1)+cod.substr(15);
      numeri=cod.substr(6,2)+cod.substr(9,2)+cod.substr(12,3);
      for (i=0;i<10;i++){
         if (lettere.charCodeAt(i)<97 || lettere.charCodeAt(i)>122){
            check=false;}
      }
      for (i=0;i<8;i++){
         if (numeri.charCodeAt(i)<48 || numeri.charCodeAt(i)>57){
            check=false;
         }
      }   
     }
   //checksum del codice fiscale
   test=cod.substr(15,1);
   var somma=0
   for (i=0;i<16;i=i+2){ //dispari
       carattere=cod.substr(i,1)
       for (k=0;k<36;k++){
          if (carattere==caratteri[k]){
             somma=somma+dispari[k]
             break
          }
       }
    }
    for (i=1;i<15;i=i+2){ //pari
       carattere=cod.substr(i,1)
       for (k=0;k<36;k++){
          if (carattere==caratteri[k]){
             somma=somma+pari[k]
             break
          }
       }
    }
   resto=somma % 26;
   var lettera=String.fromCharCode(97+resto);            
   if (test != lettera){
      check=false;
      }   
   return check;
}


function ControlliRegistrazione(){
		
		var Nome = $('#nome').attr('value');
		var Cognome =$('#cognome').attr('value');
		var Provincia =$('#provincia').attr('value');
		var Localita =$('#localita').attr('value');
		var Indirizzo =$('#indirizzo').attr('value');
		var Partita_iva =$('#partita_iva').attr('value');
		var Codice_fiscale =$('#codice_fiscale').attr('value');
		var Cellulare =$('#cellulare').attr('value');
		var Email =$('#email').attr('value');
		var Cemail =$('#cemail').attr('value');
		var Cap =$('#cap').attr('value');

		
		var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
		
		var check=true;
		
		if ((Nome == "") || (Nome == "undefined")) {
   			alert("Errore! Il campo NOME e' obbligatorio");
   			return;
		} 
		if ((Cognome == "") || (Cognome == "undefined")) {
   			alert("Errore! Il campo COGNOME e' obbligatorio");
   			return;
		}
		if ((Provincia == "") || (Provincia == "undefined")) {
   			alert("Errore! Il campo PROVINCIA e' obbligatorio");
   			return;
		}
		if ((Localita == "") || (Localita == "undefined")) {
   			alert("Errore! Il campo LOCALITA e' obbligatorio");
   			return;
		}
		if ((Indirizzo == "") || (Indirizzo == "undefined")) {
   			alert("Errore! Il campo INDIRIZZO e' obbligatorio");
   			return;
		}
		if ((Partita_iva == "") || (Partita_iva == "undefined")) {
   			alert("Errore! Il campo PARTITA IVA e' obbligatorio");
   			return;
		}
		if ((Cap == "") || (Cap == "undefined")) {
   			alert("Errore! Il campo CAP e' obbligatorio");
   			return;
		}
		if ((!controlla_codice(Codice_fiscale)) || (Codice_fiscale == "") || (Codice_fiscale == "undefined")) {
   			alert("Errore! Controllare il campo CODICE FISCALE");
   			return;
		}
		if ((Cellulare == "") || (Cellulare == "undefined")) {
   			alert("Errore! Il campo Cellulare e' obbligatorio");
   			return;
		}
		if ((Email == "")) {
   			alert("Errore! Il campo EMAIL e' obbligatorio");
   			return;
		}
		if ((Email != Cemail)) {
   			alert("Errore! La MAIL DI CONTROLLO non corrisponde");
   			return;
		}
		if (check){
		
		$.post("/ajax/registrazione.php?step=2", $("#formcontatti").serialize(),
			function(data){
				
				//$(document).trigger('close.facebox');
				jQuery.facebox(data);
			}
			);
		
		
		}
		
}



function Replica(){
	
	$('#nome').val($('#onome').val());
	$('#cognome').val($('#ocognome').val());
	$('#provincia').val($('#oprovincia').val());
	
	UpdateProvince();
	
	$('#indirizzo').val($('#oindirizzo').val());
	$('#partita_iva').val($('#opartita_iva').val());
	$('#codice_fiscale').val($('#ocodice_fiscale').val());
	$('#cellulare').val($('#ocellulare').val());
	$('#email').val($('#oemail').val());
	$('#cap').val($('#ocap').val());

}

function ControlliRegistrazioneF(){
		
		var Nome = $('#nome').attr('value');
		var Cognome =$('#cognome').attr('value');
		var Provincia =$('#provincia').attr('value');
		var Localita =$('#localita').attr('value');
		var Indirizzo =$('#indirizzo').attr('value');
		var Partita_iva =$('#partita_iva').attr('value');
		var Codice_fiscale =$('#codice_fiscale').attr('value');
		var Cellulare =$('#cellulare').attr('value');
		var Email =$('#email').attr('value');
		var Cap =$('#cap').attr('value');

		
		var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
		
		var check=true;
		
		if ((Nome == "") || (Nome == "undefined")) {
   			alert("Errore! Il campo NOME e' obbligatorio");
   			return;
		} 
		if ((Cognome == "") || (Cognome == "undefined")) {
   			alert("Errore! Il campo COGNOME e' obbligatorio");
   			return;
		}
		if ((Provincia == "") || (Provincia == "undefined")) {
   			alert("Errore! Il campo PROVINCIA e' obbligatorio");
   			return;
		}
		if ((Localita == "") || (Localita == "undefined")) {
   			alert("Errore! Il campo LOCALITA e' obbligatorio");
   			return;
		}
		if ((Indirizzo == "") || (Indirizzo == "undefined")) {
   			alert("Errore! Il campo INDIRIZZO e' obbligatorio");
   			return;
		}
		if ((Partita_iva == "") || (Partita_iva == "undefined")) {
   			alert("Errore! Il campo PARTITA IVA e' obbligatorio");
   			return;
		}
		if ((Cap == "") || (Cap == "undefined")) {
   			alert("Errore! Il campo CAP e' obbligatorio");
   			return;
		}
		if ((!controlla_codice(Codice_fiscale)) || (Codice_fiscale == "") || (Codice_fiscale == "undefined")) {
   			alert("Errore! Controllare il campo CODICE FISCALE");
   			return;
		}
		if ((Cellulare == "") || (Cellulare == "undefined")) {
   			alert("Errore! Il campo Cellulare e' obbligatorio");
   			return;
		}
		if ((Email == "")) {
   			alert("Errore! Il campo EMAIL e' obbligatorio");
   			return;
		}
		if (check){
		
		$.post("/ajax/registrazione.php?step=3", $("#formcontatti").serialize(),
			function(data){
				
				//$(document).trigger('close.facebox');
				jQuery.facebox(data);
			}
			);
		
		
		}
		
}



function Select_Value_Set(SelectName, Value) {
  SelectObject = $(SelectName);
  for(index = 0; 
    index < SelectObject.length; 
    index++) {
   if(SelectObject[index].value == Value)
     SelectObject.selectedIndex = index;
   }
}




function UpdateProvince(){

	$.post("/ajax/option_province.php", $("#formcontatti").serialize(),
			function(data){
				//$(document).trigger('close.facebox');
				$('#toupdate').html(data);
			}
			);	
}


function RecuperaPass(){
	$.post("/ajax/recuperopassword2.php", $("#formcontatti").serialize(),
			function(data){
				//$(document).trigger('close.facebox');
				jQuery.facebox(data);
			}
			);
	
}


