function validar() {
  F = document.formulario;
	
  //Valido Nombre Completo
  if (F.nombre_completo.value == "Nombre y Apellido") {
    alert("Debe especificar su \"Nombre y Apellido\".");
    F.nombre_completo.value = '';    
    F.nombre_completo.focus();
    return (false);  
  }

  if (F.nombre_completo.value.length < 3) {
	alert("Debe especificar su \"Nombre y Apellido\".");
    F.nombre_completo.focus();
    return (false);
  }
  var checkOK = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZÁÉÍÓÚ" + "abcdefghijklmnñopqrstuvwxyzáéíóú ";
  var checkStr = F.nombre_completo.value;
  var allValid = true;
  for (i = 0; i < checkStr.length; i++) {
    ch = checkStr.charAt(i);
    for (j = 0; j < checkOK.length; j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length) {
      allValid = false;
      break;
    }
  }
  if (!allValid) {
	alert("Escriba sólo letras en el campo \"Nombre Completo\".");
    F.nombre_completo.focus();
    return (false);
  }

  //Valido Telefono
  if ((F.tel.value == "Teléfono") || (F.tel.value == "Tel&eacute;fono")) {
    alert("Ingrese su \"Número de Teléfono\".");
    F.tel.value = '';    
    F.tel.focus();
    return (false);  
  }

  var checkOK = "0123456789- ()";
  var checkStr = F.tel.value;
  var allValid = true;
  if (checkStr.length > 1) {
    for (i = 0; i < checkStr.length; i++) {
	  ch = checkStr.charAt(i);
      for (j = 0; j < checkOK.length; j++)
        if (ch == checkOK.charAt(j))
	      break;
      if (j == checkOK.length) {
		allValid = false;
        break;
	  }
    }
	if (!allValid) {
	  alert("Escriba sólo Numeros en el campo \"Teléfono\".");
      F.tel.focus();
	  return (false);
    }  
  }	  

  //Valido Correo Electroncio
  if (F.email.value == "email") {
    alert("Escriba una dirección de correo electrónico válida en el campo \"Email\".");
    F.email.value = '';    
    F.email.focus();
    return (false);  
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZ@" + "abcdefghijklmnopqrstuvwxyz-_.";
  var checkStr = F.email.value;
  var allValid = true;
  for (i = 0; i < checkStr.length; i++) {
    ch = checkStr.charAt(i);
    for (j = 0; j < checkOK.length; j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length) {
      allValid = false;
      break;
    }
  }
  if (!allValid) {
	alert("Escriba una dirección de correo electrónico válida en el campo \"Email\".");
    F.email.focus();
	return (false);
  }  
  if ((F.email.value.indexOf ('@', 0) == -1)||(F.email.value.length < 5)) {
	alert("Escriba una dirección de correo electrónico válida en el campo \"Email\".");
	F.email.focus();
    return (false);
  }

  //Valido Como Nos Conocio
  if (F.como_nos_conocio.value == "Cómo nos conoció?") {
    alert("Por favor indiquenos como nos conoció.");
    F.como_nos_conocio.value = '';    
    F.como_nos_conocio.focus();
    return (false);  
  }

  var checkOK = "1234567890ABCDEFGHIJKLMNÑOPQRSTUVWXYZÁÉÍÓÚ" + "abcdefghijklmnñopqrstuvwxyzáéíóú ";
  var checkStr = F.como_nos_conocio.value;
  var allValid = true;
  if (checkStr.length > 1) {
    for (i = 0; i < checkStr.length; i++) {
	  ch = checkStr.charAt(i);
      for (j = 0; j < checkOK.length; j++)
		if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length) {
	    allValid = false;
        break;
      }
	}
    if (!allValid) {
	  alert("Escriba sólo letras o números en el campo \"Como nos conoció?\".");
      F.como_nos_conocio.focus();
	  return (false);
    }    
  }	

  //Valido Comentarios
  if (F.comentarios.value == "Su consulta") {
    alert("Por favor ingrese su consulta.");
    F.comentarios.value = '';    
    F.comentarios.focus();
    return (false);  
  }

  if (F.comentarios.value.length < 10) {
	alert("Por favor ingrese su consulta.");
    F.comentarios.focus();
    return (false);
  }  
  var enter = "\n";
  var checkOK = "0123456789ABCDEFGHIJKLMNÑOPQRSTUVWXYZÁÉÍÓÚ$()" + "abcdefghijklmnñopqrstuvwxyzáéíóú,.:_-+¡!¿?=; " + String.fromCharCode(13) + enter;
  var checkStr = F.comentarios.value;
  var allValid = true;
  for (i = 0; i < checkStr.length; i++) {
    ch = checkStr.charAt(i);
    for (j = 0; j < checkOK.length; j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length) {
      allValid = false;
      break;
    }
  }
  if (!allValid) {
	alert("Ha ingresado caracteres no válidos en el campo \"Consulta\".");
    F.comentarios.focus();
    return (false);
  }  

  return (true);
}

function validar_consulta() {
  F = document.formulario;
  var resultado_validacion = validar();
  if (resultado_validacion == true) { 
	//alert('Ok');
	F.submit(); 
	} 
}

function f_click(id, valor) {
  var VarT = document.getElementById(id);
  if (VarT.value == valor) { VarT.value = ''; }
}

function f_on_exit(id, valor) {
  var VarT = document.getElementById(id);
  if (VarT.value == '') { VarT.value = valor; }
}
