
function Validar2(theForm)
{
   var cadena=0;

   if (!(checkEmail (theForm.email)))
   {
    alert("La dirección de E-Mail parece ser inválida. Por favor, corríjala ó reingrésela.");
    theForm.email.focus();
    return (false);
   }

   if (theForm.nombre.value.length < 2)
   {
    alert("Por favor, ingrese un dato válido en el campo \"Nombre:\".");
    theForm.nombre.focus();
    return (false);
   }

   if (theForm.localidad.value.length < 2)
   {
    alert("Por favor, ingrese un dato válido en el campo \"Localidad:\".");
    theForm.localidad.focus();
    return (false);
   }

   if (theForm.provincia.value.length < 2)
   {
    alert("Por favor, ingrese un dato válido en el campo \"Provincia:\".");
    theForm.provincia.focus();
    return (false);
   }

   if (theForm.codpost.value.length <= 0)
   {
    alert("Por favor, ingrese un dato válido en el campo \"Código Postal:\".");
    theForm.codpost.focus();
    return (false);
   }

   if (theForm.pais.value.length < 2)
   {
    alert("Por favor, ingrese un dato válido en el campo \"País:\".");
    theForm.pais.focus();
    return (false);
   }

   if ((theForm.sexo.value != 'M') && (theForm.sexo.value != 'F'))
   {
    alert("Por favor, indique el sexo del equino con \"M\" o \"F\".");
    theForm.sexo.focus();
    return (false);
   }

   if (theForm.mensaje.value.length <= 0)
   {
    alert("Por favor, aclare el motivo de su consulta.");
    theForm.mensaje.focus();
    return (false);
   }

  return (true);
}

function Validar(theForm)
{
   var cadena=0;

   if (!(checkEmail (theForm.email)))
   {
    alert("La dirección de E-Mail parece ser inválida. Por favor, corríjala ó reingrésela.");
    theForm.email.focus();
    return (false);
   }

   if (theForm.nombre.value.length < 2)
   {
    alert("Por favor, ingrese un dato válido en el campo \"Nombre:\".");
    theForm.nombre.focus();
    return (false);
   }

  return (true);
}

function checkEmail(fld)
{ // simple email check
  if(fld.disabled) return true; // blank fields are the domain of requireValue 
  var emailfmt= /^\w+([.-]\w+)*@\w+([.-]\w+)*\.\w{2,8}$/;
  if(!emailfmt.test(fld.value))
  { status= 'El campo '+fld.name+' debe contener una dirección de E-Mail Válida.'; return false; }
  return true;
}

