﻿function moveFocus(key, box1Id, box2Id) {
    box1 = document.getElementById(box1Id);
    box2 = document.getElementById(box2Id);
    if (box1 != null) {
        //if (isNaN(parseInt(box1.value))) {
        if ((key > 47 && key < 58) || (key > 95 && key < 106)) {
            if (key > 95)
                key = key - 48;
            box1.value = String.fromCharCode(key);
            if (box2 != null) {
                box2.focus();  
            }    
        }
        else {
            box1.value = '';
        }
    }
}