function StateSuggestions() {
    this.states = [
"Barrington",
"Block Island",
"Bristol",
"Charlestown",
"Chepachet",
"Coventry",
"Cranston",
"East Greenwich",
"East Providence",
"Foster",
"Greene",
"Greenville",
"Hope Valley",
"Jamestown",
"Johnston",
"Lincoln",
"Little Compton",
"Middletown",
"Narragansett",
"Newport",
"North Kingstown",
"North Providence",
"North Scituate",
"North Smithfield",
"Pawtucket",
"Portsmouth",
"Providence",
"Rumford",
"Saunderstown",
"Smithfield",
"Tiverton",
"Wakefield",
"Warren",
"Warwick",
"West Greenwich",
"West Kingston",
"West Warwick",
"Westerly",
"Woonsocket",
"Wyoming"];
}

StateSuggestions.prototype.requestSuggestions = function (oAutoSuggestControl /*:AutoSuggestControl*/,
                                                          bTypeAhead /*:boolean*/) {
    var aSuggestions = [];
    var sTextboxValue = oAutoSuggestControl.textbox.value;
    
    if (sTextboxValue.length > 0){
    	topsuggestion = null;
        for (var i=0; i < this.states.length; i++) { 
            if (this.states[i].toLowerCase().indexOf(sTextboxValue.toLowerCase()) == 0) {
                aSuggestions.push(this.states[i]);
		if (!topsuggestion) {topsuggestion = this.states[i];}
            } 
        }
    }

    oAutoSuggestControl.autosuggest(aSuggestions, bTypeAhead);
};

