Dear Friends

I'm using an Accordion to go through Categories & Sub Categories. Now when I click on Ben 10 or any Sub Category, the page needs to refresh based on the ID passed, now I would like that Sub Category to be Opened by Default, rather than jump to the first one itself. It works using .eq but when the PHP page refresh I need to open it via the product id mentioned in UL class. Please somebody help

Code:
<script type="text/javascript">
  $(document).ready(function(){
 $("#accordion > li > div").click(function(){
 if(false == $(this).next().is(':visible')) {
 $('#accordion ul').slideUp(300);
 }
 $(this).next().slideToggle(300);
 });
 $('#accordion ul:eq(<?php echo trRe($_GET['acc']) ?>)').show(); //This is working but need a better way, since I need to open it dynamically using the Product ID mentioned in the <ul> class for.e.g      <ul class="13">

});
Code:
<ul id="accordion">
  <li>
    <div>Atlas Bicycles</div>
    <ul class="12">
      <li><a href="bicycles.php?pid=6&acc=0">Atlas Bicycles</a></li>
    </ul>
  </li>
  <li>
    <div>BMX Cartoon Bikes</div>
    <ul class="13">
      <li><a href="bicycles.php?pid=26&acc=1">Ben 10</a></li>
      <li><a href="bicycles.php?pid=27&acc=1">Ben 10 GT</a></li>
      <li><a href="bicycles.php?pid=28&acc=1">Cindrella</a></li>
      <li><a href="bicycles.php?pid=29&acc=1">Dora</a></li>
      <li><a href="bicycles.php?pid=30&acc=1">Happy</a></li>
      <li><a href="bicycles.php?pid=31&acc=1">Kunfu Panda</a></li>
      <li><a href="bicycles.php?pid=32&acc=1">Princess</a></li>
      <li><a href="bicycles.php?pid=33&acc=1">Princess Sakura</a></li>
      <li><a href="bicycles.php?pid=34&acc=1">Pups</a></li>
      <li><a href="bicycles.php?pid=35&acc=1">Tiger</a></li>
    </ul>
  </li>
  <li>
    <div>BMX Series</div>
    <ul class="14">
      <li><a href="bicycles.php?pid=23&acc=2">Excle BMX</a></li>
      <li><a href="bicycles.php?pid=24&acc=2">Royal BMX</a></li>
      <li><a href="bicycles.php?pid=25&acc=2">Vision BMX</a></li>
    </ul>
  </li>
  <li>
    <div>Folding Bikes</div>
    <ul class="15">
      <li><a href="bicycles.php?pid=9&acc=3">Folding Bikes</a></li>
    </ul>
  </li>
  <li>
    <div>Freestyle Bike</div>
    <ul class="16">
      <li><a href="bicycles.php?pid=36&acc=4">Astro Pioneer</a></li>
      <li><a href="bicycles.php?pid=37&acc=4">Planet Freestyle</a></li>
      <li><a href="bicycles.php?pid=38&acc=4">Power Ranger</a></li>
    </ul>
  </li>
</ul>