  var htmlDoc;
  var HTMLText = "";
  var dataArray = new Array();
  var fieldArray = new Array();
  var monthArray = new Array();
  monthArray[1] = "January";
  monthArray[2] = "February";
  monthArray[3] = "March";
  monthArray[4] = "April";
  monthArray[5] = "May";
  monthArray[6] = "June";
  monthArray[7] = "July";
  monthArray[8] = "August";
  monthArray[9] = "September";
  monthArray[10] = "October";
  monthArray[11] = "November";
  monthArray[12] = "December";
  
  // Start function when DOM has completely loaded 
  jQuery(document).ready(function(){ 
  
  	// Open the filename being passed file
  	jQuery.get("/rates/data.txt",{},function(htmlDoc){
      //alert(htmlDoc);
      var dataArray = htmlDoc.split("\n");
      
      //sort data into correct sequence, first record [0] is heading information
      for (i=1; i<dataArray.length; i++) {
        for (m=1; m < dataArray.length; m++) {
          if (dataArray[m].substring(0,6) < dataArray[i].substring(0,6)) {
            tempData = dataArray[m];
            dataArray[m] = dataArray[i];
            dataArray[i] = tempData;
          }
        }
      }  
      
      var currentYrMo = "";
      var currentPrice = "";
      var samplePrice100 = 0;
      var samplePrice500 = 0;
      var samplePrice1500 = 0;
      var foundNext = 0;
      var lastChangeYrMo = "";
      var lastChangePrice = "";
      var firstUsedYrMo = "";
      var prevYrMo = "";
      var difference = "";
      for (i=1; i<dataArray.length; i++) {
        fieldArray = dataArray[i].split(",");
        HTMLText += "<tr><td>";
        HTMLText += monthArray[(fieldArray[0].substring(4,6)*1)] + " " + fieldArray[0].substring(0,4);
        HTMLText += "</td><td>";
        HTMLText += fieldArray[1];
        HTMLText += "</td><td>";
        HTMLText += fieldArray[2];
        HTMLText += "</td>";
        if (i == 1) {
          currentYrMo = fieldArray[0];
          currentPrice = fieldArray[1];
          samplePrice100 = (parseFloat(currentPrice) * 100).toFixed(2);
          samplePrice500 = (parseFloat(currentPrice) * 500).toFixed(2);
          samplePrice1500 = (parseFloat(currentPrice) * 1500).toFixed(2);
          prevYrMo = fieldArray[0];
          HTMLText += "<td>* </td>";
        } 
        if (i > 1) {
          if (foundNext == 0) {
            if (currentPrice != fieldArray[1]) {
              foundNext = 1;
              lastChangeYrMo = fieldArray[0];
              lastChangePrice = fieldArray[1];
              firstUsedYrMo = prevYrMo;
              HTMLText += "<td>**</td>";
            }
            prevYrMo = fieldArray[0];
          }
        }
        HTMLText += "</tr>";
      }
      if (currentPrice < lastChangePrice) {
        difference = "decrease";
      } else {
        difference = "increase";
      }
      

      jQuery("#gcrTable #gcrPrice").append(currentPrice);      
      jQuery("#gcrTable #gcrPrice2").append(currentPrice);      
      jQuery("#gcrTable #gcrCost100").append(String(samplePrice100));      
      jQuery("#gcrTable #gcrCost500").append(String(samplePrice500));      
      jQuery("#gcrTable #gcrCost1500").append(String(samplePrice1500));      
      jQuery("#description #lastChangePrice").append(lastChangePrice);
      jQuery("#description #currentPrice").append(currentPrice);
      jQuery("#description #difference").html(difference);
      jQuery("#description #firstMonth").html(monthArray[(firstUsedYrMo.substring(4,6)*1)] + " " + firstUsedYrMo.substring(0,4));
      jQuery("#description #firstMonth2").html(monthArray[(firstUsedYrMo.substring(4,6)*1)] + " " + firstUsedYrMo.substring(0,4));
        
    });
  });

