function rotate()
{
    var current = ($(this).find('.active')?  $(this).find('.active'): $(this).children(':first-child'));

    var next = ((current.next().length)?
        ((current.next().hasClass('active'))? $(this).children(':first-child'): current.next()):
        $(this).children(':first-child'));

    if (next.hasClass('info')) {
        next.css({paddingTop: ((112 - next.height())/2) + 'px'});
    }

    next.css({opacity: 0.0, display: 'block'})
        .addClass('active')
        .animate({opacity: 1.0}, 1000);

    current.animate({opacity: 0.0}, 1000)
        .removeClass('active');
}

function rotate_slow()
{
    $(".slides.baner").each(rotate);
}

function rotate_fast()
{
    $(".slides.loga").each(rotate);
}

$(document).ready(function ()
    {
        var first_logo = $(".rightbox .info")
        first_logo.css({paddingTop: ((112 - first_logo.height())/2) + 'px'});

        setInterval(rotate_slow, 5000);
        setInterval(rotate_fast, 3000);
    }
);

