function Noticias(nome, div, array)
{
	this.nome = nome;
	this.div = document.getElementById(div);
	this.array = array;
	this.delay = 5000;
	this.noticia = 0;
	this.id = 0;
	this.link_modelo = "";
	this.timeout = null;

	if(!div||array.length==0) return;
	else this.atualiza();
}

Noticias.prototype.link = function() { with (this)
{
	return self.location = link_modelo.replace("{id}", id);
}};

Noticias.prototype.proxima = function() { with (this)
{
	noticia++;
	if(noticia==array.length) noticia = 0;
	atualiza();	
}};

Noticias.prototype.anterior = function() { with (this)
{
	noticia--;
	if(noticia<0) noticia = array.length-1;
	atualiza();	
}};

Noticias.prototype.pausa = function() { with (this)
{
	clearTimeout(timeout);
}};


Noticias.prototype.atualiza = function() { with (this)
{
	clearTimeout(timeout);
	
	id = array[noticia][0];
	
 	div.innerHTML = "<p align='left' style='cursor: hand;' onclick='" + nome + ".link()' "+
					"onmouseover='" + nome + ".pausa()' onmouseout='" + nome + ".atualiza()'>"+
					"<b class=texto_azul>" + array[noticia][1] + "</b><BR>"+
					"<span class=texto_cinza><b>" + array[noticia][2] + "</b></span></p>";
					 
	timeout = setTimeout(nome + ".proxima()", delay);
}};