
/**
 * Provides suggestions for state names (USA).
 * @class
 * @scope public
 */
function StateSuggestions() {
    this.states = [
        "software", "development", "documentation", "training", "e-commerce", "lotus notes", "knowledge management", "outsourcing", "business analysis", "internet", "intranet", "e-mail", "project management", "contracting", "communications", "help desk", "web design", "call centre", "training", "testing", "analysis", "IT", "information technology", "Human Resources" , "debt recovery", "crm", "performance management",  "cv tracker", "balance scorecard", "database management", "bond management" , "property", "property management","Security", "System management", "Data storage", "Audit management", "Management console", "Lead and contact management", "management", "Campaign management", "Agent module", "Call management & Reporting","banking software", "banking", "desktop", "desktop support", "networking", "email services", "lotus notes","Recruitment Manager System", "recruitment", "jobs", "job candidates", "interview process", "employee development", "auditing", "internal audit", "IT", "websphere", "project management", "HR", "IBM", "Partnerships", "support", "servers", "services",  "market", "resources", "client", "client management", "corporate", "corporate applications", "core", "java","netbeans", "core", "MQ Series", "Sun Microsystems"    
    ];
}

/**
 * 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);
};
