var lastSlide = 0;
jQuery(document).ready(function(){
    if(jQuery('.featured-thumb-wrapper').size()){
        jQuery('.featured-thumb-wrapper img').hide();
        jQuery('.featured-thumb-wrapper img').eq(0).show();
        setTimeout(slideshow, 14000);
    }
    jQuery('div.sidebar-box').each(function(){
        if(jQuery(this).find('li').size() > 15)
        {
            var thiz = jQuery(this);
            thiz.find('li:gt(14)').hide();
            thiz.find('ul').append('<li class="moar"><a href="#">Starsze &raquo;</a></li>');
            thiz.find('li.moar a').click(function(){
                thiz.find('li:not(.moar)').slideDown('slow', function(){
                    jQuery(this).css('display', 'list-item');
                });
                thiz.find('li.moar').slideUp();
                return false;
            });
        }

    })
    
});
function slideshow()
{
            
    var slide = (lastSlide + 1)%(jQuery('.featured-thumb-wrapper img').size());
    if(slide != lastSlide)
    {
        jQuery('.featured-thumb-wrapper img').eq(lastSlide).fadeOut(1500);
        jQuery('.featured-thumb-wrapper img').eq(slide).fadeIn(1500);
    }
    lastSlide = slide;
    setTimeout(slideshow, 14000);
    return 0;
}
