﻿$(document).ready(function() {
    var $items = $("div.clsQuotes").children();

    if ($items.length) {
        var $first = $items.first();

        $first.show();

        if ($items.length > 1) {
            setInterval(function() {
                $items.filter(":visible").fadeOut(2000, function() {
                    var $next = $(this).next();

                    if ($next.length) {
                        $next.fadeIn(1000);
                    }
                    else {
                        $first.fadeIn(1000);
                    }
                });
            }, 8000);
        }
    }
});
