function requestSubmit(l){

  var l             = document.getElementById("l").value;
  var name          = document.getElementById("name");
  var surname       = document.getElementById("surname");
  var country       = document.getElementById("country");
  var city          = document.getElementById("city");
  var phone         = document.getElementById("phone");
  var email         = document.getElementById("email");
  var checkin       = document.getElementById("checkin");
  var checkout      = document.getElementById("checkout");
  var adults        = document.getElementById("adults");
  var children      = document.getElementById("children");
  var messaggio     = document.getElementById("messaggio");
  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 (name.value == ""){
    if (l == "ITA")
      alert("ERRORE: IL CAMPO NOME NON E' STATO COMPILATO");
    else if (l == "ENG")
      alert("ERROR: FIELD NAME IS REQUIRED");
    name.style.backgroundColor = "#FF0000";
    name.focus();
  }
  else if (surname.value == ""){
    if (l == "ITA")
      alert("ERRORE: IL CAMPO COGNOME NON E' STATO COMPILATO");
    else if (l == "ENG")
      alert("ERROR: FIELD SURNAME IS REQUIRED");
    surname.style.backgroundColor = "#FF0000";
    surname.focus();
  }
  else if (country.value == ""){
    if (l == "ITA")
      alert("ERRORE: IL CAMPO STATO NON E' STATO COMPILATO");
    else if (l == "ENG")
      alert("ERROR: FIELD COUNTRY IS REQUIRED");
    country.style.backgroundColor = "#FF0000";
    country.focus();
  }
  else if (city.value == ""){
    if (l == "ITA")
      alert("ERRORE: IL CAMPO CITTA\' NON E' STATO COMPILATO");
    else if (l == "ENG")
      alert("ERROR: FIELD CITY IS REQUIRED");
    city.style.backgroundColor = "#FF0000";
    city.focus();
  }
  else if (phone.value == ""){
    if (l == "ITA")
      alert("ERRORE: IL CAMPO TELEFONO NON E' STATO COMPILATO");
    else if (l == "ENG")
      alert("ERROR: FIELD PHONE IS REQUIRED");
    phone.style.backgroundColor = "#FF0000";
    phone.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 (checkin.value == "" || checkin.value == "dd/mm/yyyy"){
    if (l == "ITA")
      alert("ERRORE: IL CAMPO DATA DI ARRIVO NON E' STATO COMPILATO");
    else if (l == "ENG")
      alert("ERROR: FIELD CHECK IN DATE IS REQUIRED");  
    checkin.style.backgroundColor = "#FF0000";
    checkin.value = '';
    checkin.focus();
  }
  else if (checkout.value == "" || checkout.value == "dd/mm/yyyy"){
    if (l == "ITA")
      alert("ERRORE: IL CAMPO DATA DI PARTENZA NON E' STATO COMPILATO");
    else if (l == "ENG")
      alert("ERROR: FIELD CHECK OUT IS REQUIRED");  
    checkout.style.backgroundColor = "#FF0000";
    checkout.value = '';
    checkout.focus();
  }
  else if (adults.value == ""){
    if (l == "ITA")
      alert("ERRORE: IL CAMPO ADULTI NON E' STATO COMPILATO");
    else if (l == "ENG")
      alert("ERROR: FIELD ADULTS IS REQUIRED");  
    adults.style.backgroundColor = "#FF0000";
    adults.focus();
  }
  else if (children.value == ""){
    if (l == "ITA")
      alert("ERRORE: IL CAMPO BAMBINI NON E' STATO COMPILATO");
    else if (l == "ENG")
      alert("ERROR: FIELD CHILDREN IS REQUIRED");  
    children.style.backgroundColor = "#FF0000";
    children.focus();
  }
	else if (privacy.checked == false){
    if (l == "ITA")
      alert("ERRORE: CAMPO PRIVACY NON E' STATO COMPILATO.");
    else if (l == "ENG")
      alert("ERROR: PRIVACY IS REQUIRED");		
	}
  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_booking").submit();
  }
}

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