Generalized slide window toggle function and added submenu option