http://www.javascriptkit.com/javatutors/arraysort.shtml