nav overflow bug fix
further js script refactor