var dp = 0;
var loadingtext = '<tr><td colspan="4" class="loading">Loading ...</td></tr>';
function updateRates(obj) {
  $('tbody_Conforming').update(loadingtext);
  $('tbody_Jumbo').update(loadingtext);
  //$('tbody_Government').update(loadingtext);
  var splitResultHref = obj.href.split("#");
  var direction = splitResultHref[1];
  if (direction == "up") dp += 5;
  else dp -=5;
  urlC = 'includes/update_rates.php?type=1&dp='+dp;
  urlJ = 'includes/update_rates.php?type=2&dp='+dp;
  //urlG = 'includes/update_rates.php?type=3&dp='+dp;
  new Ajax.Updater('tbody_Conforming', urlC, {method: 'get'});
  new Ajax.Updater('tbody_Jumbo', urlJ, {method: 'get'});
  //new Ajax.Updater('tbody_Government', urlG, {method: 'get'});
  $('downlink').setStyle({display: 'inline'});
  $('uplink').setStyle({display: 'inline'});
  if (dp == 0) $('downlink').setStyle({display: 'none'}); 
  if (dp == 10) $('uplink').setStyle({display: 'none'});
} 

function thisTabRates(obj, display) {
  if (display == 'show') {
    $('greyBoxSorting').setStyle({display: 'inline'});
  } else {
    $('greyBoxSorting').setStyle({display: 'none'});
  }
  return thisTab(obj);
}
