define and call function to replace subnav when menu item is clicked