         (function($){
            $.fn.FloatLight=function(o){
               o=$.extend({
                  fx:"linear",
                  speed:500,
                  click:function(){}
               },o||{});
               return this.each(function(){
                  var b=$(this),
                  noop=function(){},
                  $back=$('<li class="back"><div class="back_l"></div><div class="back_r"></div><div class="back_c"></div></li>').appendTo(b),
                  $li=$("li",this),
                  curr=$("li.on",this)[0]||$($li[0]).addClass("on")[0];
                  $li.not(".back").hover(function(){move(this)},
                  noop
               );
               $(this).hover(noop,function(){move(curr)});
               $li.click(function(e){
                  setCurr(this);
               });
               setCurr(curr);
               function setCurr(a){
                  $back.css({"left":a.offsetLeft+"px","width":a.offsetWidth+"px"});
                  curr=a
               };
               function move(a){
                  $back.each(function(){
                     $(this).dequeue()
                  }).animate({
                     width:a.offsetWidth,
                     left:a.offsetLeft
                  },o.speed,o.fx)}
               })
            }
         })(jQuery);

         //(function($){$.fn.lavaLamp=function(o){o=$.extend({fx:"linear",speed:500,click:function(){}},o||{});return this.each(function(){var b=$(this),noop=function(){},$back=$('<li class="back"><div class="left"></div></li>').appendTo(b),$li=$("li",this),curr=$("li.current",this)[0]||$($li[0]).addClass("current")[0];$li.not(".back").hover(function(){move(this)},noop);$(this).hover(noop,function(){move(curr)});$li.click(function(e){setCurr(this);return o.click.apply(this,[e,this])});setCurr(curr);function setCurr(a){$back.css({"left":a.offsetLeft+"px","width":a.offsetWidth+"px"});curr=a};function move(a){$back.each(function(){$(this).dequeue()}).animate({width:a.offsetWidth,left:a.offsetLeft},o.speed,o.fx)}})}})(jQuery);
                  
         $(document).ready(function(){
	         $(".tabs_ul").FloatLight({ fx: "backout", speed: 700 })
	         
			   $(".tabs_div li a").click(function() {
			      zakres = $(this).parent().parent().attr('id');
			      zakres2 = zakres.substring(0,zakres.length - 3) + "box";
               $("#" + zakres + " .on").removeClass("on");
               $(this).parent().addClass("on");
               var element_index = $("#" + zakres + " li a").index(this);

               $("#" + zakres2 + " div.tab_box:visible").hide();
               $("#" + zakres2 + " div.tab_box").eq(element_index).show();
               //return false;
            })
            
            $('.gallery_p').click(function(){
               x = $("#gallery_wrap").scrollLeft() - 175;
               $("#gallery_wrap").animate({scrollLeft: x},700,'backout');
               return false;
            });
            $('.gallery_n').click(function(){
               x = $("#gallery_wrap").scrollLeft() + 175;
               $("#gallery_wrap").animate({scrollLeft: x},700,'backout');
               return false;
            });
            
            $('.wstecz').click(function(){
               history.back();
               return false;
            });

            $('.top').click(function(){
               $("html,body").animate({scrollTop: 0});
               return false;
            });
            
            $("#obiekt .gallery_img a, #obiekt a.obiekt_image, .news .news_image a, .poziom_box a.poziom_zdj").fancybox();
         });   
