Multi Header Table Sort

A table sort that is modified to support multi headers.

HTML

<link rel="stylesheet" href="http://wwwpprd.cardperformancecenter.com/cardreporting/css/site.css">
      <table id='mainrpt' class='tablesorter'>

          
   <tr>
      <td><A href="Daily-Store1048.html"> WEST RIDGE</A></td>
      <td>1048</td>
      <td>5</td>
      <td>12</td>
      <td>16</td>
      <td>75.0%</td>
      <td>78</td>
      <td>78</td>
      <td>100.0%</td>
      <td>78</td>
      <td>100.0%</td>
      <script type='text/javascript'>function showrank1048(){ alert('District Rank: 7\nRegion Rank: 36\nZone Rank: 120\nBrand Rank: 86');}</script>
      <td><a href='javascript:showrank1048()'> 7</a></td>
      <td>87</td>
      <td>135</td>
      <td>64.44%</td>
      <td>135</td>
      <td>64.44%</td>
      <td>87</td>
      <td>521</td>
      <td>16.7%</td>
   </tr>
   <tr class="odd">
      <td><A href="Daily-Store1632.html"> THE LEGENDS</A></td>
      <td>1632</td>
      <td>6</td>
      <td>13</td>
      <td>20</td>
      <td>65.0%</td>
      <td>79</td>
      <td>114</td>
      <td>69.3%</td>
      <td>114</td>
      <td>69.3%</td>
      <script type='text/javascript'>function showrank1632(){ alert('District Rank: 12\nRegion Rank: 69\nZone Rank: 249\nBrand Rank: 90');}</script>
      <td><a href='javascript:showrank1632()'> 12</a></td>
      <td>95</td>
      <td>202</td>
      <td>47.03%</td>
      <td>202</td>
      <td>47.03%</td>
      <td>95</td>
      <td>779</td>
      <td>12.2%</td>
   </tr>
   <tr>
      <td><A href="Daily-Store1634.html"> THE LEGENDS</A></td>
      <td>1634</td>
      <td>10</td>
      <td>38</td>
      <td>36</td>
      <td>105.56%</td>
      <td>219</td>
      <td>208</td>
      <td>105.29%</td>
      <td>208</td>
      <td>105.29%</td>
      <script type='text/javascript'>function showrank1634(){ alert('District Rank: 6\nRegion Rank: 27\nZone Rank: 93\nBrand Rank: 69');}</script>
      <td><a href='javascript:showrank1634()'> 6</a></td>
      <td>236</td>
      <td>372</td>
      <td>63.44%</td>
     ...

JavaScript

/*

        TableSort revisited v5.0 by frequency-decoder.com



        Released under a creative commons Attribution-ShareAlike 2.5 license (http://creativecommons.org/licenses/by-sa/2.5/)



        Please credit frequency decoder in any derivative work - thanks



        You are free:



        * to copy, distribute, display, and perform the work

        * to make derivative works

        * to make commercial use of the work



        Under the following conditions:



                by Attribution.

                --------------

                You must attribute the work in the manner specified by the author or licensor.



                sa

                --

                Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one.



        * For any reuse or distribution, you must make clear to others the license terms of this work.

        * Any of these conditions can be waived if you get permission from the copyright holder.

*/



(function() {

fdTableSort = {

        regExp_Currency:        /^[£$€¥¤]/,

        regExp_Number:          /^(\-)?[0-9]+(\.[0-9]*)?$/,

        pos:                    -1,

        uniqueHash:             1,

        thNode:                 null,

        tableId:                null,

        tableCache:             {},

        tmpCache:               {},

        sortActiveClass:        "sort-active",

        /*@cc_on

        /*@if (@_win32)

        colspan:                "colSpan",

        rowspan:                "rowSpan",

        @else @*/

        colspan:                "colspan",

        rowspan:                "rowspan",

        /*@end

        @*/

        

        addEvent: function(obj, type, fn, tmp) {

                tmp || (tmp = true);

                if( obj.attachEvent ) {

                        obj["e"+type+fn] = fn;

                        obj[type+fn] = function(){obj["e"+type+fn](...