javascript for the main menu component