
/**
 * Provides suggestions for state names (USA).
 * @class
 * @scope public
 */
function StateSuggestions() {
    this.states = [
        "A", "a", 
		"B", "b", "Be", "be",  
        "C", "c", "Cigeretts", "cigeretts",
        "D", "d", "Dark Prety", "dark prety", "Depression", "depression",
        "E", "e", "Elvin", "elvin",
		"F", "f", 
		"G", "g", "Gone", "gone",
		"H", "h",
		"I", "i", "I'll", "i'll",
		"J", "j",    
		"K", "k", "Kiss", "kiss",
		"L", "l", "Let", "let", "Lights", "lights",
        "M", "m", "Mom", "m", "make", 
        "N", "n", 
        "O", "o", 
        "P", "p", "Pennys", "pennys",
		"Q", "q",
        "R", "r",
		"S", "S",
		"T", " t", "Troll", "troll", "Tower", 
        "W", "w", "War", "Wyoming"  , "war" ,
		"X", "x", 
		"Y", "y", 
		"Z", "z"
    ];
}

/**
 * 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*/) {
    var aSuggestions = [];
    var sTextboxValue = oAutoSuggestControl.textbox.value;
    
    if (sTextboxValue.length > 0){
    
        //search for matching states
        for (var i=0; i < this.states.length; i++) { 
            if (this.states[i].indexOf(sTextboxValue) == 0) {
                aSuggestions.push(this.states[i]);
            } 
        }
    }

    //provide suggestions to the control
    oAutoSuggestControl.autosuggest(aSuggestions, bTypeAhead);
};