function requestSubmit(l){

  var l             = document.getElementById("l").value;
  var nome          = document.getElementById("nome");
  var email         = document.getElementById("email");
  var messaggio     = document.getElementById("posText");

  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 == ""){
    if (l == "ITA")
      alert("ERRORE: IL CAMPO NOME NON E' STATO COMPILATO");
    else if (l == "ENG")
      alert("ERROR: FIELD NAME IS REQUIRED");
    nome.style.backgroundColor = "#FF0000";
    nome.focus();
  }
  else if (email.value == ""){
    if (l == "ITA")
      alert("ERRORE: IL CAMPO EMAIL NON E' STATO COMPILATO");
    else if (l == "ENG")
      alert("ERROR: FIELD EMAIL IS REQUIRED");  
    email.style.backgroundColor = "#FF0000";
    email.focus();
  }
  else if (email.value != "" && !email_reg_exp.test(email.value)){
    if (l == "ITA")
      alert("ERRORE: CAMPO EMAIL NON CORRETTO");
    else if (l == "ENG")
      alert("ERROR: FIELD EMAIL IS NOT CORRECT");
    email.style.backgroundColor = "#FF0000";
		email.value = '';
		email.focus();
	}
	else if (messaggio.value == ""){
    if (l == "ITA")
      alert("ERRORE: CAMPO MESSAGGIO NON CORRETTO.");
    else if (l == "ENG")
      alert("ERROR: FIELD MESSAGE IS REQUIRED");		
    messaggio.style.backgroundColor = "#FF0000";
		messaggio.focus();
	}
  else{
    document.getElementById("form_contatti").submit();
  }
}

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

