Javascript bubble sorting via Javascript