Sorry bud, you can't control what the buttons on a web browser do.
You can control stuff inside your HTML document but anything outside of that would raise security risks.
Oh and there is on onRefresh event... If a page "refreshes" the browser resends the HTTP request for it and well, that's way outside the domain that javascript lives in.
A possible solution might be to store your menu setting in a cokkie. By setting a cokkie you could store the current menu settings on the client browser and simply check to see if the client has one of your cookies when they load (or refresh) the page and then set up the menu accordingly. A lot of sites use cookies to track bits of information across different pages their website. Usually for stuff like what item's you've selected to purchase on an e-commerce site so that they can recall that data on a seperate HTML page (Like a checkout page for example).