$(document).ready(function(){
                        
                        $('#data li:last, #logowanie_linki li:last, #forum li:last, #opcje_zalogowany li:last, #sonda_linki li:last, .lista_profil li:last').addClass('removeBorder');
                        $('li:last', '.arts').addClass('removeBorder');
                        $('li:last', '.bottom_box ul').addClass('removeBorder');
                        $('li:last', '#mecz ul').addClass('removeBorder');
                        $('li:last', '.kadra').addClass('removeBorder');
                        
                        $('#szukajka_input').click(function(){
                                var tresc = $(this).attr('value');
                                if(tresc == 'szukana fraza') $(this).attr('value', '');                                                 
                        });
                        $('#szukajka_input').blur(function(){        
                                var tresc = $(this).attr('value'); 
                                if(tresc == '') $(this).attr('value', 'szukana fraza');
                        });
        
                  $('li', '#menu').click(
                        function(){
                                $('li', '#menu').removeClass('sfhover');
                                $(this).addClass('sfhover');
                                var id = $(this).attr('id');
                                $('ul', '#umenu').fadeOut();
                                $('#u'+ id).fadeIn();
                                if($('#u'+ id).length) $('#mains_top').css('margin-top', '35px');
                                else $('#mains_top').css('margin-top', '0px');
                        });
                  
                          $('li', '#umenu').hover(
                        function(){
                                $(this).addClass('sfhover');
                                if($('ul', this).length){
                                        $('ul', this).fadeIn();
                                        $(this).addClass('bg');
                                        $('#mains_top').css('margin-top', '76px');
                                }else{$('#mains_top').css('margin-top', '35px');}
                        }, function(){
                                $(this).removeClass('sfhover');
                                $('ul', this).fadeOut();
                        });
                  
                  $('li', '#umenu ul ul').hover(
                        function(){
                                $(this).addClass('sfh');
                                $('#mains_top').css('margin-top', '76px');
                        }, function(){
                                $(this).removeClass('sfh');
                        });
                  $('#umenu ul ul').mouseleave(function(){
                                        $('#mains_top').css('margin-top', '35px');                                                        
                        });
                  
                          $('li', '.header').click(function(){
                                var rodzicHeader = $(this).parents('.header');
                                var rodzicBox = $(this).parents('.box');
                                var attrHref = $(this).attr('title');
                                
                                if(attrHref.length != 0){
                                        $('li', rodzicHeader).removeClass('zaz');
                                        $(this).addClass("zaz");        
                                        $('.s1, .s2', rodzicBox).slideUp("slow");
                                        if(attrHref == '1')var show = '.s1';
                                        if(attrHref == '2')var show = '.s2';
                                        $(show, rodzicBox).slideDown("slow");
                                }
                        });
        
        $('.news:odd').addClass('even');
        $('li:odd', '.tabela').addClass('even');
        $('li:odd', '#kalendarium').addClass('even');
        $('li:odd', '.bottom_box ul').addClass('even');
        
        $('#prev').click(function() {
                var akt = $('#aktnews').text();
                if(akt == 2){
                        $('#newsy2').fadeOut('slow');        
                        $('#newsy1').fadeIn('slow');        
                        $('#aktnews').text('1');
                }
        });
        
        $('#next').click(function() {
                var akt = $('#aktnews').text();
                if(akt == 1){
                        $('#newsy1').fadeOut('slow');
                        $('#newsy2').fadeIn('slow');        
                                
                        $('#aktnews').text('2');
                }
        });
        
        $('li', '#fontsize').click(function(){
                var title = $(this).attr('title');
                $('li', '#fontsize').removeClass('zaz');
		$(this).addClass('zaz');
		$('p', '#podstrona').css('font-size', title+'px');
	});
	
	$('#wyczysc').click(function(){
		$('textarea', '#addcom').val('');
	});
	$('#menu, #umenu').pngFix();
		  
});

