var typeAheadInfo = {last:0, 
                     accumString:"", 
                     delay:1500,
                     timeout:null, 
                     reset:function() {this.last=0; this.accumString=""}
                    };

function typeAhead() {
   if (window.event && !window.event.ctrlKey) {
      var now = new Date();
      if (typeAheadInfo.accumString == "" || now - typeAheadInfo.last < typeAheadInfo.delay) {
         var evt = window.event;
         var selectElem = evt.srcElement;
         var charCode = evt.keyCode;
         var newChar =  String.fromCharCode(charCode).toUpperCase();
         typeAheadInfo.accumString += newChar;
         var selectOptions = selectElem.options;
         var txt, nearest;
         for (var i = 0; i < selectOptions.length; i++) {
            txt = selectOptions[i].text.toUpperCase();
            nearest = (typeAheadInfo.accumString > 
                       txt.substr(0, typeAheadInfo.accumString.length)) ? i : nearest;
            if (txt.indexOf(typeAheadInfo.accumString) == 0) {
               clearTimeout(typeAheadInfo.timeout);
               typeAheadInfo.last = now;
               typeAheadInfo.timeout = setTimeout("typeAheadInfo.reset()", typeAheadInfo.delay);
               selectElem.selectedIndex = i;
               evt.cancelBubble = true;
               evt.returnValue = false;
               return false;   
            }            
         }
         if (nearest != null) {
            selectElem.selectedIndex = nearest;
         }
      } else {
         clearTimeout(typeAheadInfo.timeout);
      }
      typeAheadInfo.reset();
   }
   return true;
}
