<!--
  var aFinMes = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
  function finMes(nMes, nAno){
   return aFinMes[nMes - 1] + (((nMes == 2) && (nAno % 4) == 0)? 1: 0);
  }

   function padNmb(nStr, nLen, sChr){
    var sRes = String(nStr);
    for (var i = 0; i < nLen - String(nStr).length; i++)
     sRes = sChr + sRes;
    return sRes;
   }


   function makeDateFormat(nDay, nMonth, nYear){
    var sRes;
    sRes = padNmb(nDay, 2, "0") + "/" + padNmb(nMonth, 2, "0") + "/" + padNmb(nYear, 4, "0");
    return sRes;
   }

  function incDate(sFec0){
   var partes_fecha=sFec0.split("/");

   var nDia = parseInt(partes_fecha[0], 10);
   var nMes = parseInt(partes_fecha[1], 10);
   var nAno = parseInt(partes_fecha[2], 10);
   /*
   var nDia = Number(sFec0.substr(0, 2));
   var nMes = Number(sFec0.substr(3, 2));
   var nAno = Number(sFec0.substr(6, 4));
   */
   nDia += 1;
   if (nDia > finMes(nMes, nAno)){
    nDia = 1;
    nMes += 1;
    if (nMes == 13){
     nMes = 1;
     nAno += 1;
    }
   }
   return makeDateFormat(nDia, nMes, nAno);
  }

  function decDate(sFec0){
   var partes_fecha=sFec0.split("/");

   var nDia = parseInt(partes_fecha[0], 10);
   var nMes = parseInt(partes_fecha[1], 10);
   var nAno = parseInt(partes_fecha[2], 10);
   /*
   var nDia = Number(sFec0.substr(0, 2));
   var nMes = Number(sFec0.substr(3, 2));
   var nAno = Number(sFec0.substr(6, 4));
   */
   nDia -= 1;
   if (nDia == 0){
    nMes -= 1;
    if (nMes == 0){
     nMes = 12;
     nAno -= 1;
    }
    nDia = finMes(nMes, nAno);
   }
   return makeDateFormat(nDia, nMes, nAno);
  }

  function addToDate(sFec0, sInc){
   var nInc = Math.abs(parseInt(sInc));
   var sRes = sFec0;
   if (parseInt(sInc) >= 0)
    for (var i = 0; i < nInc; i++) sRes = incDate(sRes);
   else
    for (var i = 0; i < nInc; i++) sRes = decDate(sRes);
   return sRes;
  } 
function abrirVentana(link, nombre, w, h, scroll) {
				var winl = (screen.width - w) / 2;
				var wint = (screen.height - h) / 5;
				winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no'
				win = window.open(link, nombre, winprops)
				if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
			}

if (self != top) { 
if (document.images)
top.location.replace(window.location.href);
else
top.location.href = window.location.href;
}
//-->


function Form1_Validator(theForm)
{
   if (theForm.NOMBRE.value == "")
  {
    alert("Escriba su nombre");
    theForm.NOMBRE.focus();
    return (false);
  }

  if (theForm.NOMBRE.value.length < 3)
  {
    alert("Escriba por lo menos 3 caracteres en el campo \"NOMBRE\".");
    theForm.NOMBRE.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZabcdefghijklmnñopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \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 letras y espacios en el campo \"NOMBRE\".");
    theForm.NOMBRE.focus();
    return (false);
  }

     
  if (theForm.CORREO.value.length < 5)
  {
    alert("E-mail no válido");
    theForm.CORREO.focus();
    return (false);
  }

  if (theForm.TELEFONO.value == "")
  {
    alert("Escriba un valor para el campo \"TELEFONO\".");
    theForm.TELEFONO.focus();
    return (false);
  }

		

  if (theForm.TELEFONO.value == "")
  {
    alert("Escriba un valor para el campo \"TELEFONO\".");
    theForm.TELEFONO.focus();
    return (false);
  }

  if (theForm.TELEFONO.value.length < 9)
  {
    alert("Escriba por lo menos 9 caracteres en el campo \"TELEFONO\".");
    theForm.TELEFONO.focus();
    return (false);
  }

  if (theForm.TELEFONO.value.length > 14)
  {
    alert("Escriba como máximo 14 caracteres en el campo \"TELEFONO\".");
    theForm.TELEFONO.focus();
    return (false);
  }

  var checkOK = "0123456789-.";
  var checkStr = theForm.TELEFONO.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
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Escriba sólo dígito caracteres en el campo \"TELEFONO\".");
    theForm.TELEFONO.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("Escriba un número válido en el campo \"TELEFONO\".");
    theForm.TELEFONO.focus();
    return (false);
  }

  if (theForm.fecha_entrada.value == "")
  {
    alert("Seleccione dia de entrada \"fecha_entrada\".");
    theForm.fecha_entrada.focus();
    return (false);
  }

  if (theForm.fecha_entrada.value.length < 5)
  {
    alert("Seleccione una fecha de entrada válida \"fecha_entrada\".");
    theForm.fecha_entrada.focus();
    return (false);
  }

  if (theForm.fecha_salida.value == "")
  {
    alert("Seleccione dia de salida \"fecha_salida\".");
    theForm.fecha_salida.focus();
    return (false);
  }

  if (theForm.fecha_salida.value.length < 5)
  {
    alert("Seleccione una fecha de entrada válida \"fecha_salida\".");
    theForm.fecha_salida.focus();
    return (false);
  }
 
  if (theForm.PERSONAS.value == "")
  {
    alert("Escriba un valor para el campo \"PERSONAS\".");
    theForm.PERSONAS.focus();
    return (false);
  }

  if (theForm.PERSONAS.value.length < 1)
  {
    alert("Escriba por lo menos 1 caracteres en el campo \"PERSONAS\".");
    theForm.PERSONAS.focus();
    return (false);
  }

  if (theForm.PERSONAS.value.length > 2)
  {
    alert("Escriba como máximo 2 caracteres en el campo \"PERSONAS\".");
    theForm.PERSONAS.focus();
    return (false);
  }

  var checkOK = "0123456789-,";
  var checkStr = theForm.PERSONAS.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
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Escriba sólo dígito caracteres en el campo \"PERSONAS\".");
    theForm.PERSONAS.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("Escriba un número válido en el campo \"PERSONAS\".");
    theForm.PERSONAS.focus();
    return (false);
  }
  return (true);
}
