// JavaScript Document

function show()
	 {document.getElementById("chi").style.display = "inline";
	 }
function hide()
	 {document.getElementById("chi").style.display = "none";
	 }
	 
function control(curr) {
	Ctrl = curr.cognome;
	if(Ctrl.value == "" ){
	validatePrompt (Ctrl, "Attenzione!! Il campo cognome è obbligatorio. Inserisci il tuo Cognome");
	return false;
	}
	Ctrl = curr.nome;
	if(Ctrl.value == "" ){
	validatePrompt (Ctrl, "Attenzione!! Il campo nome è obbligatorio. Inserisci il tuo Nome");
	return false;
	}
	Ctrl = curr.data_nascita;
	if(Ctrl.value == "" ){
	validatePrompt (Ctrl, "Attenzione!! Il campo data di nascita è obbligatorio. Inserisci la tua Data di Nascita");
	return false;
	}
	Ctrl2 = Ctrl.value.substr(0,2)+Ctrl.value.substr(3,2)+Ctrl.value.substr(6,4)
	if( (Ctrl.value.charAt(2) != '/') || (Ctrl.value.charAt(5) != '/') || (Ctrl.value.length != 10) || (isNaN(Ctrl2)) ){
	validatePrompt (Ctrl, "Attenzione!! la data di Nascita inserita non è corretta. Il formato data deve essere gg/mm/anno");
	return false;
	}
	Ctrl = curr.indirizzo;
	if(Ctrl.value == "" ){
	validatePrompt (Ctrl, "Attenzione!! Il campo indirizzo è obbligatorio. Inserisci il tuo Indirizzo di Nascita");
	return false;
	}
	Ctrl = curr.cap;
	if(Ctrl.value == "" ){
	validatePrompt (Ctrl, "Attenzione!! Il campo cap è obbligatorio. Inserisci il tuo Cap o Codice Postale");
	return false;
	}
	Ctrl = curr.citta;
	if(Ctrl.value == "" ){
	validatePrompt (Ctrl, "Attenzione!! Il campo città è obbligatorio. Inserisci la tua Città di Nascita");
	return false;
	}
	Ctrl = curr.provincia;
	Ctrl2 = curr.provincia_estera;
	if(Ctrl.value == "Altra" ){
		if ( Ctrl2.value == "" ){
		validatePrompt (Ctrl2, "Attenzione!! Specificare la Provincia di Nascita se non è presente nelle opzioni");
		return false;
		}
	}
	Ctrl = curr.stato;
	if(Ctrl.value == "" ){
	validatePrompt (Ctrl, "Attenzione!! Il campo stato è obbligatorio. Inserisci il tuo Stato di Nascita");
	return false;
	}
	Ctrl = curr.telefono;
	if(Ctrl.value == "" ){
	validatePrompt (Ctrl, "Attenzione!! Il campo telefono è obbligatorio. Inserisci un recapito telefonico");
	return false;
	}
	Ctrl = curr.email;
	if(Ctrl.value == "" ){
	validatePrompt (Ctrl, "Attenzione!! Il campo email è obbligatorio. Inserisci un indirizzo email valido");
	return false;
	}
	
	/*Ctrl1 = document.getElementById("it_s_0");
	Ctrl3 = document.getElementById("en_s_0");
	Ctrl5 = document.getElementById("fr_s_0");
	Ctrl7 = document.getElementById("altro_s_0");
	if(Ctrl1.checked == false && Ctrl2.checked == false && Ctrl3.checked == false && Ctrl4.checked == false ){
	validatePrompt (Ctrl, "Selezionare il livello di scrittura di almeno una lingua");
	return false;
	}
	
	Ctrl1 = document.getElementById("it_p_0");
	Ctrl2 = document.getElementById("en_p_0");
	Ctrl3 = document.getElementById("fr_p_0");
	Ctrl4 = document.getElementById("altro_p_0");
	if(Ctrl1.checked == false && Ctrl2.checked == false && Ctrl3.checked == false && Ctrl4.checked == false ){
	validatePrompt (Ctrl, "Selezionare il livello parlato di almeno una lingua");
	return false;
	}*/
	
	Ctrl1 = curr.dove1;
	Ctrl2 = curr.dove2;
	Ctrl3 = curr.dove3;
	if(Ctrl1.checked == false && Ctrl2.checked == false && Ctrl3.checked == false ){
	validatePrompt (Ctrl, "Attenzione!! Devi selezionare almeno un paese dove preferisci lavorare");
	return false;
	}
	
	
	
	Ctrl = curr.dati;
	if (!Ctrl.checked ) {
	validatePrompt (Ctrl, "L'invio è valido solo tramite il consenso dei dati personali");
	return false;
	}
return true;
}

function validatePrompt (Ctrl, PromptStr) {
	alert (PromptStr)
	return false;
}

