reorder javascript