function inputFormatDate(ctl) {
   var curVal, tDate, newVal = '';
   curVal = ctl.value;
   tDate = new Date(curVal);
   if (!isNaN(tDate)) newVal = formatDate(tDate);
   if (curVal != newVal) ctl.value = newVal;
}
function formatDate(dateVal) {
   with (dateVal) {
      return getMonth() + 1 + '/' + getDate() + '/' + getFullYear();
   }
}
