$(document).ready(function() {
    $('.item_more').click(function() {
        var $that = $(this);
        var box = $that.closest('.item_box');
        if( $that.hasClass('item_less') ) {
            $that.removeClass('item_less');
            box.find('.item_image').slideDown('slow');
            box.find('.item_text').tinyscrollbar({
                scroll: false
            });
            box.find('.item_text .scrollbar').hide();
            changeMoreTxt($that);
        } else {
            box.find('.item_image').slideUp('slow');
            box.find('.item_text').tinyscrollbar();
            box.find('.item_text .scrollbar:not(.disable)').show();
            $that.addClass('item_less');
            changeMoreTxt($that);
        }
    });
        
    function changeMoreTxt($obj) {
        var $tmpRel = $obj.attr('rel');
        $obj.attr('rel', $obj.text());
        $obj.text($tmpRel);
    }
        
    $('.filter_show').click(function() {
        $('.filterOpts form').slideToggle();
        if($(this).text()=='Pokaż filtr') {
            $(this).text('Ukryj filtr');
        } else {
            $(this).text('Pokaż filtr');
        }
        return false;
    })
    $('.ordersList tr:last').addClass('last');
    
    $("#main_banner li:first").show();
    setInterval(function() { $("#main_banner li:visible").fadeOut($("#main_banner li:hidden").fadeIn(1000));}, 10000);
});
