Problem with if

Problem with if

Hi all..

Ive made the following script:

$(document).ready(function(){

var showHide = $.cookie('menuStatus');
alert(showHide);

/* Part that dosn´t work.
if (showHide==closed) {
    $("#menu").hide();
    }
*/
                      
            $(".openClose").click(
                function(){                   
                    $("#menu").slideToggle("slow", function() {
                    if ($(this).is(':hidden')) {
                       //var state = "closed";
                       $.cookie('menuStatus', 'closed');
                    } else if ($(this).is(':visible')) {
                       //var state = "open";
                       $.cookie('menuStatus', 'open');
                    }           
                    //alert(state);
                });       
});

Now this is the example: http://www.onlinebrand.dk/template/aidenVersion2/

When page loads, you get an alert, with the var showHide, wich should be open or closed.

As you can tell, the problem is the if statement. Any pointer is welcome, because I'm really not sure what to do from here..

I must say it was exciting to make this little script with jQuery... Especially setting the cookie, I couldn't have done it without the jQuery plugin.. As you can see I tried to set a variable first.. but when page reloads, the variable was reset.. hehe, still new.. but damn, its fun to code a little..

/Daniel