<!--
// simplistic check for browser type (NN or "other")
var isNN = (navigator.appName.indexOf("Netscape") != -1);

/*
autoTab() - moves focus to next entry field when current field has max characters entered
*/
function autoTab(doc, len, e, nextField) {
  var keyCode     = (isNN) ? e.which : e.keyCode;
  var arrKeyCodes = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];

  if ((doc.value.length >= len) && (!containsElement(arrKeyCodes,keyCode))) {
    doc.value = doc.value.slice(0, len);
    doc.form[nextField].focus();
    doc.form[nextField].select();
  }

  return true;
}

/*
checks for keycode (indicates which key was pressed)
*/
function containsElement(arrKeyCodes, keyCode) {
  var found = false;
  var index = 0;

  while (!found && (index < arrKeyCodes.length)) {
    if (arrKeyCodes[index] == keyCode) {
      found = true;
    }
    else {
      index++;
    }
  }

  return found;
}
//-->