function valida_consulta_servicios(formu)
{
      var nom,em,pa,ciu,des,has,cons,cpa = 0;
      var f = document.getElementById('form'+formu);
      var n = document.getElementById('nombre'+formu);
      var e = document.getElementById('email'+formu);
      var p = document.getElementById('pais'+formu);
      var d = document.getElementById('fecha_llegada'+formu);
      var h = document.getElementById('fecha_partida'+formu);
      var con = document.getElementById('consulta'+formu);

      if(isEmptyMsg(n)){ nom=1; }else{isOkMsg(n)}

      if(isEmptyMsg(e)){ em=1; }

      if(isEmptyMsg(d)){ des=1; } else{isOkMsg(d)}

      if(isEmptyMsg(h)){ has=1; } else{isOkMsg(h)}

      if(isEmptyMsg(con)){ cons=1; } else{isOkMsg(con)}

      if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(e.value))
      {
          e.style.backgroundColor='#FFFFFF';
      }
      else
      {
          e.style.backgroundColor='#FE9896';
          em=1;
      }

       if (p.value == "0")
      {
        p.style.backgroundColor='#FE9896';
        pa=1;
      } else{p.style.backgroundColor='#FFFFFF'; pa=0;}

      if (pa!=1 && nom!=1 && em!=1 && ciu!=1 && des!=1 && has!=1 && cpa!=1 && cons!=1)
      {
        f.submit();
      }
}

//-------------FUNCIONES DE VALIDACION

function isEmptyMsg(obj)
{
    if(!obj.value || obj.value=="")
    {
        obj.style.backgroundColor='#FE9896';
        return(true);
    }else{
        return(false);
  }
}

function isOkMsg(obj)
{
    obj.style.backgroundColor='#FFFFFF';
}
