var tempoRotacao=5; $(function(){  sepCiclo=window.setInterval('trocaSeparador("auto")', (tempoRotacao*1000));  maxHeight=$('div.sep_conteudo#citacoes').height();   if($('div.sep_conteudo#pensamentos').height()>maxHeight){maxHeight=$('div.sep_conteudo#pensamentos').height()}  if($('div.sep_conteudo#poemas').height()>maxHeight){maxHeight=$('div.sep_conteudo#poemas').height()}  $('.conteudos_separadores').css('height',maxHeight); });function trocaSeparador(e){  prevSep=$('.sep_conteudo[rel=activo]');  fatherSep=prevSep.parent();  lastSep=$('div.sep_conteudo:last-child', fatherSep);   firstSep=$('div.sep_conteudo:first-child', fatherSep);  if(e=='auto'){    if(prevSep.attr('id')==lastSep.attr('id')){      proxSep=firstSep;    }else{      proxSep=prevSep.next()    }     proxIndex=$('.conteudos_separadores div.sep_conteudo').index(proxSep);  }  else{    clearInterval(sepCiclo);    sepCiclo=window.setInterval('trocaSeparador("auto")', (tempoRotacao*1000));     clickedSep=$(e).parent();    proxIndex=$('.menu_separadores ul li').index(clickedSep);    proxSep=$('.conteudos_separadores div:nth-child('+(proxIndex+1)+')');  }    prevIndex=$('.conteudos_separadores div.sep_conteudo').index(prevSep);  if(prevIndex==proxIndex){return}  $('.menu_separadores ul li a').css({'background':'#b5c0d7', 'color':'#0b2d7c'});  $('.menu_separadores ul li:nth-child('+(proxIndex+1)+') a').css({'background':'#0b2d7c', 'color':'#dcdcdc'});    proxSep.css('z-index',1);  prevSep.css('z-index',0);    if(e=='auto'){      proxSep.show();    proxSep.attr('rel','activo');     prevSep.attr('rel','');    prevSep.hide();  }else{    proxSep.show().attr('rel','activo');     prevSep.attr('rel','').hide();          } }
