   var code=0;   // the entered code                   /* El Código entrado
    var add=0;
  var digit=0;
    function Enter_code(number)
    {   
      code=code*10+number ;        // Add the digit to the code  /* Agrega el dígito al código
      add=add+ number;
      digit++;
        if (digit==13){
           alert("Máximo 12 números gracias.");
            document.codepad.thecode.value=""; 
            code=0;
            add=0;
            digit=0;  
                             }
          else{
      document.codepad.thecode.value=code;  // Show code         /* Muestra el Código   
                }
      
    }    
   function buscar()   
   {        
                              if (add <= 22)
                                      location=add+".htm";  
                                      else
                                            while (add > 22)
                                       {   
                                          add = add - 22;
                                          if (add <= 22)
                                                              location=add+".htm";
                                           }   
                                                                               
   }