How can I get the active index of the jquery accordion pane when a button is clicked? What I want to do is when a button is clicked in pane 3 for example, I want to store that value and when the page is reloaded, I want pane 3 to remain open.

I intially had this in my server side click and when I hard code a value in for paneIndex it works fine, but obviously, I don't want to do this, I want to get the index on the click and pass that to the script.

```
string script = "<script type=\"text/javascript\">var paneIndex = " + 3 + "</script>";

if(!ClientScript.IsStartupScriptRegistered("JSScript"))
    ClientScript.RegisterStartupScript(this.GetType(),"JSScript", script);

```