function requestContatti(){

	var nome 			     = document.getElementById("c_nome");
	var cognome 		   = document.getElementById("c_cognome");
	var email 			   = document.getElementById("c_email");
	var richieste 		 = document.getElementById("c_richieste");
	var privacy 		   = document.getElementById("c_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,})+$/;
	var error 			= '';
	var ok 				= '';
	var color			= '#cccccc';

	if (nome.value == ""){
		ok = true;
		nome.style.backgroundColor = color;
		nome.focus();
		error = "ERRORE: CAMPO NOME NON COMPILATO";
	}
	else if (cognome.value == ""){
		ok = true;
		cognome.style.backgroundColor = color;
		cognome.focus();
		error = "ERRORE: CAMPO COGNOME NON COMPILATO";
	}
	else if (email.value == ""){
		ok = true;
		email.style.backgroundColor = color;
		email.focus();
		error = "ERRORE: CAMPO EMAIL  NON COMPILATO";
	}
	else if (email.value != "" && !email_reg_exp.test(email.value)){
		ok = true;
		email.value = '';
		email.focus();
		error = "ERRORE: CAMPO EMAIL NON CORRETTO";
	}
	else if (privacy.checked == false){
		ok = true;
		error = "ERRORE: MANCA AUTORIZZAZIONE PRIVACY";
	}
	
	if (ok == true){
		window.alert(error);
	}
	else{
	
		var url 	   = 'modules/Contatti/xml/xmlContatti.php';
		var params 	 = 'nome='+nome.value+'&cognome='+cognome.value+'&email='+email.value+'&richieste='+richieste.value;
		var method 	 = 'POST';
		
    startLoading("Invio in corso", "contatti");		
		
    myXMLHTTPRequest(method, url, params, responseContatti);
    
	}
}



function responseContatti(httpRequest){
	if (myXMLHTTPResponse(httpRequest, "text/xml")){
		
    var xmldoc = myXMLHTTPResponse(httpRequest, "text/xml");

		var esito = xmldoc.getElementsByTagName('te').item(0).firstChild.data;
		
		document.getElementById('contatti').innerHTML = esito;
		
    stopLoading();
	
  }
	else{
	
  }
}


function colorOK(field){
	
  var colorOK = "#FFFFFF";
	
  if (document.getElementById(field))
		document.getElementById(field).style.backgroundColor = colorOK;

}
