title: jQuery TableSorter - textExtraction based on external variable
body: <p>I have a TableSorted table, and in each TD element are five SPAN elements. Four are always hidden, but upon clicking a div outside the table, certain spans are hidden dependent on which div is clicked.</p>
  
  <p>I have the table sorting fine, but what I need is for the textExtraction to grab a different SPAN, depending on the value of the div which has been selected.</p>
  
  <p>I've tried the following to no avail:</p>
  
  <pre><code>textExtraction:function(node){
          var filter=$("div.career a.sel").text();
          if(filter=="a"){var theindex=0;}
          if(filter=="b"){var theindex=1;}
          if(filter=="c"){var theindex=2;}
          if(filter=="d"){var theindex=3;}
          if(filter=="e"){var theindex=4;}
          return $(node).find("span").eq(theindex).text();
      }
  </code></pre>
  
  <p>What is the best way to achieve this?</p>