$(document).ready(function() {
    // klasy odd/even na głównej stronie forum
    $('.forumRooms .postsList li:odd').addClass('odd');

    $('.forum .column_right .latest .postsList li:last, .forum .column_left .forumRooms .postsList li:last, .forum .column_left .popularTeams li:last, .pagination li:last').addClass('last');

    $('.toDownload .downloadsList .sizes li').hover(
        function() { $(this).addClass('active'); },
        function() { $(this).removeClass('active'); }
    );
});

function popUp(url) {
    window.open(url, 'cupPopUp',
        'toolbar=no,scrollbars=no,resizable=no,status=no,location=no,directories=no,width=500,height=580,menubar=no');
}

function prepareTree() {

    $(document).ready(function() {
        var max;

        for (var i = 1; i < 4; i++) {
            max = 0;

            var str = ".stage" + i;

            $(str + ' .tree_teamname').each(function() {
                var h = $(this).width();
                if (h > max) max = h;
            });

            max += 45;

            $(str + ' .tree_team').css('width', max + 'px');

            if (i == 3) {
                $('.stage4 .tree_team').css('width', max + 'px');
                var max2 = -(max) - 23;
                $('.stage4 .team3').css('right', max2 + 'px');
            }

            max += 31;
            $(str + ' .tree_pair').css('width', max + 'px');
            if (i == 3) $('.stage4 .tree_pair').css('width', max + 'px');
            max += 23;
            $(str).css('width', max + 'px');
            if (i == 3) $('.stage4').css('width', max + 'px');
        }
    });
}

