function atrapar_enter(){
  if (window.event.keyCode==13)
    //document.FormCodEncuesta.submit();
  valido_codigo_voto();
}

function asignar_huella() {
  //alert(huella());
  //alert('xxx');
  document.FormCodEncuesta.conf.value = huella();
  //window.alert(document.form1.conf.value);
}

function valido_codigo_voto() {
  //Valido Codigo de Seguridad
  if (document.FormCodEncuesta.texto_ingresado.value.length < 4) {
	alert("Por favor ingrese los 4 dígitos del \"Código\".");
    document.FormCodEncuesta.texto_ingresado.focus();
    return (false);
  }
  var checkOK = "1234567890";
  var checkStr = document.FormCodEncuesta.texto_ingresado.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 un \"Código\" no válido.");
    document.FormCodEncuesta.texto_ingresado.focus();
    return (false);
  }  
  
  //Si paso esta Ok
  return (true);
}

function proceso_codigo_voto() { 
  var parametro_get='';
  var proc = document.FormCodEncuesta.proc.value;
  var idencuesta1 = document.FormCodEncuesta.idencuesta1.value;
  var idencuesta = document.FormCodEncuesta.idencuesta.value;
  var nrovoto = document.FormCodEncuesta.voto.value;
  var conf = document.FormCodEncuesta.conf.value;
  var texto_ingresado = document.FormCodEncuesta.texto_ingresado.value;
  
  var string_get = "../encuesta/voto.php?idencuesta1="+idencuesta1+"&idencuesta="+idencuesta+"&proc="+proc+"&voto="+nrovoto+"&conf="+conf+"&texto_ingresado="+texto_ingresado;
  //alert(string_get);
  //ingresasPOPComentario(string_get, 484, 413);
  
  //document.FormCodEncuesta.submit();
}
