function Rotator(container, stillTimer, fadeTimer) {
	this._container = container;
	this._stillTimer = stillTimer;
	this._fadeTimer = fadeTimer;
	this._items = $(this._container).children();
	this._activeItem = 0;
	this._pause = false;
	
	$(this._items).eq(0).css("display","block");
	this._nextItem = function() {
		if(this._activeItem < this._items.length - 1) {
			return this._activeItem + 1;
		}
		else {return 0;}
	}
	this.play = function() {
		this._play();
	}
	this.pause = function() {
		this._pause = true;
	}
	this.resume = function() {
		this._pause = false;
	}
}

Rotator.prototype._play = function() {
	var self = this;
	var process = function() {
		if(self._pause == false) {
			$(self._items).eq(self._activeItem).fadeOut(self._fadeTimer);
			var _next = self._nextItem();
			$(self._items).eq(_next).fadeIn(self._fadeTimer);
			self._activeItem = _next;
			self._play();
		}
		else {
			self._play();
		}
	}
	setTimeout(process, this._stillTimer);
}
