function Eventos()
{
}
Eventos.prototype.defaultInterval;
Eventos.prototype.actual = 0;
Eventos.prototype.total = 0;
Eventos.prototype.last = 0;
Eventos.prototype.hideAll = function()
{
	$("ul.event li").each(function(){
		$(this).hide();
	});
}
Eventos.prototype.count = function()
{
	return this.total;
}
Eventos.prototype.next = function()
{
	eventos.actual = ((eventos.actual + 1) % eventos.count());
	eventos.hideAll();
	$("ul.event li:eq(" + eventos.actual + ")").show();
}
Eventos.prototype.start = function(interval)
{
	this.total = $("ul.event li").length;
	
	if(this.interval === undefined || this.interval === null || isNaN(this.interval)) {
		if(!isNaN(interval)) this.interval = interval;
		else this.interval = this.defaultInterval;
	}
	
	if(this.timeout !== undefined) window.clearInterval(this.timeout);
	this.timeout = window.setInterval(function(){
		eventos.next();
	}, this.interval * 1000);
}
Eventos.prototype.stop = function()
{
	if(this.timeout !== undefined) window.clearInterval(this.timeout);
}
Eventos.prototype.reset = function()
{
	$("ul.event li").each(function(){
		$(this).hide();
	});
	this.actual = Math.floor(Math.random()*$("ul.event li").length);
	$("ul.event li:eq(" + eventos.actual + ")").show();
}

var eventos = new Eventos();

$(document).ready(function(){
	var interval = 2;
	
	eventos.reset();
	eventos.start(interval);
	
	$("ul.event li").each(function(){
		$(this).mouseover(function(){
			eventos.stop();
		});
		$(this).mouseout(function(){
			eventos.start(interval);
		});
	});
});

