<!--
var tabStatus = true;

function autoTab(targetClass) {
  if (!document.getElementsByTagName) {return null;}
  var listArray = document.getElementsByTagName("li");
  for (i = 0; i < listArray.length; i++) {
    if (listArray[i].className == targetClass) {
      var inputArray = listArray[i].getElementsByTagName("input");
      for (j = 0; j < inputArray.length; j++) {
        inputArray[j].onfocus = focusClear;
        inputArray[j].onkeyup = characterValidate;
        inputArray[j].onblur = dateValidate;
      }
    }
  }
}

function characterValidate() {
  var newInput = '';
  for (i = 0; i < this.value.length; i++) {
    var charValue = parseInt(this.value.charAt(i));
    if (charValue >= 0 && charValue <= 9) {
      newInput += this.value.charAt(i);
      if (i == this.value.length)
      this.value = newInput;
    }
    else if (i != 0 && this.value.charAt(i) == '/' || this.value.charAt(i) == '-') {
      this.value = newInput;
      shiftFocus(this);
    }
    else this.value = newInput;
  }
  if (this.value.length == this.getAttribute('maxlength') && this.getAttribute('maxlength') != 4)
  {shiftFocus(this);}
}

function dateValidate() {
  if (this.getAttribute('maxlength') == 2) {
    if (this.value.length == 1) {
      this.value = "0" + this.value;
    }
  }
  else if (this.getAttribute('maxlength') == 4) {
    if (this.value.length == 2) {
      var currentDate = new Date();
      var year = currentDate.getYear();
      if (currentDate.getYear() < 1900)
        year += 1900;
      if (this.value <= year - 1998) {
        this.value = "20" + this.value;
      }
      else {
        this.value = "19" + this.value;
      }
    }
  }
  defaultReset(this);
  if(focusClass)
  this.className = null;
}

function defaultReset(origin) {
  if (origin.value == '')
  origin.value = origin.defaultValue;
}

function focusClear() {
  this.value = '';
  if(focusClass)
  this.className = focusClass;
}

function shiftFocus(origin) {
  var inputs = document.getElementsByTagName("input");
  for (i = 0; i < inputs.length; i++) {
    if (inputs[i] == origin) {
      i++;
      inputs[i].value = '';
      tabStatus = !tabStatus;
      inputs[i].focus();
      setTimeout(tabToggle, 500);
    }
  }
}

function tabToggle() {
  tabStatus = !tabStatus;
}

function noTab() {
  if (event.keyCode == 9 && tabStatus == false)  {return false;}
}
-->
