﻿var hard = true;
function rotator() {
    $('#olb-rotator a').css({ opacity: 0.0 }); //hide all 
    $('#olb-rotator a:first').css({ opacity: 1.0 }); //show first
    setInterval('rotate()', 2000);
}

function rotate() {
    var current = ($('#olb-rotator a.show') ? $('#olb-rotator a.show') : $('#olb-rotator a:first'));
    var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('#olb-rotator a:first') : current.next()) : $('#olb-rotator a:first'));
    if (!hard) {
        next.css({ opacity: 0.0 }).addClass('show').animate({ opacity: 1.0 }, 1000);
        current.animate({ opacity: 0.0 }, 1000).removeClass('show');
        hard = true;
    }
    else {
        next.css({ opacity: 0.0 }).addClass('show').css({ opacity: 1.0 }, 1000);
        current.css({ opacity: 0.0 }, 1000).removeClass('show');
        hard = false;
    }
}

$(document).ready(function () {
    rotator();
});
