Returning from pdf resets the ui.

Returning from pdf resets the ui.

I used jquery to make an accordion/outline list of links to a bunch of pdf files. The top level is the letters of the alphabet and the second level the links to the pdf's. Clicking a letter expands into the links to files that start with that letter, typically 5-15 of them. That works great, with hide and show, using durations.

But when the user hits the browser back function to return from the pdf, the accordion list is collapsed, as it is when you start the whole page; the top level item that was open is now closed. 

Is there an obvious fix for this? Maybe a way to save and restore the complete state of the page? Or do I need to encode and store the state myself and write code to restore it? If the latter, any tips on how to distinguish coming into the page at the beginning as opposed to returning from a pdf?

Here's a typical link to a pdf file...

<a href="pdfdocs/Houston.pdf" class="city">Houston</a>

I'm happy to post more details if necessary.