function robSondy(){
	   $('.jedna_sonda').each(function(){
		   var h = $(this).parent().height();
		   //$(this).css('height', h+'px');
		   $(this).css('height', h+'px');
	   }); 
	   $('.sonda_odpowiedzi').each(function(){
		   var h = $(this).parent().parent().height() - 15;
		   $(this).css('height', h+'px');
	   }); 
	   $('.sonda_pytania').each(function(){
		   var h = $(this).parent().parent().height();
		   $(this).css('height', h+'px');
	   }); 
	   $('.jedna_sonda form').each(function(){
		   var h = $(this).parent().parent().height();
		   $(this).css('height', h+'px');
	   }); 
	   $('.jedna_sonda .box').each(function(){
		   var h = $(this).parent().parent().height();
		   $(this).css('height', h+'px');
	   }); 
}

$(document).ready(function(){
    $('#menu_glowne li').hover(
        function(){
            $(this).children('ul').show('', 'fast');
        },
        function(){
            $(this).children('ul').hide('', 'fast');
        }
    );
    $('#panel_r').click(function(){
    	$("#panel_okno").css({'top' : '-200px', 'left' : '500px', 'display' : 'block'});
        $(".containerPlus").buildContainers({
            containment:"document",
            elementsPath:"elements/",
            onResize:function(o){},
            onClose:function(o){},
            onCollapse:function(o){},
            onIconize:function(o){},
            onDrag:function(o){},
            onLoad:function(o){}
        });
        $(this).unbind('click');
    });
	$('#artykul_wyswietl a.obrazek').fancybox({'titlePosition': 'over'});
    $('#ukryty_wiadomosci').fancybox({'titlePosition': 'over'});
    $('.thickbox').fancybox({'titlePosition': 'over'});
    $('.kategoria_newsow .gora ul').each(function(){
    	$(this).after('<div class="nav" id="nav'+$(this).attr('id')+'">').cycle({
        	timeout: '5000',
        	pager:  '#nav'+$(this).attr('id')
        });
    });
	$('img').error(function() {
		$(this).remove();
	});
	
    $('.baner').click(function(){
        var html = $.ajax({
           url: "http://swidniczanie.pl/index/baner_click/id/"+$(this).attr('id'),
           async: true
       }).responseText;
   });
    robSondy();
    
    var max = 0;
    max = $("#kategoria1 .dol").height();
    if($("#kategoria2 .dol").height()>max){
    	max = $("#kategoria2 .dol").height();
    }
    if($("#kategoria3 .dol").height()>max){
    	max = $("#kategoria3 .dol").height();
    }
    $("#kategoria2 .dol").css("height", max+"px");
    $("#kategoria1 .dol").css("height", max+"px");
    $("#kategoria3 .dol").css("height", max+"px");
});
