FlashGamePromotion = function( options ) {
	this.init( options );
}

FlashGamePromotion.prototype = {
	firstPopup : true,
	options : null,
	Promos : null,
	NextPromo : 0,
	TotalPromos : 0,
	init: function( options ) {
		this.options = options;
/*		// Set promotion size
		var promotionContainer = jQuery( '.promotion-container' );
		promotionContainer.css( 'height', options.PromotionHeight + 'px' );
		promotionContainer.css( 'margin-top', '-' + options.PromotionHeight / 2 + 'px' );
		promotionContainer.css( 'width', options.PromotionWidth + 'px' );
		promotionContainer.css( 'margin-left', '-' + options.PromotionWidth / 2 + 'px' );
*/

		this.Promos = jQuery('#flash-game-promos > div');
		this.NextPromo = 0;
		this.TotalPromos = this.Promos.length;
	},

	start: function() {
		this.promotionPopup();
	},

	promotionPopup: function() {
		var self = this;
		jQuery( '.promotion-container' ).hide();
		
		var callBack = function() {
			var $show = self.Promos.length != 0 ? jQuery( '.promotion-container' ).show() : jQuery( '.promotion-container' ).hide();
                        self.Promos.hide();
                        jQuery( self.Promos[ self.NextPromo ] ).show();
                        self.NextPromo = self.NextPromo + 1 < self.TotalPromos ? self.NextPromo + 1 : 0;
		}

		setTimeout( callBack, this.getInterval() );
	},

	getInterval: function() {
		var interval = this.firstPopup ? this.options.FirstInterval : this.options.SecondInterval;
		this.firstPopup = false;
		return interval;
	}
};