//Função ©SLIDE JOEBER
/*
Não autorizo o uso do script javascript abaixo em nenhum outro mecanismo, site, ferramenta ou qualquer tipo de meio.
Este script é de uso exclusivo para o site www.costaricaviola.com.br
Autor: Joeber Gonçalves Garcia
Celular: (67) 8168-4135
*/
function mudarImagem(num,vetor,titulos,id_super,tipo)
{
	if(num == vetor.length)
	{
		num = 1;	
	}

	document.getElementById('rota'+num).style.backgroundColor = '#d0d0d0';	
	document.getElementById('areaSuperDestaque').innerHTML = "<a href='noticia.php?idNoticia="+id_super[num]+"'><img src='"+vetor[num]+"' border='0' /></a>";
	document.getElementById('areaTitSuper').innerHTML = "<a href='noticia.php?idNoticia="+id_super[num]+"'>"+titulos[num]+"</a>";
	
	if(num == 1)
	{
		document.getElementById('rota'+(vetor.length-1)).style.backgroundColor = '#f0f0f0';		
	}
	
	if(num > 1 && num < vetor.length)
	{
		document.getElementById('rota'+(num-1)).style.backgroundColor = '#f0f0f0';	
	}
	
		
	//escolhe tipo
	if(tipo == 'pausa')
	{
		//CÓDIGO PARA PAUSAR
		clearTimeout(tempoRotativo);
		for(i = 1; i < vetor.length; i++)
		{
			if(i == num)
			{
				document.getElementById('rota'+i).style.backgroundColor = '#c0c0c0';			
			}
			else
			{
				document.getElementById('rota'+i).style.backgroundColor = '#f0f0f0';			
			}
		}
		//FIM CÓDIGO PARA PAUSAR
		
			tipo = 'auto';
			
			num2 = (num+1);
			vetor2 = vetor;
			titulos2 = titulos;
			id_super2 = id_super;
			tempoRotativo = window.setTimeout("mudarImagem(num2,vetor2,titulos2,'"+tipo+"')",3000);

		
	}
	else
	{
		//CÓDIGO AUTOMÁTICO
		
		if(num == (vetor.length)-1)
		{
			num=1;
		}
		else
		{
			num++;
		}
	
		
		num2 = num;
		vetor2 = vetor;
		titulos2 = titulos;
		id_super2 = id_super;
		tempoRotativo = window.setTimeout("mudarImagem(num2,vetor2,titulos2,id_super2,'"+tipo+"')",7000);
		
		//FIM CÓDIGO AUTOMÁTICO
	
	}//fim escolhe tipo
	

}//FIM Função ©SLIDE JOEBER
