	/*
		Implementa a rotacao das publicidades do site, irá ser invocada repetidamente,
		
		arrPubsT: Array com as publicidades do topo, formato:
				array(indicedaPubCorrente,
							 array(hrefLinkPub1,targetLinkPub1, urlImgPub1),
							 (...)
							 array(hrefLinkPubN,targetLinkPubN, urlImgPubN)
							)
		idA: id do elemento hiperlink da publicidade								
		idImg: id do elemtno img da publicidade
		temporizacaoT: tempo em milissegundos entre mudanças de imagem
	*/
	function RodaPub(arrPubsT, idA, idImg, temporizacaoT){
		var me=this;
		this.objA=document.getElementById(idA);
		this.objImg=document.getElementById(idImg);
		this.arrPubs=arrPubsT;
		this.temporizacao=temporizacaoT;
		
		setInterval (executaIteracao, this.temporizacao);
		
		function executaIteracao(){
			var indCorrArrPub=me.arrPubs[0];
			var arrPubPosCorr=me.arrPubs[indCorrArrPub];
			
			me.objA.href=arrPubPosCorr[0];
			me.objA.target=arrPubPosCorr[1];
			me.objImg.src=arrPubPosCorr[2];
			if(indCorrArrPub==me.arrPubs.length-1)
				me.arrPubs[0]=1;
			else	
				me.arrPubs[0]=indCorrArrPub+1;
		}		
	}

