<!-- In-memory JS array begins-->
YAHOO.gs.citiesArray = [
        ["Alameda, CA"],
        ["Albany, CA"],
        ["American Canyon, CA"],
        ["Antioch, CA"],
        ["Atherton, CA"],
        ["Belmont, CA"],
        ["Belvedere, CA"],
        ["Benicia, CA"],
        ["Berkeley, CA"],
        ["Brentwood, CA"],
        ["Brisbane, CA"],
        ["Burlingame, CA"],
        ["Calistoga, CA"],
        ["Campbell, CA"],
        ["Clayton, CA"],
        ["Cloverdale, CA"],
        ["Colma, CA"],
        ["Concord, CA"],
        ["Corte Madera, CA"],
        ["Cotati, CA"],
        ["Cupertino, CA"],
        ["Daly City, CA"],
        ["Danville, CA"],
        ["Dixon, CA"],
        ["Dublin, CA"],
        ["East Palo Alto, CA"],
        ["El Cerrito, CA"],
        ["Emeryville, CA"],
        ["Fairfax, CA"],
        ["Fairfield, CA"],
        ["Foster City, CA"],
        ["Fremont, CA"],
        ["Gilroy, CA"],
        ["Half Moon Bay, CA"],
        ["Hayward, CA"],
        ["Healdsburg, CA"],
        ["Hercules, CA"],
        ["Hillsborough, CA"],
        ["Lafayette, CA"],
        ["Larkspur, CA"],
        ["Livermore, CA"],
        ["Los Altos, CA"],
        ["Los Altos Hills, CA"],
        ["Los Gatos, CA"],
        ["Martinez, CA"],
        ["Menlo Park, CA"],
        ["Mill Valley, CA"],
        ["Millbrae, CA"],
        ["Milpitas, CA"],
        ["Monte Sereno, CA"],
        ["Moraga, CA"],
        ["Morgan Hill, CA"],
        ["Mountain View, CA"],
        ["Napa, CA"],
        ["Newark, CA"],
        ["Novato, CA"],
        ["Oakland, CA"],
        ["Oakley, CA"],
        ["Orinda, CA"],
        ["Pacifica, CA"],
        ["Palo Alto, CA"],
        ["Petaluma, CA"],
        ["Piedmont, CA"],
        ["Pinole, CA"],
        ["Pittsburg, CA"],
        ["Pleasant Hill, CA"],
        ["Pleasanton, CA"],
        ["Portola Valley, CA"],
        ["Redwood City, CA"],
        ["Richmond, CA"],
        ["Rio Vista, CA"],
        ["Rohnert Park, CA"],
        ["Ross, CA"],
        ["St. Helena, CA"],
        ["San Anselmo, CA"],
        ["San Bruno, CA"],
        ["San Carlos, CA"],
        ["San Francisco, CA"],
        ["San Jose, CA"],
        ["San Leandro, CA"],
        ["San Mateo, CA"],
        ["San Pablo, CA"],
        ["San Ramon, CA"],
        ["San Rafael, CA"],
        ["Santa Clara, CA"],
        ["Santa Rosa, CA"],
        ["Saratoga, CA"],
        ["Sausalito, CA"],
        ["Sebastopol, CA"],
        ["Sonoma, CA"],
        ["South San Francisco, CA"],
        ["Suisun City, CA"],
        ["Sunnyvale, CA"],
        ["Tiburon, CA"],
        ["Union City, CA"],
        ["Vacaville, CA"],
        ["Vallejo, CA"],
        ["Walnut Creek, CA"],
        ["Windsor, CA"],
        ["Woodside, CA"],
        ["Yountville, CA"]
        ];

YAHOO.gs.areacodesArray = [
        ["Burger"],
        ["Pizza"],
        ["Gas Station"],
        ["Bar"],
        ["Chinese Restaurant"],
        ["Coffee Shop"],
        ["Delivery"],
        ["Drive Through"],
        ["Sandwich"],
        ["Starbucks"],
        ["Chicken Wing"]
        ["Coffee shop"],
        ["Indian"],
        ["Fast Food"],
        ["Supermarket"],
        ["Bakery"],
        ["Lunch Special"],
        ["Delivery"],
        ["Catering"],
        ["Happy Hour"],
        ["Drive Thru"],
        ['Restaurant'],
        ["Starbucks"],
        ["Gryos"],
        ["Onion Rings"],
        ["Hotel"],
        ["BBQ"]
        ];

YAHOO.gs.timeCodesArray = [
        ["Anytime"],
        ["Now"],
        ["After 10pm"],
        ["Noon"],
        ["Everyday"],
        ];
<!-- In-memory JS array ends-->

YAHOO.example.ACJSArray = new function() {
    // Instantiate first JS Array DataSource
    this.oACDS = new YAHOO.widget.DS_JSArray(YAHOO.gs.citiesArray);

    // Instantiate first AutoComplete
    this.oAutoComp = new YAHOO.widget.AutoComplete('where', 'wherecontainer', this.oACDS);
    this.oAutoComp.prehighlightClassName = "yui-ac-prehighlight";
    this.oAutoComp.typeAhead = false;
    this.oAutoComp.useShadow = true;
    this.oAutoComp.minQueryLength = 0;
    this.oAutoComp.textboxFocusEvent.subscribe(function() {
        var sInputValue = YAHOO.util.Dom.get('where').value;
        if (sInputValue.length === 0) {
            var oSelf = this;
            setTimeout(function() {
                oSelf.sendQuery(sInputValue);
            }, 0);
        }
    });

    // Instantiate second JS Array DataSource
    this.oACDS2 = new YAHOO.widget.DS_JSArray(YAHOO.gs.areacodesArray);

    // Instantiate second AutoComplete
    this.oAutoComp2 = new YAHOO.widget.AutoComplete('what', 'whatcontainer', this.oACDS2);
    this.oAutoComp2.prehighlightClassName = "yui-ac-prehighlight";
    this.oAutoComp2.typeAhead = false;
    this.oAutoComp2.useShadow = true;
    this.oAutoComp2.forceSelection = false;
    this.oAutoComp2.formatResult = function(oResultItem, sQuery) {
        var sMarkup = oResultItem[0];
        return (sMarkup);
    };

 
 this.oACDS3 = new YAHOO.widget.DS_JSArray(YAHOO.gs.timeCodesArray);
    this.oAutoComp3 = new YAHOO.widget.AutoComplete('when', 'whencontainer', this.oACDS3);
    this.oAutoComp3.prehighlightClassName = "yui-ac-prehighlight";
   this.oAutoComp3.typeAhead = false;
    this.oAutoComp3.useShadow = true;
    this.oAutoComp3.minQueryLength = 0;
    this.oAutoComp3.textboxFocusEvent.subscribe(function() {
        var sInputValue = YAHOO.util.Dom.get('when').value;
        if (sInputValue.length === 0) {
            var oSelf = this;
            setTimeout(function() {
                oSelf.sendQuery(sInputValue);
            }, 0);
        }
    });
};


