﻿/*
*
* Very nice to see an object. This script shines out like a starry beacon 
* of awesome in this site!
*
*
*/

/*(function () {
    var peach = {
        banners: {
            options: {
                "timer": 7500,
                "fadetime": 1000
            },
            rotate: function ($banners) {
                var $current = $banners.filter("[data-rotate]"),
                            currentIndex = $current.index(),
                            nextIndex = currentIndex + 1,
                            bannersLen = $banners.length,
                            timer = peach.banners.options.timer,
                            fadetime = peach.banners.options.fadetime;

                if (nextIndex === bannersLen) {
                    nextIndex = 0;
                }

                $current.delay(timer).fadeOut(fadetime, function () {
                    $current.removeAttr("data-rotate");
                    $banners.eq(nextIndex).attr("data-rotate", "current").fadeIn(fadetime, function () {
                        peach.banners.rotate($banners);
                    });
                });
            },
            init: function () {
                var $bannerContainer = $(".header-banners"),
                            $banners = $bannerContainer.find("li"),
                            timer = peach.banners.options.timer,
                            bannersLen = $banners.length;

                $banners.first().attr("data-rotate", "current");

                if (bannersLen > 1) {
                    peach.banners.rotate($banners);
                }
            }
        },
        init: function () {
            peach.banners.init();
        }
    };

    $(function () {
        peach.init();
    });
})();
*/
