/*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

function slideSwitch(id) {
    var $active = $(id+' IMG.active');

    if ( $active.length == 0 ) $active = $(id+' IMG:last');
    
     var $sibs  = $active.siblings();
     var rndNum = Math.floor(Math.random() * $sibs.length );
     var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    if (blockSlider == 0)
        setInterval( "slideSwitch('#slideshow')", 10000);
});

function retIntervalId() {
    return sliderInterval;
}

function slideSwitch2() {
    var $active = $('#slogany DIV.active');

    if ( $active.length == 0 ) $active = $('#slogany DIV:last');


     var $sibs  = $active.siblings();
     var rndNum = Math.floor(Math.random() * $sibs.length );
     var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
		
	$next.addClass('active');
}

$(function() {
    if (blockSlider == 0)
        setInterval("slideSwitch2()", 5000);
});


$(document).ready(function() {
    $('.more').hide();
                    
    // $('.czytajwiecej').click(function() {
            // $(this).prevAll('.more:last').slideToggle("normal");
            // $(this).hide(); //('fast');
    // });
    
    $('.czytajwiecej').click(function() {
        if ($(this).text().indexOf('czytaj wiêcej') != -1) {
            $(this).prevAll('.more:last').slideToggle("normal");
            $(this).html('ukryj news <b>&uarr;</b>');
        }
        else if ($(this).text().indexOf('ukryj news') != -1) {
            $(this).prevAll('.more:last').slideToggle("normal");
            $(this).html('czytaj wiêcej <b>&darr;</b>');
        }
    });	
});

