javascript work on selecting stops