// JavaScript Document - Usada na funo Mail

  
function comprobarU() {
var nombre = document.getElementById("Nombre").value;//toma el valor del campo nombre
var mail = document.getElementById("e-correo").value;
var telef = document.getElementById("Telefono").value;
var com = document.getElementById("comensales").value;
var fecha = document.getElementById("fecha").value;
var hora = document.getElementById("hora").value;

  if (nombre == "")  {//si nombre es igual a vacío
  hideAllErrors();
  document.getElementById("nombreError").style.display = "inline";//que se vea el id nombreError
  document.getElementById("Nombre").select();//selecciona el campo Nombre
  document.getElementById("Nombre").focus();//pone el cursor en el campo Nombre
   return false;
  }
   if (mail == "")  {
  hideAllErrors();
  document.getElementById("mailError").style.display = "inline";//que se vea el id nombreError
  document.getElementById("e-correo").select();//selecciona el campo Nombre
  document.getElementById("e-correo").focus();//pone el cursor en el campo Nombre
   return false;
  } 
  if (telef == "")  {
  hideAllErrors();
  document.getElementById("telefError").style.display = "inline";
  document.getElementById("Telefono").select();
  document.getElementById("Telefono").focus();
   return false;
  }
  
 if (com == "") {
  hideAllErrors();
  document.getElementById("comError").style.display = "inline";
  document.getElementById("comensales").select();
  document.getElementById("comensales").focus();
   return false;
  } 
  
  if (fecha == "") {
  hideAllErrors();
  document.getElementById("fechaError").style.display = "inline";
  document.getElementById("fecha").select();
  document.getElementById("fecha").focus();
   return false;
  } 
 
 if (hora == "") {
  hideAllErrors();
  document.getElementById("horaError").style.display = "inline";
  document.getElementById("hora").select();
  document.getElementById("hora").focus();
   return false;
  } /**/
  
  return true;
  
  }
  
 function hideAllErrors() 
 {
document.getElementById("nombreError").style.display = "none";
document.getElementById("mailError").style.display = "none";
document.getElementById("telefError").style.display = "none";
document.getElementById("comError").style.display = "none";
document.getElementById("fechaError").style.display = "none";
document.getElementById("horaError").style.display = "none";/* ocultalos mensajes con id horaError */
  } 