function valida_consulta_excursiones(formu)
{
      var nom,em,pa,canpas,cons,fec = 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 cp = document.getElementById('cant_pasajeros'+formu);
      var fe = document.getElementById('fecha_excursion'+formu);

      var con = document.getElementById('consulta'+formu);

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

      if(isEmptyMsg(e,'E-mail')){ em=1; }



      if(isEmptyMsg(fe,'Desde')){ fec=1; } else{isOkMsg(fe,'Nombre')}



      if(isEmptyMsg(con,'Consulta')){ cons=1; } else{isOkMsg(con,'Nombre')}

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

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


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




      if (pa!=1 && nom!=1 && em!=1 && canpas!=1 && cons!=1)
      {
        f.submit();
      }
}

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

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

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