Sorting table with prototype Javascript