Problem getting tabs to work when using an accordian inside a tab

Problem getting tabs to work when using an accordian inside a tab

I'm using an accordian inside a tab and for some reason the tabs are failing to hide and show content. It all appears as one continuous page but no javascript errors/warnings are being reported and the tabs highlight when clicked as if they're activating.
The addition of the accordian is new and the tabs worked prior.
 
Is there a limitation to these working together?

Basics of the code are below
Any suggestion or help hugely appreciated as I'm just scratching my head now after running out of ideas

Thx
Brad

Using jQueryUI v1.8.0 (updated to 1.8.1 with same result) with lightness theme

  1. $(function() {

  2. $(".button").button();
        
    $("#tabs").tabs( {selected: <?= ($selected)?$selected :0 ?>});

    $("#accordion").accordion({ header: "h3",
                              collapsible: true,
                              active: false,
                               autoHeight: false
                              });







  3.       });
  4.  
  5. <div id="tabs" >
  6.     <ul >    
  7.     <li><a href="#products">Products</a></li>      
  8.     <li><a href="#other">Other</a></li>     
  9.     <li><a href="#other2">Another</a></li>       
  10.     </ul>  
  11.  </div>

  12.      <div id="products" >
        <a href="editproduct.php?action=new" class="button">Create a New Product</a>

  13. <div   id="accordion">  
  14.     
  15. <h3><a href="#">Category 2</h3>
          <div>
          <table  width="100%"  border="0" cellpadding="3" cellspacing="0"  >

  16.       <tr><td>Image here</td><td>Code here</td><td>Edit link here</td></tr>
  17.       </table>
  18.       </div>

  19. <h3><a href="#">Category 1</h3>
          <div>
          <table  width="100%"  border="0" cellpadding="3" cellspacing="0"  >

  20.       <tr><td>Image here</td><td>Code here</td><td>Edit link here</td></tr>
  21.       </table>
  22.       </div>

  23. </div>