/**
 * Provides suggestions for gifts 
 * @class
 * @scope public
 */
function GiftSuggestions() {
    this.gift = [
"123together.com news",
"About 123together.com",
"blackberry enterprise",
"blackberry enterprise server",
"bes",
"blackberry hosting",
"blackberry on exchange",
"blackberry hosted exchange",
"contact 123together.com",
"contact support",
"contact sales",
"demo hosted exchange",
"demo exchange hosting",
"demo owa",
"email mobility",
"email hosting",
"email for business",
"email for my domain",
"email on my domain",
"email archiving",
"guarddoc",
"guarddoc email archiving",
"guarddoc archiving",
"guarddoc archiving for compliance",
"basic email archiving",
"archiving for compliance",
"anti-spam",
"anti-spam solution",
"activesync",
"activesync for iPhone",
"activesync for Palm Pre",
"activesync for Windows Mobile",
"iphone on exchange",
"iphone 3G on exchange",
"palm Pre on exchange",
"Windows mobile on exchange",
"good",
"good messaging server",
"goodlink server",
"owa",
"owa demo",
"outlook web access",
"microsoft outlook",
"microsoft crm",
"microsoft dynamics",
"microsoft sharepoint",
"microsoft exchange",
"microsoft exchange server",
"free outlook",
"free outlook license",
"free ms outlook",
"outlook free",
"trial",
"pricing",
"crm pricing",
"crm for sales",
"crm for marketing",
"crm for customer service",
"exchange pricing",
"exchange hosted",
"exchange hosting",
"exchange hosting plans",
"exchange host",
"exchange server status",
"exchange 2003",
"exchange 2007",
"exchange white papers",
"archiving pricing",
"pricing crm",
"pricing exchange",
"pricing archiving",
"dynamics crm",
"dynamics crm hosted",
"exchange hosting",
"sharepoint hosting",
"sharepoint pricing",
"sharepoint plans",
"sharepoint hosted",
"windows sharepoint services",
"windows sharepoint",
"wss",
"wss templates",
"wss pricing",
"windows sharePoint services templates",
"business email account",
"business exchange hosting",
"business exchange host",
"small business email",
"small business",
"shared hosting",
"dedicated hosting",
"shared exchange",
"dedicated exchange",
"shared calendars",
"public folder",
"resell exchange",
"resell hosted exchange",
"resell hosted exchange",
"resell sharepoint",
"resell crm",
"reselling exchange",
"spam filters exchange",
"spam filtering exchange",
"signup for trial",
"signup for exchange",
"signup for sharepoint",
"signup for crm",
"testimonials",
"award partner of the year",
"partner of the year",
"hosted sharepoint",
"hosted crm",
"hosted dynamics crm",
"hosted exchange server",
"hosted exchange white papers",
"hosted exchange mail",
"hosted exchange 1-9 users",
"hosted exchange 10+ users",
"hosted exchange demo",
"hosted exchange",
"hosted exchange plans",
"webmail",
"pst",
"myarchive",
"mx records",
"entourage",
"entourage 2008",
"server-side spam filter",
"white papers",
"monthly specials",
"special"
   ];
}

/**
 * Request suggestions for the given autosuggest control. 
 * @scope protected
 * @param oAutoSuggestControl The autosuggest control to provide suggestions for.
 */
GiftSuggestions.prototype.requestSuggestions = function (oAutoSuggestControl /*:AutoSuggestControl*/,
                                                          bTypeAhead /*:boolean*/) {
    var aSuggestions = [];
    var sTextboxValue = oAutoSuggestControl.textbox.value;
    
    if (sTextboxValue.length > 0){
    
        //convert value in textbox to lowercase
        var sTextboxValueLC = sTextboxValue.toLowerCase();

        //search for matching gifts
        for (var i=0; i < this.gift.length; i++) { 

            //convert gift name to lowercase
            var sGiftLC = this.gift[i].toLowerCase();
           
            //compare the lowercase versions for case-insensitive comparison
            if (sGiftLC.indexOf(sTextboxValueLC) == 0) {

                //add a suggestion using what's already in the textbox to begin it                
                aSuggestions.push(sTextboxValue + this.gift[i].substring(sTextboxValue.length));
            } 
        }
    }

    //provide suggestions to the control
    oAutoSuggestControl.autosuggest(aSuggestions, bTypeAhead);
};
