moving javascipt outside of menu ul tag