$(document).ready(function() {
    // set initial state: the main container has enough space, and the side menu shows.
    $(".nav_about").hide();
    $(".nav_artwork").hide();

    // define a function when you click the link with the class togglemenu
    $(".menu_about").click(function () {
        // if the menu is visible (initial state), the function allows you to hide it 
        // ..and sets the cookie to hidden after, so the state is remembered
        if ($(".nav_about").is(":visible")) {
            $(".nav_about").slideUp("1000");  
            $(this).addClass("active");
            $.cookie('side-menu-about', 'hiding', {path: "/"});
            return false;
        } else {
        // and if not visible, the function let's you show it
            $(".nav_about").slideDown("1000");
            $(this).removeClass("active");
            $.cookie('side-menu-about', 'showing', {path: "/"});
            return false;
        }
    });

    // cookie time!
    // creates a variable with the contents of the cookie side-menu
    var sidemenuabout = $.cookie('side-menu-about');

    // if cookie says the menu is hiding, keep it hidden!
    if (sidemenuabout == 'showing') {
            $(".nav_about").show();
            $(".menu_about").addClass("active");
    };
    
        // define a function when you click the link with the class togglemenu
    $(".menu_artwork").click(function () {
        // if the menu is visible (initial state), the function allows you to hide it 
        // ..and sets the cookie to hidden after, so the state is remembered
        if ($(".nav_artwork").is(":visible")) {
            $(".nav_artwork").slideUp("1000");    
            $(this).addClass("active");
            $.cookie('side-menu-artwork', 'hiding', {path: "/"});
            return false;
        } else {
        // and if not visible, the function let's you show it
            $(".nav_artwork").slideDown("1000");
            $(this).removeClass("active");
            $.cookie('side-menu-artwork', 'showing', {path: "/"});
            return false;
        }
    });

    // cookie time!
    // creates a variable with the contents of the cookie side-menu
    var sidemenuartwork = $.cookie('side-menu-artwork');

    // if cookie says the menu is hiding, keep it hidden!
    if (sidemenuartwork == 'showing') {
            $(".nav_artwork").show();
            $(".menu_artwork").addClass("active");
    };
}); // jquery ends



