Hard to say without downloading and building the entire code locally, but I can tell you that the following jQuery method isn't getting correctly applied to the header links that are being returned from the second call to getPageData (i.e., the call that is made when you click on the header the first time). Instead the link on the .header a
element is simply going directly to the server to get the JSON result. I would start there.
$(".header a").live("click", function (e) {
var Parameters = e.target.search;
var sort = getParameterByName("sort", Parameters);
var sortdir = getParameterByName("sortdir", Parameters);
$("#hdnSort").val(sort);
$("#hdnSortDir").val(sortdir);
getPageData(e, d, "First");
return false;
});