function gamesRotator(e) {
	var self;
	self = this;

	this.index = 0;
	this.container = jqN('#'+e);

	// bind
	this.container.find('.button_prev').click(function() { self.prev(); });
	this.container.find('.button_next').click(function() { self.next(); });

}

gamesRotator.prototype.goto = function(i) {

	this.index = i;

	this.container.find('.panel').eq(this.index).siblings('.panel').css('z-index', '10');
	this.container.find('.panel').eq(this.index).css('z-index', '11');
	this.container.find('.panel').stop(true, true).eq(this.index).fadeIn('slow', function() {
		jqN(this).siblings('.panel').hide();
	});

	this.container.find('.button_item').removeClass('current');
	this.container.find('.button_item').eq(this.index).addClass('current');

}

gamesRotator.prototype.next = function() {
	if (this.index == (this.container.find('.panel').length-1)) {
		this.goto(0);
	} else {
		this.goto((this.index+1));			
	}
}

gamesRotator.prototype.prev = function() {
	if (this.index == 0) {
		this.goto((this.container.find('.panel').length-1));
	} else {
		this.goto((this.index-1));
	}
}
