mnROL = {
corFundo: '',
animMod: 1,

inicia: function (conteudo){
this.conteudo = conteudo;
this.largura = this.largura!=""? "width: "+this.largura+" !important; ": "";
this.altura = this.altura!=""? "height: "+this.altura+" !important; ": ""; 

document.write("<div style='"+this.largura+this.altura+"overflow: hidden'><div align='left' id='recipiente' style='position: relative'></div></div>");
this.ob = document.getElementById('recipiente');
this.ob.parentNode.parentNode.style.overflow='hidden';
this.ob.parentNode.parentNode.style.background=this.corFundo;
this.largura_pai = navigator.appName.indexOf("Internet Explorer")<0? parseInt(this.ob.parentNode.clientWidth): parseInt(this.ob.parentNode.offsetWidth);
this.pos = this.largura_pai;

this.ob.style.left = this.animMod == 1? this.pos: this.ob.style.left;
this.x= this.animMod == 1? 0: 1;
this.z=0;
this.w=1;
this.foi=0;
this.zeta= 0;
this.ob.innerHTML = this.conteudo[0];
var divisao = String(this.largura_pai/this.passos);
this.acrescimo = parseFloat(divisao.substr(0, divisao.indexOf(".")+3));
this.sid = this.animMod == 1? setInterval("mnROL.anda()", this.tempo*1000): setInterval("mnROL.desaparece()", this.espera);
},

desaparece: function(){
if(this.x>=this.conteudo.length){this.x=0;}
this.ob.innerHTML = this.conteudo[this.x];
this.x++;
},

/*
vaivem: function (arg){
ob.style.left = String(pos)+"px";
},
*/

trava: function (){this.x=-1; this.z=0; clearInterval(this.sid2);},

mudaconteudo: function (){
this.ob.innerHTML = this.conteudo[this.w];
this.w=this.w<this.conteudo.length-1? this.w+1: 0;
this.foi=0;
},

 anda: function (){

	if(this.x<this.passos){
	this.pos = this.pos-this.acrescimo;
	this.ob.style.left = String(this.pos)+"px";

	  if(this.pos<-1*(this.largura_pai)){
	  this.x=-1;
	  this.pos = this.largura_pai;
	  this.ob.style.left = this.pos;
	  
	  if(this.foi>0){this.mudaconteudo();}
	  }
	this.x++
	}else if(this.z<1){
	this.z++;

	  if(this.zeta<this.vezes){
	  this.pos = this.pos-this.acrescimo;
	  this.ob.style.left = String(this.pos)+"px";
	  this.espera2=0;
	  }else{
	  this.zeta=-1; 
	  this.espera2=this.espera;
	  this.foi=1;
	  }
	  
	this.sid2 = setInterval("mnROL.trava()", this.espera2);
	this.zeta++;
	}
  } // fim metodo
} //fim classe

feedOb = {
_x: 0,
mostraTexto: 0,
conteudoFeed: [],
entradas: [],

add: function (){
var texto=new Array();
var texto2=new Array();
var ligacao=new Array();
var y, z, w, x, u;

for(u = 0; u < this.entradas.length; u++){
y = w = z = 0;

var toda=document.getElementById("feed" + String(u)).getElementsByTagName("*");

for(x=0;x<toda.length;x++){

if(toda[x].tagName=="B"){texto[y]=toda[x].firstChild.innerHTML; y++;}
if(toda[x].tagName=="A"){ligacao[z]=toda[x];z++;}
if(toda[x].tagName=="P"){texto2[w]=toda[x].innerHTML;w++;}
}

setorFeed = [];
for(x=0;x<this.entradas[u];x++){

if(ligacao.length>1){
setorFeed[x] = "<li><a class='feedCabec' href='"+ligacao[x].href+"' target='_blank'>"+ (texto[x]) + ".</a>" + (this.mostraTexto>0? "": "</li>") + "<br>";
setorFeed[x] = setorFeed[x] + (this.mostraTexto<1? "": "<p style='position:relative;top:-6px'>" + (texto2[x]) + "</p></li>");

}
}

this.conteudoFeed[u] = setorFeed;
}// fim for u

//document.write("<script type='text/javascript' charset='utf-8' src='/sementes/usra/corrige.php?textotudo="+texto.join("--")+"'></"+"script>");

},//fim metodo

formatFeed: function(){
var conteudoFeed2 = [];
var conteudoFeed22 = [];
var conteudoFeed3 = [];
var randomize = [];
var elemento;
var x ;
var parte = [];
var dividir;
var indiceRandomize;

//Junta as entradas dos sites diferente numa matriz só
for(x = 0; x < this.conteudoFeed.length; x++){
conteudoFeed22 = conteudoFeed22.concat(this.conteudoFeed[x]);
}

//Cria indice aleatorio para ser usado se embaralharFeed for true
for(x = 0; x < conteudoFeed22.length; x++){
randomize[x] = x;
}

for(x = 0; x < conteudoFeed22.length; x++){
indiceRandomize = Math.floor(Math.random() * randomize.length)
elemento = this.embaralharFeed? randomize[indiceRandomize]: x;
conteudoFeed2[x] = conteudoFeed22[elemento];
randomize.splice(indiceRandomize, 1);
}

dividir = Math.ceil(conteudoFeed2.length/this.resultPP);

for(x = 0; x < dividir; x++){
parte = conteudoFeed2.slice(0, this.resultPP);
conteudoFeed3[x] = "<ul>" + parte.join('') + "</ul>";
conteudoFeed2.splice(0, this.resultPP);
}

return conteudoFeed3;
}//fim metodo
}//fim classe
