js version of pause menu