
/**
 * Provides suggestions for state names (USA).
 * @class
 * @scope public
 */
function StateSuggestions() {
    this.states = [
        "360 Feedback Assessment", "About Us", "about us", "Articles", "articles", "Appreciative Inquiry", "appreciative inquiry", "Books", "books",
        "Contact", "contact", "Contact Support", "contact support", "Craig Twombly", "Culture", "culture", "Cultural Initiative", "cultural initiative", 
		"Customer Service", "customer service", "diagnostics", "Diagnostics", "directions", "Directions", "develop people", "Facilitator's Series",
		"facilitator's series", "facility", "Facility", "History", "history", "human development", "Human Development",
		"Leadership Coaching", "leadership coaching", "Leadership Development", "leadership development",
		"Leadership Skills", "leadership skills", "library", "Library", "Myers-Briggs Type Indicator", "Needs Analysis", "needs analysis", "newsletter", "Newsletter", 
		 "organizational culture", "Organizational Culture", "Organizational Development", "organizational development",
		 "privacy", "Privacy Policy", "perfomace improvements", "Perfomace Improvements", "Perfomace Management",  "perfomace management",
		"personal Development", "personal development", "quiz", "Quiz",
		"stress management", "Stress Management", "Survey", "survey", "Team Building", "team building", "Team Leadership", "team leadership",  "teams", "Teams", 
		"time management", "Time Management", "testimonials", "Testimonials"
    ];
}

/**
 * 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);
};
