AJAX to an array question

AJAX to an array question

Im a fairly new user of jquery but have been doing php, mysql and basic javascript for a while. What im trying to accomplish is this:

I have a site that processes vast amounts of financial data and then displays the results for the user. There are about 5000 items that need to processed in this way. I originally did it in a single php script which took foreever to execute and with no real indication to the user as to what was going on. So i decided to try processing each item individually by calling a php script. this script returns a string of all the data needed to display to the user. Here's the catch.

I need jquery to take that data, create an array of objects with the data for each of these items, and then sort that array on one of the parameters. Then render the top 25 objects to a table for the end user. I can accomplish all this except i cannot figure out a way to display to the user that a script is actually executing so they dont think it has just timed out. Here's my code so far(forgive the messing string parsing):

  1. function GetValues(url) {
  2.       var result = null;
  3.       $('#loading').append('Loading Message');
  4.       $.ajax({
  5.             type: 'GET',
  6.             url: url,
  7.             datatype: 'text',
  8.             async: false,
  9.             success: function(data){
  10.                   result = data;
  11.             }
  12.       });
  13.       return result;
  14. }

  15. function displayData() {
  16. for(var i = 0; i < itemArray.length; i++) {

  17.       var results = GetValues('data.php');
  18.       results = results.replace("<tr>", "");
  19.       results = results.replace("</tr>", "");
  20.       for(var j = 0; j < 8; j++)
  21.             results = results.replace("</td>", "");
  22.       newArray = results.split('<td>');
  23.       items[items.length] = new itemObj(newArray[1], 
  24.                                                          newArray[2], 
  25.                                                          newArray[3], 
  26.                                                          newArray[4],
  27.                                                          newArray[5], 
  28.                                                          newArray[6], 
  29.                                                          newArray[7], 
  30.                                                         newArray[8]);
  31. }
  32. sortedItems = items.sort(compareItems);
  33.       for(var i = 0; i < 25; i++) {
  34.             if(i%2 == 0) {
  35. tableString = '<tr class="even"><td>'+sortedItems[i].itemName+'</td>'+
  36.  '<td>'+sortedItems[i].roi+'</td>'+
  37.  '<td>'+sortedItems[i].profit+'</td>'+
  38.  '<td>'+sortedItems[i].profitVolume+'</td>'+
  39.  '<td>'+sortedItems[i].profitVelocity+'</td>'+
  40.  '<td>'+sortedItems[i].quantity+'</td>'+
  41.  '<td>'+sortedItems[i].sellPrice+'</td>'+
  42.  '<td>'+sortedItems[i].buyPrice+'</td></tr>';
  43.             } else {
  44. tableString = '<tr class="odd"><td>'+sortedItems[i].itemName+'</td>'+
  45.  '<td>'+sortedItems[i].roi+'</td>'+
  46.  '<td>'+sortedItems[i].profit+'</td>'+
  47.  '<td>'+sortedItems[i].profitVolume+'</td>'+
  48.  '<td>'+sortedItems[i].profitVelocity+'</td>'+
  49.  '<td>'+sortedItems[i].quantity+'</td>'+
  50.  '<td>'+sortedItems[i].sellPrice+'</td>'+
  51.  '<td>'+sortedItems[i].buyPrice+'</td></tr>';
  52.             }
  53.             $('#data tr:last').after(tableString); 
  54. }
  55. }