Adding additional functionality to an object that is already acting as an 'accordion' header

Adding additional functionality to an object that is already acting as an 'accordion' header

This is probably a pretty basic question, but I'm still just learning the Ui plugin. I have a navigation frame using expanding accordions and it works fine, but when I attached my own click events to the header elements to do some other things on the site, the accordion stopped working. So I'm just trying to understand the correct way to add functionality when clicking an accordion header. Here's a sample of the code I'm using that appears to conflict.

Here's roughly how the JQuery code is setup:
  1. $('.navpanel').accordion({
  2.       collapsible: true,
  3.       active: false,
  4.       autoHeight: false
  5. });
  6. $('.gotoSection2').click(function() {
  7.       $('.pane').hide();
  8.       $('#section2_pane').show();
  9.       $('.navpanel h6 .active').removeClass('active');
  10.       $('.navpanel h6 .section2').addClass('active');
  11.       return false;
  12. });

... and the html:
  1. <div class="navpanel">
  2.       <h6><a href="#" class="section1 gotoSection1 active">Section 1</a></h6>
  3.       <div class="navpanel_links">
  4.             <ul>
  5.                   <li><a href="#">Link 1</a></li>
  6.                   <li><a href="#">Link 2</a></li>
  7.             </ul>
  8.       </div>
  9.       <h6><a href="#" class="section2 gotoSection2">Section 2</a></h6>
  10.       <div class="navpanel_links">
  11.             <ul>
  12.                   <li><a href="#">Link 1</a></li>
  13.                   <li><a href="#">Link 2</a></li>
  14.             </ul>
  15.       </div>
  16.       <h6><a href="#" class="section3 gotoSection3">Section 3</a></h6>
  17.       <div class="navpanel_links">
  18.             <ul>
  19.                   <li><a href="#">Link 1</a></li>
  20.                   <li><a href="#">Link 2</a></li>
  21.             </ul>
  22.       </div>
  23. </div>

  24. <div id="section1_pane" class="pane">
  25.       Stuff in here
  26. </div>
  27. <div id="section2_pane" class="pane hide">
  28.       Stuff in here
  29. </div>
  30. <div id="section3_pane" class="pane hide">
  31.       Stuff in here
  32. </div>

So basically, I'm setting the accordion, then setting up the clicks to correctly apply an 'active' class to the header that was clicked, and swapping the content pane for the new one. As of right now, when I add the 'active' and pane functions the collapsed nav sections do not expand. I figure there is probably a conflict between my click function and whatever is built into JUi but I'm not sure exactly how to get around that conflict.