


	var currentChosen = 1;
	var BACKSPACE = 8;

	function choose(event, inputBox, selectTarget){

	     var toFind = inputBox.value;

	     var keyCode = event.code;

		 if(keyCode == BACKSPACE){
			currentChosen = 1;
	 	 }
			
		 var toFindLCase = toFind.toLowerCase();
	     for(var i = currentChosen; i < selectTarget.options.length; i++){
	    	 
	    	 var optionTextLCase = selectTarget.options[i].text.toLowerCase();
	    	 
		     var firstBit = optionTextLCase.substring(0,toFindLCase.length);
			 if(firstBit == toFindLCase){
			     currentChosen = i;
			     break;
			 }//end if
			 
			 if(isGreater(firstBit, toFindLCase)) {
			     if(i > 1){
			          currentChosen = i - 1;
			     }//end if
			     break;
			 }//end if

	      }//end for
		selectTarget.selectedIndex = currentChosen;
	}//end function

	function isGreater(firstWord, secondWord){

		if(Browser.Platform.name == 'win') {
			firstWord = removeString(firstWord, ' ');
			secondWord = removeString(secondWord, ' ');
		}//end if

	    var firstWordLetter = 0;
		var secondWordLetter = 0;
		for(var i = 0; i < secondWord.length; i = i + 1){
			firstWordLetter = firstWord.charCodeAt(i);
			secondWordLetter = secondWord.charCodeAt(i);
				     
			if(firstWordLetter < secondWordLetter){
				return false;
			}//end if
			if(firstWordLetter > secondWordLetter){
				return true;
			}//end if
				      
		}//end for
		return false;
	}//isGreater()



