Jelo.load('all', function() {
    Jelo.Anim.setDefaultDuration(0.33);
    Jelo.on($$('.target-silo'), 'click', function(e) {
        var self = e.target, href = self.href || '', target = $(href.substr(href.indexOf('#'))), active = $('.silo.active');
        if (target && (target != active)) {
            e.preventDefault();
            Jelo.Anim.ate({
                me: active,
                css: 'opacity: 0',
                easing: 'out',
                after: function() {
                    Jelo.css(this.me, 'display', 'none');
                    Jelo.css(target, ['opacity', 'display'], ['0', 'block']);
                    Jelo.CSS.removeClass(active, 'active');
                    Jelo.CSS.addClass(target, 'active');
                    Jelo.Anim.ate({
                        me: target,
                        css: 'opacity: 1',
                        easing: 'out'
                    });
                }
            });
        }
    });
    Jelo.each($$('.partner-logos'), function(group) {
        var logos = $$('li', group), index = 0;
        Jelo.css(logos.slice(3), ['height', 'opacity'], ['0px', '0']);
        setTimeout(function() {
            if (Jelo.css(Jelo.Dom.ancestor('div', group), 'display') == 'none') {
                setTimeout(arguments.callee, 5000);
                return;
            }
            Jelo.each(logos.slice(index, index + 3), function(item, index) {
                setTimeout(function() {
                    Jelo.Anim.ate({
                        me: item,
                        css: 'top: -30px; height: 0px; opacity: 0',
                        duration: 1,
                        easing: 'strongout'
                    });
                }, index * 100);
            });
            index = index + 3;
            if (index >= logos.length) {
                index = 0;
            }
            Jelo.each(logos.slice(index, index + 3), function(item, index) {
                setTimeout(function() {
                    Jelo.Anim.ate({
                        me: item,
                        css: 'top: 0px; height: 130px; opacity: 1',
                        duration: 1,
                        easing: 'strongboth'
                    });
                }, index * 100);
            });
            setTimeout(arguments.callee, 5000);
        }, 5000);
    });
    if ($('.dse')) {
        var dseLink = $$('.dse a')[1];
        dseLink.origColor = Jelo.css(dseLink, 'color');
        Jelo.on(dseLink, 'mouseover', function() {
            Jelo.css(this, 'color', '#000');
        });
        Jelo.on(dseLink, 'mouseout', function() {
            Jelo.css(this, 'color', dseLink.origColor);
        });
    }
    Jelo.on($$('.player img'), 'click', function() {
        Jelo.css(this, 'display', 'none');
        Jelo.css($('object', this.parentNode), 'display', 'block');
    });
});
function onVideoComplete() {
    setTimeout(function() {
        Jelo.css($('.player object'), 'display', 'none');
        Jelo.css($('.player img'), 'display', 'block');
    }, 100);
}

