$(document).ready(function (){
    $('.tab-widget > a.tab').click(function () {
        var id = $(this).attr('href');
        $(this).siblings('a').removeClass('tab_active');
        $(this).addClass('tab_active');
        $(id).siblings('.tab-content').addClass('deactivated');
        $(id).removeClass('deactivated');
        return false;
    });
    $('#switch_view').click(function () {
        var text = $(this).html();
        if (text.match(/listy/)) {
            $(this).html('Widok standardowy &raquo;');
            createCookie('view_type', 'list', 2050);
        }
        else {
            $(this).html('Widok listy &raquo;');
            createCookie('view_type', 'standard', 2050);
        }
        $('#standard-view').toggleClass('deactivated');
        $('.standard-view').toggleClass('deactivated');
        $('#list-view').toggleClass('deactivated');
        return false;
    });
    $('#rec_switch_view').click(function () {
        var text = $(this).html();
        if (text.match(/statyczny/)) {
            $(this).html('Widok dynamiczny &raquo;');
            $('#featured_content #roto').css('display', 'none');
            $('#featured_content #featured_content_1').css('display', 'block');
            $('#featured_content #featured_content_2').css('display', 'block');
            createCookie('recommended_view', 'static', 2050);
        }
        else {
            $(this).html('Widok statyczny &raquo;');
            $('#featured_content #roto').css('display', 'block');
            $('#featured_content #featured_content_1').css('display', 'none');
            $('#featured_content #featured_content_2').css('display', 'none');
            createCookie('recommended_view', 'roto', 2050);
        }
        return false;
    });
});

