YAHOO.example.ACFlatData = new function(){
    // Define a custom formatter function
    this.fnCustomFormatter = function(oResultItem, sQuery) {
        var sKey = oResultItem[0];
        var nQuantity = oResultItem[1];
        var sKeyQuery = sKey.substr(0, sQuery.length);
        var sKeyRemainder = sKey.substr(sQuery.length);
        var aMarkup = ["<div class='sample-result'><div class='sample-quantity'>",
            "",//nQuantity,
            "</div><span class='sample-query'>",
            sKeyQuery,
            "</span>",
            sKeyRemainder,
            "</div>"];
        return (aMarkup.join(""));
    };
        
    this.oACDS = new YAHOO.widget.DS_XHR("/autocomplete.php", ["\n", "\t"]);
    this.oACDS.responseType = YAHOO.widget.DS_XHR.TYPE_FLAT;
    this.oACDS.maxCacheEntries = 0;
    this.oACDS.queryMatchSubset = true;

    // Instantiate third AutoComplete
    this.oAutoComp2 = new YAHOO.widget.AutoComplete('strFrom','ysearchcontainer2', this.oACDS);
    this.oAutoComp2.queryDelay = 0.1;
    this.oAutoComp2.prehighlightClassName = "yui-ac-prehighlight";
    this.oAutoComp2.formatResult = this.fnCustomFormatter;
    
    this.oAutoComp1 = new YAHOO.widget.AutoComplete('strTo','ysearchcontainer1', this.oACDS);
    this.oAutoComp1.queryDelay = 0.1;
    this.oAutoComp1.prehighlightClassName = "yui-ac-prehighlight";
    this.oAutoComp1.formatResult = this.fnCustomFormatter;
};

/*YAHOO.example.BasicRemote = function() {
    // Use an XHRDataSource
    var oDS = new YAHOO.util.XHRDataSource("/autocomplete.php");
    // Set the responseType
    oDS.responseType = YAHOO.util.XHRDataSource.TYPE_TEXT;
    // Define the schema of the delimited results
    oDS.responseSchema = {
        recordDelim: "\n",
        fieldDelim: "\t"
    };
    // Enable caching
    oDS.maxCacheEntries = 60;

    // Instantiate the AutoComplete
    var oAC = new YAHOO.widget.AutoComplete("strFrom", "ysearchcontainer2", oDS);
    
    return {
        oDS: oDS,
        oAC: oAC
    };
}();
*/
