

function validateFormRichiesta(theForm, msg) {
var reason = "";

  reason += validateEmptyBis(theForm.societa , '');
  reason += validateEmptyBis(theForm.indirizzo, '');
  reason += validateEmptyBis(theForm.citta , '');
  reason += validateEmptyBis(theForm.zip_code , '');
  reason += validateEmptyBis(theForm.stato , '');
  reason += validateEmptyBis(theForm.fax , '');
  reason += validateEmptyBis(theForm.telefono , '');
  reason += validateEmptyBis(theForm.cognome , '');
  reason += validateEmptyBis(theForm.nome , '');
  reason += validateEmptyBis(theForm.email , '');
  reason += validateEmptyBis(theForm.incarico , '');
  reason += validateEmptyBis(theForm.tipo_azienda , '');
  reason += validateEmptyBis(theForm.attivita , '');
  reason += validateEmptyBis(theForm.testo , '');

      
  if (reason != "") {
    alert(msg);
    return false;
  }

  return true;
}




function validateEmpty(fld,name) {
    var error = "";
 
    if (fld.value.length == 0) {
        fld.style.background = 'silver';
	 
        error = " - "+name+" - \n"
    } else {
        fld.style.background = 'White';
    }
    return error;  
}

function validateEmptyBis(fld,name) {
    var error = "";
 
    if (fld.value.length == 0) {
        fld.style.background = 'silver';
	 
        //error = " - "+name+" - \n"
		  error = "."
    } else {
        fld.style.background = 'White';
    }
    return error;  
}

function validateEmptyCheckBox(fld,name) {
    var error = "";
 
    if (!fld.checked) {
        fld.style.backgroundColor  = 'silver';
	 
        error = " - "+name+" - \n"
		  
    } else {
        fld.style.backgroundColor  = 'White';
    }
    return error;  
}

function resetInput(elemento)
{

	elemento.value = '';

}



