function Rotativo(args) {	
	var me = this;
	this.index = 0;
	this.qntd = args.qntd;
	this.timer = false;
	this.aux = 0;
	this.intervalo = (args.intervalo)?args.intervalo:5000;
	this.pref_imgs = (args.pref_imgs)?args.pref_imgs:"#b";
	
	this.setIndex = function(indx){
		//alert('indx:'+indx+' aux: '+me.aux+'index:'+me.index)
		if(indx != me.aux){
			me.index = indx;
			$(me.pref_imgs+me.index).fadeIn("slow");
			$(me.pref_imgs+me.aux).fadeOut("slow");		
			me.aux = me.index;
		}
	}
	this.proximo = function(){		
		if(me.index < me.qntd-1){
			me.index++;
		}else{
			me.index = 0;
		}	
		me.setIndex(me.index);	
	}
	this.anterior = function(){		
		if(me.index > 0){
			me.index--;
		}else{
			me.index = me.qntd-1;
		}		
		me.setIndex(me.index);	
	}
	this.stop = function(){		
		clearInterval(me.timer);
	}
	this.init = function(){
		me.timer = setInterval(function(){
			me.proximo();		
		}, me.intervalo);
		
	}
}
