if(gaImgPub != ""){
  gaPubImg = Array(gaImgPub);
  gaPubLink = Array(gaLinkPub);
  gaPubTitle = Array('');
  gaPubIco = Array('');

  gaImgUrlDestaquex = gaImgUrlDestaque.concat(gaPubImg);
  gaImgTitleDestaquex = gaImgTitleDestaque.concat(gaPubTitle);
  gaImgLinkDestaquex = gaImgLinkDestaque.concat(gaPubLink);
  gaImgIcoDestaquex = gaImgIcoDestaque.concat(gaPubIco);

  gaImgUrlDestaque = gaImgUrlDestaquex;
  gaImgTitleDestaque = gaImgTitleDestaquex;
  gaImgLinkDestaque = gaImgLinkDestaquex;
  gaImgIcoDestaque = gaImgIcoDestaquex;
}

var gbPause = false;
var gnTotal = gaImgTitleDestaque.length;
var gnSpeed = 10000;
var gnCurrent = 0;
var gnTimer = 0;

function play(pbBt){
  clearTimeout(gnTimer);
  if(!pbBt){
    gnTimer = setTimeout('play(false)', gnSpeed);
  }
  
  if(gnCurrent >= gnTotal){
    gnCurrent = 0;
  }
  
  if(gnCurrent < 0){
    gnCurrent = gnTotal-1;
  }  

  document.getElementById('ImgUrlDestaque').style.backgroundImage = 'url('+gaImgUrlDestaque[gnCurrent]+')';
  if(gaImgTitleDestaque[gnCurrent] != ""){
    document.getElementById('ImgTitleDestaque').innerHTML = '<img src="'+gaImgIcoDestaque[gnCurrent]+'" class="noborder font0" style="width:16px; height:13px;"/>&nbsp;'+gaImgTitleDestaque[gnCurrent];
  }
  else{
    document.getElementById('ImgTitleDestaque').innerHTML = "";
  }
  document.getElementById('ImgLinkDestaque1').href = gaImgLinkDestaque[gnCurrent];
  document.getElementById('ImgLinkDestaque2').href = gaImgLinkDestaque[gnCurrent];
  gnCurrent++;
}

function anterior(){
  gnCurrent = gnCurrent - 2;
  play(true);
  gnTimer = setTimeout('play(false)', gnSpeed);
}

function proximo(){
  play(true);
  gnTimer = setTimeout('play(false)', gnSpeed);
}

function pausar(){
  gbPause = !gbPause;

  if(gbPause){
    clearTimeout(gnTimer);
    document.getElementById('bt_destaque_pausa').style.backgroundImage = "url('"+gaImgHost+"bt_id_play.gif')";
  }
  else{
    play(false);
    document.getElementById('bt_destaque_pausa').style.backgroundImage = "url('"+gaImgHost+"bt_id_pausa.gif')";
  }

}

function aba_mais(psTipo){

  document.getElementById('bloco_mais_comentadas').style.display = 'none';
  document.getElementById('bloco_mais_recomendadas').style.display = 'none';
  document.getElementById('bloco_mais_lidas').style.display = 'none';
  document.getElementById('bloco_mais_noticias').style.display = 'none';  

  document.getElementById('bg_esq_mais_noticias').style.backgroundImage = 'url('+gaImgHost+'bt_canto_esq_cinza2.jpg)';
  document.getElementById('bg_dir_mais_noticias').style.backgroundImage = 'url('+gaImgHost+'bt_canto_dir_cinza2.jpg)';
  document.getElementById('bg_mais_noticias').style.color = '#1865A6';
  document.getElementById('bg_mais_noticias').style.backgroundColor = '#EBEBEB';

  document.getElementById('bg_esq_mais_comentadas').style.backgroundImage = 'url('+gaImgHost+'bt_canto_esq_cinza2.jpg)';
  document.getElementById('bg_dir_mais_comentadas').style.backgroundImage = 'url('+gaImgHost+'bt_canto_dir_cinza2.jpg)';
  document.getElementById('bg_mais_comentadas').style.color = '#1865A6';
  document.getElementById('bg_mais_comentadas').style.backgroundColor = '#EBEBEB';

  document.getElementById('bg_esq_mais_recomendadas').style.backgroundImage = 'url('+gaImgHost+'bt_canto_esq_cinza2.jpg)';
  document.getElementById('bg_dir_mais_recomendadas').style.backgroundImage = 'url('+gaImgHost+'bt_canto_dir_cinza2.jpg)';
  document.getElementById('bg_mais_recomendadas').style.color = '#1865A6';
  document.getElementById('bg_mais_recomendadas').style.backgroundColor = '#EBEBEB';

  document.getElementById('bg_esq_mais_lidas').style.backgroundImage = 'url('+gaImgHost+'bt_canto_esq_cinza2.jpg)';
  document.getElementById('bg_dir_mais_lidas').style.backgroundImage = 'url('+gaImgHost+'bt_canto_dir_cinza2.jpg)';
  document.getElementById('bg_mais_lidas').style.color = '#1865A6';
  document.getElementById('bg_mais_lidas').style.backgroundColor = '#EBEBEB';

  document.getElementById('bg_esq_mais_'+psTipo).style.backgroundImage = 'url('+gaImgHost+'bt_canto_esq_azul.jpg)';
  document.getElementById('bg_dir_mais_'+psTipo).style.backgroundImage = 'url('+gaImgHost+'bt_canto_dir_azul.jpg)';
  document.getElementById('bg_mais_'+psTipo).style.color = '#FFFFFF';
  document.getElementById('bg_mais_'+psTipo).style.backgroundColor = '#055D84';
  document.getElementById('bloco_mais_'+psTipo).style.display = 'block';
}

function prev_signo(pnSigno){
  document.getElementById('signo_ico').style.backgroundImage = 'url('+gaImgHost+'ico_'+gaIcoSigno[pnSigno]+'.jpg)';
  document.getElementById('signo_title').innerHTML = gaTitleSigno[pnSigno];
  document.getElementById('signo_desc').innerHTML = gaDescSigno[pnSigno];
  document.getElementById('signo_href').href = gaHost+'?tp=horoscopo#'+gaIcoSigno[pnSigno];
}

function horoscopo(){
  prev_signo(0);
}