/** * Provides suggestions for state names (USA). * @class * @scope public */functionStateSuggestions(text){this.states=text;}/** * Request suggestions for the given autosuggest control. * @scope protected * @param oAutoSuggestControl The autosuggest control to provide suggestions for. */StateSuggestions.prototype.requestSuggestions=function(oAutoSuggestControl/*:AutoSuggestControl*/,bTypeAhead/*:boolean*/){varaSuggestions=[];varsTextboxValue=oAutoSuggestControl.textbox.value;if(sTextboxValue.length>0){//search for matching statesfor(vari=0;i<this.states.length;i++){if(this.states[i].toLowerCase().indexOf(sTextboxValue.toLowerCase())==0){aSuggestions.push(this.states[i]);}}}//provide suggestions to the controloAutoSuggestControl.autosuggest(aSuggestions,bTypeAhead);};