$(document).ready(function(){
	
	$(".accordion h3:first").addClass("active");
	var strCookie = $.cookie("lasth3");
	if (strCookie != null)
	{
	  var iIndex = Number(strCookie.substr(strCookie.indexOf("_") + 1));
	  var strP = "p_" + iIndex;
	}
	$(".accordion p").hide();
	if (strCookie != null)
	{
  	$("#" + strP).show();
  } else {
    $(".accordion p:first").show();
  }
	$(".accordion h3").click(function(){
		$.cookie('lasth3', String(this.id))
		$(".accordion p:visible").slideUp("slow");
		$(this).next("p").slideToggle("slow");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	});

});
