
/**
 * Provides suggestions for state names (USA).
 * @class
 * @scope public
 */
/* 
Marketing 
it software 
Call Center 
Automobiles 
Accounting / Finance 
sales 
Architect 
graphic designer 
D.T.P Operator 
engineer 
Computer Operator 
human resource management 
computer software 
Auto Cad 
interior designer 
food and facilities management  
hospitality management  
hotel management 
Construction 
web designer 
dancer 
office executive 
office assistant 
hardware engenier 
Computer Operator/Receptionist 
front Office 
sales executive  
teacher 
bpo */

function KeySuggestions() {
    this.keywrd = [
		/* a */
        "automobiles", "accounting / finance", "architect", "auto cad",
		"accountant","asp,vb.net",
		/* b */
		"bpo",
		/* c */
		"call center", "construction", "computer Operator/Receptionist",
		"computer software","ceo",
		/* d */
		"d.t.p operator", "designer",
		/* e */
		"engineer",
		/* f */
		"front office",
		/* g */
		"graphic designer",
		/* h */
		"hardware engenier","hotel management", "hospitality management",
		"human resource management", 
		/* i */
		"it software", "interior designer", "tally",
		/* m */
        "marketing",
		/*n*/
		"networking",
		/* o */
		"office executive","office assistant",
		/* p */
		"php,mysql", "programmer",
		/* s */
		"sales", "sales executive",
		/* t */
		"teacher", "tele caller", 
		/* w */
		"web desiging"
    ];
}

/**
 * Request suggestions for the given autosuggest control. 
 * @scope protected
 * @param oAutoSuggestControl The autosuggest control to provide suggestions for.
 */
KeySuggestions.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.keywrd.length; i++) { 
            if (this.keywrd[i].indexOf(sTextboxValue) == 0) {
                aSuggestions.push(this.keywrd[i]);
            } 
        }
    }

    //provide suggestions to the control
    oAutoSuggestControl.autosuggest(aSuggestions, bTypeAhead);
};
