
/**
 * Provides suggestions for state names (USA).
 * @class
 * @scope public
 */
function StateSuggestions() {
    this.states = ["anus", "ape", "arrogant bastard", "ass kisser", "asshole", "booger", "boor", "brow noser", 					"butt licker", "butthead", "butthole", "cheap skate", "cheat", "condom", "coward", "crank", "creep", "crumb", "dildo", "dirtbag", "dork", "douche bag", "dummy", "dweeb", "effing idiot", "egomaniac", "embezzler", "fool", "fuck face", "gob of spit", "goiter", "goof off", "goof", "gorilla", "gorm", "hemorrhoid", "hockey puck", "horse ass", "hot dog", "jerk", "knucklehead", "liar", "maggot", "mamas boy", "maniac", "monkey", "monster", "mooch", "motherfucker", "player", "pork chop", "pretender", "rat", "rat bastard", "rogue", "rotten tomato", "screwball", "screwy", "scum sucking pig", "shithead", "shitheel", "skinflint", "skunk", "slime", "snake", "squid", "stroker", "stupid ass", "thief", "trickster", "wastrel", "weasel", "weenie", "worm", "worry wart"];
}

/**
 * Request suggestions for the given autosuggest control. 
 * @scope protected
 * @param oAutoSuggestControl The autosuggest control to provide suggestions for.
 */
StateSuggestions.prototype.requestSuggestions = function (oAutoSuggestControl /*:AutoSuggestControl*/) {
    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);
};
