
/**
 * Provides suggestions for V1 terms.
 * @class
 * @scope public
 */
function SearchSuggestions() {
    this.searchTxt = [
        "agile development", 
		"agile software", 
		"agile life cycle management", 
		"agile tools", 
		"agile software development", 
		"agile project management", 
		"project planning", 
		"scrum", 
		"scrum tools", 
		"agile methodologies", 
		"extreme programming", 
		"dsdm",
		"agile up",
		"buy",
		"see",
		"drive",
		"try",
		"versionone"
    ];
}

/**
 * Request suggestions for the given autosuggest control. 
 * @scope protected
 * @param oAutoSuggestControl The autosuggest control to provide suggestions for.
 */
SearchSuggestions.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.searchTxt.length; i++) { 
            if (this.searchTxt[i].indexOf(sTextboxValue) == 0) {
                aSuggestions.push(this.searchTxt[i]);
            } 
        }
    }

    //provide suggestions to the control
    oAutoSuggestControl.autosuggest(aSuggestions, bTypeAhead);
};
