two function for menu buttons and popups +/- merged in single function