/**
 * Desenvolvido por GHS Web
 * www.ghsweb.com.br
 */
var TopoImagens={atual:0,imagens:[],init:function(){$('#imagens_topo').html('<div id="imagens_topo_preload"></div>');this.img=new Image();this.img.src='/media/img/imagens_topo_new.jpg';this.preload()},preload:function(){if(TopoImagens.img.complete){$('#imagens_topo_preload').remove();TopoImagens.arrumaElementos()}else{setTimeout(TopoImagens.preload,100)}},arrumaElementos:function(){this.imagens=shuffle([0,1,2,3,4,5]);var a=parseInt($('#imagens_topo')[0].style.backgroundPosition.split(' ')[1].replace('-','').replace('px',''))/253;var b=0;for(var i=0,j=this.imagens.length;i<j;i++){if(this.imagens[i]==a){b=i;break}}this.imagens[b]=this.imagens[0];this.imagens[0]=a;$('#imagens_topo').html('<div id="imagens_topo_inside" style="display:none;background-position:0 -'+(253*this.imagens[1])+'px;"></div>');setInterval(TopoImagens.rota,4000)},rota:function(){var c=function(){if(TopoImagens.atual>=TopoImagens.imagens.length-1){TopoImagens.atual=0}else{TopoImagens.atual++}var a=($(this).css('display')=='none')?$(this):$('#imagens_topo');var b=(TopoImagens.atual>TopoImagens.imagens.length-2)?TopoImagens.imagens[0]:TopoImagens.imagens[TopoImagens.atual+1];a.css('background-position','0px -'+(253*b)+'px')};if($('#imagens_topo_inside').css('display')=='none'){$('#imagens_topo_inside').fadeIn(1000,c)}else{$('#imagens_topo_inside').fadeOut(1000,c)}}};var Lancamentos={pos:1,init:function(){$('#lancamentos_ant, #lancamentos_prox').click(function(){Lancamentos.move($(this).attr('id').replace('lancamentos_',''))})},move:function(a){switch(a){case'ant':if(this.pos===1){return}this.pos--;$('#lancamentos_overflow').animate({'margin-left':'+=710px'},250,function(){if(Lancamentos.pos===1){$('#lancamentos_ant').animate({'opacity':'0'},250).css('cursor','default')}if($('#lancamentos_container a').eq(Lancamentos.pos*3).length){$('#lancamentos_prox').animate({'opacity':'1.0'},250).css('cursor','pointer')}});break;case'prox':if(!$('#lancamentos_container a').eq(this.pos*3).length){return}this.pos++;$('#lancamentos_overflow').animate({'margin-left':'-=710px'},250,function(){$('#lancamentos_ant').animate({'opacity':'1.0'},250).css('cursor','pointer');if(!$('#lancamentos_container a').eq(Lancamentos.pos*3).length){$('#lancamentos_prox').animate({'opacity':'0'},250).css('cursor','default')}});break;default:return;break}}};
/* http://phpjs.org/functions/shuffle:514 */function shuffle(a){var b=[],k='',i=0,strictForIn=false,populateArr=[];for(k in a){if(a.hasOwnProperty(k)){b.push(a[k]);if(strictForIn){delete a[k]}}}b.sort(function(){return 0.5-Math.random()});this.php_js=this.php_js||{};this.php_js.ini=this.php_js.ini||{};strictForIn=this.php_js.ini['phpjs.strictForIn']&&this.php_js.ini['phpjs.strictForIn'].local_value&&this.php_js.ini['phpjs.strictForIn'].local_value!=='off';populateArr=strictForIn?a:populateArr;for(i=0;i<b.length;i++){populateArr[i]=b[i]}return strictForIn||populateArr}
$(function(){if($('#lancamentos').length){Lancamentos.init()}$('[href="#"]').click(function(){return false});TopoImagens.init()});
