I am new to jQuery and really stuck with it.

I have a WordPress site with the posts in jQuery accordion and a link to latest posts on another page. I am trying to open the specific panel of an accordion using the external link.
At the moment when you click on the link, you move to the appropriate page and panel, but the panel stays closed.

Here is the code I am using for the accordion:

<script type="text/javascript">
 $(document).ready(function() {Accordion();});
  function Accordion() {  
   $('.accordion ul').hide(); 
   $('.accordion ul:first').show(); 
   $('.accordion li a:first').addClass('selected');
   $('.accordion li a').click(function(){
    $('.accordion li a').removeClass('selected');
   $('.accordion li a').click(
    function(event) {
    var checkElement = $(this).next();
    if((checkElement.is('ul')) && (checkElement.is(':visible'))) { 
     $('.accordion ul:visible').slideUp('normal'); 
     return false; 
    if((checkElement.is('ul')) && (!checkElement.is(':visible'))) { 
    $('.accordion ul:visible').slideUp('normal'); 
     return false;
Thank's for any help or suggestions.