function aaa(query,execGlobalCall) {
    YAHOO.example.XHR_JSON = function() {
        var formatUrl = function(elCell, oRecord, oColumn, sData) {
            elCell.innerHTML = "<a href='" + oRecord.getData("ClickUrl") + "' target='_blank'>" + sData + "</a>";
        };

        var myColumnDefs = [
            {key:"tid", label:"", sortable:false,formatter:formatUrl,width:30},
            {key:"Supplier", label:langSupplier,sortable:true, formatter:formatUrl,width:180},
            {key:"SupplierType", label:langSupplierType, sortable:true,width:293 },
            {key:"Address", label:langAddress,sortable:true,width:238},
            {key:"distance", label:langDistance+" ("+distAbv+")",sortable:true}
        ];

        var myDataSource = new YAHOO.util.DataSource("/map/json");
        myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
        myDataSource.connXhrMode = "queueRequests";
        myDataSource.responseSchema = {
            resultsList: "ResultSet.Result",
            fields: ["tid","Supplier","SupplierType","Address","distance"]
        };

        var myConfig = {
           initialRequest: "?"+query, // Initial request for first page of data                           
           sortedBy : {key:"distance", dir:YAHOO.widget.DataTable.CLASS_ASC}, // Sets UI initial sort arrow
           height: "auto"
        }

        var myDataTable = new YAHOO.widget.ScrollingDataTable("json", myColumnDefs,             
                myDataSource, myConfig);

        var mySuccessHandler = function() {
            this.set("sortedBy", null);
            this.onDataReturnAppendRows.apply(this,arguments);
        };
        var myFailureHandler = function() {
            this.showTableMessage(YAHOO.widget.DataTable.MSG_ERROR, YAHOO.widget.DataTable.CLASS_ERROR);
            this.onDataReturnAppendRows.apply(this,arguments);
        };
        var callbackObj = {
            success : mySuccessHandler,
            failure : myFailureHandler,
            scope : myDataTable
        };
       
         //Note when this was uncommented the sort on the miles worked after one sorting 
         //myDataSource.sendRequest("?"+query,callbackObj);
       
         //Waits to notifiy when data is loaded into grid
         if (execGlobalCall == 1) {
            myDataTable.subscribe("initEvent", function() { globalCall(target,url,pars); });
            document.getElementById('mapSearch').value = 'Search...';
         }

        return {
            oDS: myDataSource,
            oDT: myDataTable
        };

    }();
};

