Adding javascript to menus