reorganizing js on unit_selectiom.html