$(document).ready(function () {
									 
    $(".cover-slide ul li:last").css({
        borderBottom: '0'
    });
    $('#authors ul').easyListSplitter({
        colNumber: 3
    });
    $('.accordion h2').click(function() {
        $(this).next().toggle('slow');
        return false;
    }).next().hide();

    $('.info-box').equalHeights();
    $('#news-list li').equalHeights();

	
    jQuery.fn.fadeToggle = function(speed, easing, callback) {
        return this.animate({
            opacity: 'toggle'
        }, speed, easing, callback);
    };

    $('a.close ').click(function() {
        $('.table').fadeOut('medium');
        $('.table').removeClass('top bottom')
        return false;
    });
	
    $('.otherbutton,.homebutton,.downloadbutton,.donatebutton').append('<span class="hover"></span>').each(function () {
        var $span = $('> span.hover', this).css('opacity', 0);
        $(this).hover(function () {
            $span.stop().fadeTo(500, 1);
        }, function () {
            $span.stop().fadeTo(500, 0);
        });
    });

    $('a#focuss-b').click(function() {
        $('.table').removeClass('top bottom')
        $('#tabela5').fadeToggle('slow');
        $('.table').addClass('bottom');
        return false;
    });


	  var ct = $('#slideshow').children().size(); 
	 

    $('#slideshow').cycle({
        fx:         'fade',
        timeout:     150000,
        pager:      '#cover-dot-nav ',
        speed: '500',
        prev:   '#left-arrow',
        next:   '#right-arrow',
        rev: 1,
        startingSlide: ct
    });

    $('.listContainer1').cycle({
        fx:         'fade',
        timeout:     150000,
        pager:      '#author-nav',
        speed: '500'
    }); 
    // $('#sidebar ul li a').hover( function (){
    // $(this).animate({ paddingLeft: '15px'}, 100);}, function(){ $(this).animate({ paddingLeft: '0px'}, 100);  });
    //$('.slide-index ul li a').hover( function (){
    //$(this).nextAll('.comment').animate({ top: '-2px'}, 150).animate({ top: '0px'}, 150);});
	
    //$('.slide-index ul li a').hover( function (){
    // $(this).nextAll('.comment').animate({ top: '-2px'}, 80).animate({ top: '0px'}, 80);});
	
    //$('#social-switcher a').mouseover( function (){
    //	var top = $(this).css("top");
    //  up = parseInt(top)-2;
    //	down = up+2;
    // $(this).animate({ top: up }, 150).animate({ top: down}, 150);});
	
	
    //$('.cover').mouseover( function (){
    //	var top = $(this).css("top");
    //   up = parseInt(top)-10;
    //	down = up+10;
    // $(this).animate({ top: up }, 150).animate({ top: down}, 150);});
	 


    $(".cover").hover(
	
        function () {
            $(this).animate({
                top: 7
            }, 160);
        },
        function () {
            $(this).animate({
                top: 12
            }, 150);
        }
        );
	
    // Cover Switcher
	
    $('#cover-switcher').children('ul').hide();
    $('#cover-switcher').mouseover(function() {
        $(this).children('ul').show();
    }).mouseout(function() {
        $(this).children('ul').hide();
    });
		
		
    $('#twitter-option').click(function() {
        $('#blip').hide();
        $('#blip-option').removeClass('active');
		
        $('#twitter').show();
        $('#twitter-option').addClass('active');
			
        $('#social-arrow').animate({
            top: '12px'
        },180);
			
		
        return false;
    });
		
		
    $('#blip-option').click(function() {
        $('#twitter').hide();
        $('#twitter-option').removeClass('active');
		 	
        $('#blip').show();
        $('#blip-option').addClass('active');
        $('#social-arrow').animate({
            top: '39px'
        },180);
		
        return false;
    });

		
		
    // Usuwanie margines�w na prawych koncach list
    $("#news-list> li:nth-child(2n)").addClass("omega").removeClass("alpha");
	
	
    // Obsluga buttona zapisu do GoogleForms
    $("#google-submit").toggle(function() {
        $("#google-form").fadeIn('slow');
        $("#google-submit").text('zamknij');
    }, function() {
        $("#google-form").fadeOut('slow');
        $("#google-submit").text('zapisz sie!');
    });
});

