// JavaScript Document
function enviarConsulta()
{
   var nombre=document.getElementById("txtnombre");
   var telefono=document.getElementById("txttelefono");
   var email=document.getElementById("txtemail");
   if(nombre == null || trimAll(nombre.value).length == 0)
   {
      alert('EL CAMPO NOMBRE NO PUEDE ESTAR VACIO');
   }
   else if((telefono == null || trimAll(telefono.value).length == 0) &&
           (email == null || trimAll(email.value).length == 0) )
   {
       alert('DEBE RELLENAR EL CAMPO TELÉFONO O EMAIL');  
   }
   else if(email != null && trimAll(email.value).length != 0 && 
            !comprobarEmail(email.value))
   {
       alert('EL EMAIL ES INCORRECTO');
   }
   else
   { 
      var formulario=document.getElementById("envioMatricula");
      formulario.submit();
   }

}