(function(global, $) {
    var widthAtivo = 28; var widthInativo = 2; var opaco = { opacity: 1 }; var semiOpaco = { opacity: 0.8 }; var invisivel = { opacity: 0 }; var ativo = { width: widthAtivo }; var inativo = { width: widthInativo }; var ativoOpaco = { width: widthAtivo, opacity: 1 }; var ativoTranslucido = { width: widthAtivo, opacity: 0.5 }; var inativoOpaco = { width: widthInativo, opacity: 1 }; $.widget('glb.slidertron', { options: { identificador: 'libbyslidertron', duracaoAnimacao: 200, intervalo: 6000, indiceInicial: 0, zIndex: 99 }, _create: function() { this.timer = null; this.indice = this.options.indiceInicial; this.passos = this.element.find('div.slidertron-passo'); this.numeroDePassos = this.passos.length; this.navegacao = this.element.find('div.slidertron-navegacao'); this.tituloFundo = this.element.find('span.slidertron-titulo-fundo'); this.itensNavegacaoLi = this.navegacao.find('li'); this.itensNavegacao = this.navegacao.find('a'); this.itensNavegacaoBg = this.itensNavegacao.filter('.slidertron-navegacao-item-bg'); this.itensNavegacaoBgAtivo = this.itensNavegacao.filter('.slidertron-navegacao-item-bg-ativo'); this.thumbs = this.element.find('div.slidertron-thumb'); this.primeiraAnimacao = true; this._ativar(); this.iniciarCiclo(); this._adicionarEventosNavegacao(); this._adicionarEventosHover(); this._setarAltura(); }, _setarAltura: function() {
        if (this.element.hasClass('slidertron-passos-compacto')) { return; }
        var alturas = this.passos.map(function() { return $(this).height(); }).get(); var maiorAltura = Math.max.apply(Math.max, alturas); this.element.height(maiorAltura);
    }, iniciarCiclo: function() {
        if (this.timer) { return; }
        this.timer = setInterval($.proxy(this.incrementaPasso, this), this.options.intervalo);
    }, cancelarCiclo: function() { clearInterval(this.timer); this.timer = null; }, _ativar: function() { var primeiroBgAtivo = this.itensNavegacaoBgAtivo.first(); primeiroBgAtivo.css('width', primeiroBgAtivo.css('width')); this.itensNavegacaoLi.first().removeClass('slidertron-navegacao-item-ativo'); }, _adicionarEventosNavegacao: function() {
        var self = this; this.itensNavegacaoLi.each(function(i, el) {
            var item = $(this); var bgAtivo = self.itensNavegacaoBgAtivo; var thumbs = self.thumbs; var duracaoAnimacao = self.options.duracaoAnimacao; self._bind(item, 'mouseenter', function() { bgAtivo.eq(self.indice).stop().animate(ativoTranslucido); bgAtivo.eq(i).stop().animate(ativoOpaco, { duration: duracaoAnimacao }); thumbs.eq(i).show().stop().animate(opaco); }); self._bind(item, 'mouseleave', function() { bgAtivo.eq(self.indice).stop().animate(ativoOpaco); bgAtivo.eq(i).not(bgAtivo.eq(self.indice)).stop().animate(inativo, { duration: duracaoAnimacao }); thumbs.eq(i).stop().animate(invisivel, { complete: function() { $(this).hide(); } }); }); self._bind(item, 'click', function() {
                self.primeiraAnimacao = false; if (self.indice == i) { return; }
                self.trocaPasso(self.indice, i);
            });
        }); this._bind(this.itensNavegacao, 'click', function(e) { e.preventDefault(); });
    }, _adicionarEventosHover: function() { var self = this; this._bind(this.element, 'mouseenter', function() { self.cancelarCiclo(); self.exibeNavegacao(); self.destacarTitulo(); }); this._bind(this.element, 'mouseleave', function() { self.iniciarCiclo(); self.escondeNavegacao(); self.normalizarTitulo(); }); }, incrementaPasso: function() { var indiceAnterior = this.indice; this.indice = (this.indice + 1) % this.numeroDePassos; this.trocaPasso(indiceAnterior, this.indice); this.itensNavegacaoBg.eq(indiceAnterior).css(inativo); }, trocaPasso: function(indiceAnterior, indiceAtual) { this.indice = indiceAtual; this.animacao(indiceAnterior, indiceAtual); }, animacao: function(indiceAnterior, indiceAtual) {
        var self = this; var passoAnterior = this.passos.eq(indiceAnterior); var passoAtual = this.passos.eq(indiceAtual); var navegacaoAnterior = this.itensNavegacaoBgAtivo.eq(indiceAnterior); var navegacaoAtual = this.itensNavegacaoBgAtivo.eq(indiceAtual); if (this.primeiraAnimacao) { this.itensNavegacao.not(navegacaoAnterior).stop().animate(inativo, { duration: this.options.duracaoAnimacao }); this.primeiraAnimacao = false; }
        var onNavegacao = function() { self.passos.css('z-index', self.options.zIndex - 1); passoAnterior.css('z-index', self.options.zIndex + 1); passoAtual.css('z-index', self.options.zIndex).css('opacity', '').show(); navegacaoAtual.stop().animate(ativo, { duration: self.options.duracaoAnimacao }); passoAnterior.stop().animate(invisivel, { duration: self.options.duracaoAnimacao, complete: function() { $(this).hide(); } }); }; navegacaoAnterior.animate(inativoOpaco, { complete: onNavegacao, duration: this.options.duracaoAnimacao });
    }, exibeNavegacao: function() { this.itensNavegacaoBg.stop().animate(ativo, { duration: this.options.duracaoAnimacao }); }, escondeNavegacao: function() { this.itensNavegacaoBgAtivo.eq(this.indice).stop().animate(ativoOpaco, { duration: this.options.duracaoAnimacao }); this.itensNavegacaoBg.not(this.itensNavegacaoBg.eq(this.indice)).stop().animate(inativo, { duration: this.options.duracaoAnimacao }); }, destacarTitulo: function() { this.tituloFundo.stop().animate(opaco); }, normalizarTitulo: function() { this.tituloFundo.stop().animate(semiOpaco); }, _bind: function(el, event, fn) { el.bind(event + '.' + this.options.identificador, fn); }
    }); $('#glb_slidertron').slidertron();
})(this, jQuery); (function() {
    createLoaderslidertron = function() { divLoading = "<div class='load-post'></div>"; $listaslidertron.before(divLoading); }, createNavigationslidertron = function(postsslidertron) {
       self.bindNavegacaoCarrosel(); self.bindNavBulletsslidertron(); self.validadeButtonslidertron();
    }
})();
