/*
   An example custom sort function. This is a direct copy of the sortNumeric method bundled with
   the fdTableSort Object but you can go wild with your own creations...
   
   This custom sort function has been associated with the TH node by giving the TH node a className
   of "sortable-customSort"

   N.B: The values passed to the function are the TR nodes themselves, it is imperative that you call
        the method fdTableSort.getInnerText as is shown below in order to get the relevant TD node
        innerText!
*/
function customSort(a, b) {
        // Get the innerText of the TR nodes
        aa = parseFloat(fdTableSort.getInnerText(a.getElementsByTagName('td')[fdTableSort.pos]));
        bb = parseFloat(fdTableSort.getInnerText(b.getElementsByTagName('td')[fdTableSort.pos]));

        // Sort
        if((isNaN(aa) || aa == "") && !isNaN(bb)) return -1;
        else if((isNaN(bb) || bb == "") && !isNaN(aa)) return 1;

        if(isNaN(aa) || aa == "") aa = 0;
        if(isNaN(bb) || bb == "") bb = 0;

        // Always return an integer from your custom sort function...
        return aa-bb;
}
