
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.Nombre.value == "")
  {
    alert("Escriba un valor para el campo \"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.Apellido1.value == "")
  {
    alert("Escriba un valor para el campo \"Apellido1\".");
    theForm.Apellido1.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ \t\r\n\f";
  var checkStr = theForm.Apellido1.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 \"Apellido1\".");
    theForm.Apellido1.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ \t\r\n\f";
  var checkStr = theForm.Apellido2.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 \"Apellido2\".");
    theForm.Apellido2.focus();
    return (false);
  }

  if (theForm.sexo.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"sexo\".");
    theForm.sexo.focus();
    return (false);
  }

  if (theForm.sexo.selectedIndex == 0)
  {
    alert("La primera opción \"sexo\" no es válida. Elija una de las otras opciones.");
    theForm.sexo.focus();
    return (false);
  }

  if (theForm.edad.value == "")
  {
    alert("Escriba un valor para el campo \"edad\".");
    theForm.edad.focus();
    return (false);
  }

  var checkOK = "0123456789-,.";
  var checkStr = theForm.edad.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  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 (ch == ",")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ".")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Escriba sólo dígito caracteres en el campo \"edad\".");
    theForm.edad.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("Escriba un número válido en el campo \"edad\".");
    theForm.edad.focus();
    return (false);
  }

  var chkVal = allNum;
  var prsVal = parseFloat(allNum);
  if (chkVal != "" && !(prsVal > "17" && prsVal <= "100"))
  {
    alert("Escriba un valor mayor que \"17\" y menor o igual que \"100\" en el campo \"edad\".");
    theForm.edad.focus();
    return (false);
  }

  if (theForm.domicilio.value == "")
  {
    alert("Escriba un valor para el campo \"domicilio\".");
    theForm.domicilio.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789--ºª\\/() \t\r\n\f";
  var checkStr = theForm.domicilio.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 \"domicilio\".");
    theForm.domicilio.focus();
    return (false);
  }

  if (theForm.ciudad.value == "")
  {
    alert("Escriba un valor para el campo \"ciudad\".");
    theForm.ciudad.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ \t\r\n\f";
  var checkStr = theForm.ciudad.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 \"ciudad\".");
    theForm.ciudad.focus();
    return (false);
  }

  if (theForm.cp.value == "")
  {
    alert("Escriba un valor para el campo \"cp\".");
    theForm.cp.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.cp.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 dígito caracteres en el campo \"cp\".");
    theForm.cp.focus();
    return (false);
  }

  if (theForm.pais.value == "")
  {
    alert("Escriba un valor para el campo \"pais\".");
    theForm.pais.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ \t\r\n\f";
  var checkStr = theForm.pais.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 \"pais\".");
    theForm.pais.focus();
    return (false);
  }

  if (theForm.pasaporte.value == "")
  {
    alert("Escriba un valor para el campo \"pasaporte\".");
    theForm.pasaporte.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789--";
  var checkStr = theForm.pasaporte.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 \"-\" caracteres en el campo \"pasaporte\".");
    theForm.pasaporte.focus();
    return (false);
  }

  if (theForm.telf.value == "")
  {
    alert("Escriba un valor para el campo \"telf\".");
    theForm.telf.focus();
    return (false);
  }

  var checkOK = "0123456789--";
  var checkStr = theForm.telf.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 dígito y \"-\" caracteres en el campo \"telf\".");
    theForm.telf.focus();
    return (false);
  }

  if (theForm.email.value == "")
  {
    alert("Escriba un valor para el campo \"email\".");
    theForm.email.focus();
    return (false);
  }

  if (theForm.motivo.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"motivo\".");
    theForm.motivo.focus();
    return (false);
  }

  if (theForm.motivo.selectedIndex == 0)
  {
    alert("La primera opción \"motivo\" no es válida. Elija una de las otras opciones.");
    theForm.motivo.focus();
    return (false);
  }

  if (theForm.llegada.value == "")
  {
    alert("Escriba un valor para el campo \"llegada\".");
    theForm.llegada.focus();
    return (false);
  }

  var checkOK = "0123456789--/";
  var checkStr = theForm.llegada.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 dígito y \"-/\" caracteres en el campo \"llegada\".");
    theForm.llegada.focus();
    return (false);
  }

  if (theForm.regreso.value == "")
  {
    alert("Escriba un valor para el campo \"regreso\".");
    theForm.regreso.focus();
    return (false);
  }

  var checkOK = "0123456789--/";
  var checkStr = theForm.regreso.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 dígito y \"-/\" caracteres en el campo \"regreso\".");
    theForm.regreso.focus();
    return (false);
  }

  if (theForm.habi.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"habi\".");
    theForm.habi.focus();
    return (false);
  }

  if (theForm.habi.selectedIndex == 0)
  {
    alert("La primera opción \"habi\" no es válida. Elija una de las otras opciones.");
    theForm.habi.focus();
    return (false);
  }

  if (theForm.uniorigen.value == "")
  {
    alert("Escriba un valor para el campo \"uniorigen\".");
    theForm.uniorigen.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ \t\r\n\f";
  var checkStr = theForm.uniorigen.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 \"uniorigen\".");
    theForm.uniorigen.focus();
    return (false);
  }

  if (theForm.ciudadorigen.value == "")
  {
    alert("Escriba un valor para el campo \"ciudadorigen\".");
    theForm.ciudadorigen.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ \t\r\n\f";
  var checkStr = theForm.ciudadorigen.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 \"ciudadorigen\".");
    theForm.ciudadorigen.focus();
    return (false);
  }

  if (theForm.unidestino.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"unidestino\".");
    theForm.unidestino.focus();
    return (false);
  }

  if (theForm.unidestino.selectedIndex == 0)
  {
    alert("La primera opción \"unidestino\" no es válida. Elija una de las otras opciones.");
    theForm.unidestino.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ \t\r\n\f";
  var checkStr = theForm.facudestino.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 \"facudestino\".");
    theForm.facudestino.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ \t\r\n\f";
  var checkStr = theForm.tutor.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 \"tutor\".");
    theForm.tutor.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789--";
  var checkStr = theForm.telftutor.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 \"-\" caracteres en el campo \"telftutor\".");
    theForm.telftutor.focus();
    return (false);
  }
  return (true);
}


