var aovivo = {
	
	scroller: null,
	offset: 0,
	limite: null,
	animando: false,
	interval: null,
	
	start: function () {
		this.scroller = $('div.descricao div.scroll');
		this.limite = this.scroller.find('p').length - 1;
		$('div.descricao a.acima').bind('click.anterior', aovivo.anterior).bind('click.untimer', aovivo.untimer);
		$('div.descricao a.abaixo').bind('click.proximo', aovivo.proximo).bind('click.untimer', aovivo.untimer);
		this.timer();
	},
	
	timer: function () {
		aovivo.interval = setInterval(aovivo.proximo, 6000);
	},
	
	untimer: function () {
		$(this).unbind('click.untimer');
		clearInterval(aovivo.interval);
		return false;
	},
	
	proximo: function () {
		if (aovivo.animando) return false;
		if (aovivo.offset >= aovivo.limite) {
			aovivo.offset = 0
		} else {
			aovivo.offset++;
		}
		aovivo.scroll();
	},
	
	anterior: function () {
		if (aovivo.animando) return false;
		if (aovivo.offset == 0) {
			aovivo.offset = aovivo.limite;
		} else {
			aovivo.offset--;
		}
		aovivo.scroll();
	},
	
	scroll: function () {
		aovivo.animando = true;
		var offset = aovivo.offset * (-50);
		aovivo.scroller.animate({ top: offset + 'px' }, 900, function () {
			aovivo.animando = false;
		});
		return false;
	}
};
