Accordion initial state after page changes

Accordion initial state after page changes

Hello,

I'm stuck with a simple jquery accordion script that is http://www.stevekrueger.com/jquery-accordion-tutorial/.

The problem is that there are links inside my divs that brings to another page where the same accordion menu should be included and left opened at the same state like the previous page (hope to be enough clear... :D).

The script I'm using will always close all the accordion divs upon the second page load. I'm a total newbie of jquery and couldn't understand exactly how jquery works (among other things I've to do i promise that I will learn jQuery as soon as possible :wink:); in the meantime could someone explain me if there is a way to do this?

that's the jquery accordion script:
  $(document).ready(function(){
   $(".content").hide();
   $('<img src="arrow-down.png" class="arrow" />').insertAfter('a h1');                
   $("a h1").click(function(){
      if($(this).is(".active")) {
         $(this).toggleClass("active");
       $('.arrow.active').attr('src','arrow-down.png'); // change the image src of the current ACTIVE image to have an INACTIVE state.
         $(this).parent().next(".content").slideToggle();
         return false;
      } else {
         $(".content:visible").slideUp("slow"); // close all visible divs with the class of .content
         $("h1.active").removeClass("active");  // remove the class active from all h1's with the class of .active
         $(this).toggleClass("active");
         $('.arrow.active').attr('src','arrow-down.png'); // change the image src of the current ACTIVE image to have an INACTIVE state.
         $(".arrow").addClass('active');
         $(this).siblings('.arrow.active').attr('src','arrow-up.png'); // change the image src of the new active image to have an active state.
         $(this).parent().next(".content").slideToggle();
         return false;
      }
   });
});


Thank you in advice.

Alex - italy