That shouldn't be too difficult but need to clarify a couple of things.
Let's say the menu bar has items for page1 (home page), page2, page3, page4, page5.
On page load, page1 is displayed. If the user then clicks page3 in the menu bar then the user sees in their browser window -
and if the user then clicks page5 in the menu bar, they then see in their browser -
So now, if the user clicks page3 again in the menu bar what is the order of pages you want the user to see in their browser? ..ie..Do you want pages 3 and 5 to reverse their order or do you want page3 to go to the top of the stack and page5 to go to the bottom of the stack?