// JavaScript Document

function checkForm(theForm){
  if ((theForm["Ragione_Sociale"].value!=""||document.modulo.Ragione_Sociale.disabled) && (theForm["descrizione_attivita"].value!="" || document.modulo.descrizione_attivita.disabled)  && theForm["Persona_richiedente"].value!="" && theForm["Citta"].value!="" && theForm["telefono"].value!="" && theForm["e_mail"].value!="" && (theForm["giuridica"].value!="0"||document.modulo.Ragione_Sociale.disabled) && theForm["provincia"].value!="-1") {
	   if(!theForm.radioprivacy[0].checked) {
		   alert("Per usufruire di questo servizio è necessario acconsentire \nal trattamento dei dati");
	       return false;
	   }
	   else {
		   return true;
		   }
   }
  else {
     alert("Compilare tutti i campi obbligatori contrassegnati da *");
       return false;
     }
}

function ResetForm () {

	for(i=0;i<document.modulo.elements.length;i++) {
	document.modulo.elements[i].value = ""
	}

}

function PersFis (pVal) {

	if(pVal) {
		document.modulo.Ragione_Sociale.className = "frmInputOff";
		document.modulo.giuridica.className = "frmInputOff";
		document.modulo.descrizione_attivita.className = "frmInputOff";
	}
	else {
		document.modulo.Ragione_Sociale.className = "frmInput";
		document.modulo.giuridica.className = "frmInput";
		document.modulo.descrizione_attivita.className = "frmInput";
	}
	document.modulo.Ragione_Sociale.disabled = pVal;
	document.modulo.giuridica.disabled = pVal;
	document.modulo.descrizione_attivita.disabled = pVal;


}

