function requestSubmit(){

  //var l             = document.getElementById("l");
  var nome          = document.getElementById("nome");
  //var cognome       = document.getElementById("cognome");
  //var telefono      = document.getElementById("telefono");
  var email         = document.getElementById("email");
  //var richieste     = document.getElementById("richieste");
  //var privacy       = document.getElementById("privacy");

  var phone_reg_exp = /^([0-9_\.\-\+\ \/])+$/;
	var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

  if (nome.value == ""){
  
    alert("ERRORE: IL CAMPO NOME E' VUOTO");
    nome.style.backgroundColor = "#FF0000";
    nome.focus();
  
  }
/*  else if (cognome.value == ""){
  
    alert("ERRORE: IL CAMPO COGNOME NON E' STATO COMPILATO");
    cognome.style.backgroundColor = "#FF0000";
    cognome.focus();
  
  }*/
  else if (email.value == ""){
  
    alert("ERRORE: IL CAMPO EMAIL E' VUOTO");
    email.style.backgroundColor = "#FF0000";
    email.focus();
  
  }
  else if (email.value != "" && !email_reg_exp.test(email.value)){
  
    alert("ERRORE: IL CAMPO EMAIL NON E' CORRETTO");
		email.value = '';
		email.focus();
			
	}
/*	else if (telefono.value != "" && !phone_reg_exp.test(telefono)){
		
		alert("ERRORE: CAMPO TELEFONO NON CORRETTO. SONO CONSENTITI SOLO NUMERI E I SIMBOLI . - + /");
		telefono.value = '';
		telefono.focus();
			
	}
  else if (privacy.checked == false){
  
    alert("ERRORE: MANCA AUTORIZZAZIONE PRIVACY");
    privacy.style.backgroundColor = "#FF0000";
    privacy.focus();
  
  }*/
  else{

    //startLoading("cont", "Invio in corso");
    
    //var url 	   = 'modules/Contatti/xml/xmlContatti.php';
  	
  	//var params 	 = 'l='+l.value+'&nome='+nome.value+'&cognome='+cognome.value+'&telefono='+telefono.value+'&email='+email.value+'&richieste='+richieste.value;
  	
    //var method 	 = 'POST';
  	
    //myXMLHTTPRequest(method, url, params, responseSubmit);
    document.a.submit();

  }

}


function responseSubmit(httpRequest){
	if (myXMLHTTPResponse(httpRequest, "text/xml")){

		var xmldoc = myXMLHTTPResponse(httpRequest, "text/xml");
		
		var esito = xmldoc.getElementsByTagName('esito').item(0).firstChild.data;		

		document.getElementById("cont").innerHTML = esito;
		
	}
	else{
	}
}


function colorOK(field){

  var color = "#FFFFFF";
  document.getElementById(field).style.backgroundColor = color;

}

function colorOK2(field){

  var color = "#000000";
  document.getElementById(field).style.backgroundColor = color;

}
