javascript magic to hide menus unless clicked