JavaScript to make the navbar work