Add direction as a parameter to sortTable()
Improve IE compatibility down to 6