﻿(function ($) {
    $.fn.bannerSlide = function () {
        var container = this;
        $('img', container).css({ display: 'none' });
        $('img:last', container).addClass('show');
        var gallery = function () {
            var current = $('img.show', container);
            var next;
            if (current.next().length == 0) {
                next = $('img:first', container);
            }
            else {
                next = current.next();
            }
            current.fadeOut(2000).removeClass('show');
            next.fadeIn(2000).addClass('show');
        };
        gallery();
        setInterval(gallery, 5000);
    };
})(jQuery);  
