$(document).ready(function() {
    // set initial state: the main container has enough space, and the side menu shows.
    //$(".photo-big").width("72%");
    //$("#side-menu-container").show();

    // create a variable which is the link to toggle the menu
    // this creates a link to # with the class "togglemenu"
    var a = $("<a>zmień</a>").attr('href','#').addClass("togglemenu");
    $('#menu').append(a);
    // .. and place this link within the element with class "toggle-menu"

    // define a function when you click the link with the class togglemenu
    $(".togglemenu").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 ($("#mytop").is(":visible")) {
            //$(".photo-big").hide();
            $("#mytop").slideUp("fast");
            $(this).addClass("active");
            $(this).attr("html","test");

            $(this).addClass("active");
            $.cookie('side-menu', 'hiding', {path: "/"});
            return false;
        } else {
        // and if not visible, the function let's you show it
            $("#mytop").slideDown("fast");
            $(this).removeClass("active");
            $.cookie('side-menu', 'showing', {path: "/"});
            return false;
        }
    });

    // cookie time!
    // creates a variable with the contents of the cookie side-menu
    var sidemenu = $.cookie('side-menu');
    // if cookie says the menu is hiding, keep it hidden!
    if (sidemenu == 'hiding') {
            $("#mytop").hide();
            $(".togglemenu").addClass("active");
    };

}) // jquery ends


function checkSearch()
{

}
