            //fbox
            $(document).ready(function() {
                $("a.fbox").fancybox();
            });
            
            //wyrownywanie kontenerow na menu i tresc
            function hidden_height_check()
            {
                $("li#hidden-top").css({'display' : 'none'});
                $("div#content").css("height", "auto");
                $("div#side-menu").css("height", "auto");
                var menu =  $("div#side-menu").height();
                var content = $("div#content-box").height();
                if (menu > content)
                {
                    $('div#side-menu ul li').last().prev().css('margin-bottom', '0px');
                    $("div#content").css({'height' : menu-90});
                    $("li#hidden-top").css({'display' : 'none'});
                } 
                else 
                {
                    if(content - menu < 39)
                        return;
                    $('div#side-menu ul li').last().prev().css('margin-bottom', '5px');
                    $("div#side-menu").css({'height' : content});
                    var ul_height = $("div#side-menu ul").height();
                    var hidden_height = content-menu;
                    $("div#hidden").css({'height' : hidden_height});
                    $("li#hidden-top").css({'display' : 'block'});
                };
            }
            
            //zamykanie bloku informacyjnego
            $(document).ready(function() {
                $("a.close_info").click(
                function()
                {
                    $(this).parent("p").hide();
                    hidden_height_check();
                });
            });
            
            // pokazywanie/chowanie ukrytego bloku .show_next_div .hide
            $(document).ready(function() {
                $(".show_next_div").click(
                function()
                {
                    if($(this).next(".hide").css("display")=="none")
                        $(this).next(".hide").show();
                    else
                        $(this).next(".hide").hide();
                    hidden_height_check();
                });
            });     
            
            //hover obrazkow w menu glownym
            $(document).ready(
            function()
            {
                $('ul#menu li img').imghover({suffix: '_k', fade: true, fadeSpeed: 250});
                hidden_height_check();
            });

            $(window).load(function()
            {
                hidden_height_check();
            });
