baking a cookie with Jquery
<p>Can someone tell me why this doesn't work: </p>

<pre><code>$(document).ready(function() {
    $("#cookie").text("expanded");
    //panel toggle
    $(".btn-slide").click(function() {
        $("#panel").slideToggle("slow");
        //set the name and value of the cookie
        $.cookie('panel', 'collapsed');
        $("#cookie").text("collapsed");
    }, function() {
        $("#panel").slideDown("slow");
        //set the name and value of the cookie
        $.cookie('panel', 'expanded');
        $("#cookie").text("expanded");
    });
    // cookie
    var panel = $.cookie('panel');
    // Set the user's selection for the state
    if (panel == 'collapsed') {
        $("#panel").hide();
    };
});
</code></pre>

<blockquote>
  <p><b><a href="http://jsfiddle.net/yomoore/RJMhT/138/" rel="nofollow">jsFiddle Example</a> </b></p>
</blockquote>

<p>I don't see anyting wrong, but on refresh the panel doesn't keep it's state (whether open or closed). It just returns to the closed default state. I'm using a plugin for the cookies.</p>
