moved search menu logic to menu_functions.js