
function Form1_Validator(theForm)
{

  if (theForm.nombre.value == "")
  {
    alert("Escriba su Nombre");
    theForm.nombre.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f";
  var checkStr = theForm.nombre.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 letra y espacio en blanco caracteres en el campo \"Nombre\".");
    theForm.nombre.focus();
    return (false);
  }

  if (theForm.asunto.value == "")
  {
    alert("Escriba título en el campo \"asunto\".");
    theForm.asunto.focus();
    return (false);
  }

  if (theForm.asunto.value.length < 1)
  {
    alert("Escriba por lo menos 1 caracteres en el campo \"asunto\".");
    theForm.asunto.focus();
    return (false);
  }

  if (theForm.asunto.value.length > 30)
  {
    alert("Sólo escriba el título max 30 car. (puede desarrollar su tema en el mensaje)");
    theForm.asunto.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = theForm.asunto.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 letra, dígito y espacio en blanco caracteres en el campo \"asunto\".");
    theForm.asunto.focus();
    return (false);
  }

  if (theForm.mail_tel.value == "")
  {
    alert("Escriba su correo o teléfono");
    theForm.mail_tel.focus();
    return (false);
  }

  if (theForm.mail_tel.value.length < 1)
  {
    alert("Escriba por lo menos 1 caracteres en el campo \"mail_tel\".");
    theForm.mail_tel.focus();
    return (false);
  }

  if (theForm.mail_tel.value.length > 500)
  {
    alert("Escriba como máximo 500 caracteres en el campo \"mail_tel\".");
    theForm.mail_tel.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-@ . \t\r\n\f";
  var checkStr = theForm.mail_tel.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 letra, dígito, espacio en blanco y \"@ .\" caracteres en el campo \"mail_tel\".");
    theForm.mail_tel.focus();
    return (false);
  }

  if (theForm.cia.value == "")
  {
    alert("Escriba un valor para el campo \"compañía\".");
    theForm.cia.focus();
    return (false);
  }

  if (theForm.cia.value.length < 1)
  {
    alert("Escriba por lo menos 1 caracteres en el campo \"compañía\".");
    theForm.cia.focus();
    return (false);
  }

  if (theForm.cia.value.length > 200)
  {
    alert("Escriba como máximo 200 caracteres en el campo \"compañía\".");
    theForm.cia.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789- \t\r\n\f";
  var checkStr = theForm.cia.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 letra, dígito y espacio en blanco caracteres en el campo \"compañía\".");
    theForm.cia.focus();
    return (false);
  }

  if (theForm.mensaje.value == "")
  {
    alert("Escriba un valor para el campo \"mensaje\".");
    theForm.mensaje.focus();
    return (false);
  }

  if (theForm.mensaje.value.length < 5)
  {
    alert("Escriba por lo menos 5 caracteres en el campo \"mensaje\".");
    theForm.mensaje.focus();
    return (false);
  }

  if (theForm.mensaje.value.length > 1000)
  {
    alert("Escriba como máximo 1000 caracteres en el campo \"mensaje\".");
    theForm.mensaje.focus();
    return (false);
  }
  return (true);
}