
$(document).ready(function() {
    setInterval(function() {
        cycle($('#cycle-images'));
    }, 5000);
});
function cycle(obj){
    var next;
    $(obj).children(".active").animate({opacity: 0.0},"slow", function(){
        $(this).removeClass("active");
        next = $(this).next();
        if(next[0]) {
            next.animate({opacity: 0.99},"slow");
            next.addClass("active");
        } else {
            next = $($(obj).children()[0]);
            next.animate({opacity: 0.99},"slow");
            next.addClass("active");
        }
    });
}
