title: jQuery Accordion - Need index of currently selected content part
body: <p>I have a simple menu on a web page, based on the jQuery Accordion. I have simplified the code somewhat, and it looks like this;</p>
  
  <pre><code>&lt;div id="menu_div" class="nt-tab-outer nt-width-150px"&gt;
  
  &lt;h3 class="nt-tab-title"&gt;&lt;a href="#"&gt;Menu A&lt;/a&gt;&lt;/h3&gt;
  &lt;div id="menu_1_div"&gt;
    &lt;a href="itemA1"&gt;Item A1&lt;/a&gt;&lt;br /&gt;
    &lt;a href="itemA2"&gt;Item A2&lt;/a&gt;&lt;br /&gt;
  &lt;/div&gt;
  
  &lt;h3 class="nt-tab-title"&gt;&lt;a href="#"&gt;Menu B&lt;/a&gt;&lt;/h3&gt;
  &lt;div id="menu_2_div"&gt;
    &lt;a href="fTabsDyn"&gt;Item B1&lt;/a&gt;&lt;br /&gt;
    &lt;a href="fPlainDyn"&gt;Item B2&lt;/a&gt;&lt;br /&gt;
  &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  jQuery(function() {
   jQuery("#menu_div").accordion({
    active: 1,
    change: function(event, ui) { 
        alert('bob');
    }})
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>This sets the 2nd "part" of the accordion open when the page opens. (active:1) and if either of the headers is clicked a simple alert "bob" pops up. So far so good.</p>
  
  <p>Now I'd like to replace "bob" with the index of the header. So the "read" version of "active". ie, when the first accordion header is clicked I get 0, and if the second header is clicked I get a 1.</p>
  
  <p>(Aside, of course I don't really want to do an Alert, I want to make an Ajax call to the server with the value, so the server knows which menu is open at the client. That part I can do, but I'm struggling to get the right value to send. If the index is not available then feel free to offer alternate suggestions).</p>
  
  <p>Thanks!</p>