var PaintTestersPage = Class.create();
PaintTestersPage.prototype = {

	// Initializer.
	//
	initialize : function() {
	}, // End initialize().

	// Loads the main Flash component.
	//
	loadFlash : function( giverPromoStatusMode, getterPromoStatusMode ) {

		var RULES_TXT = '../flash/products/paint-testers/rules.txt';
		var DEFAULT_LAYOUT = 0;
		var LAYOUT_1 = 1;
		var LAYOUT_2 = 2;

		// Start with the default layout.
		var layout = DEFAULT_LAYOUT;

		// If the giver promotion is not over...
		if ( ( giverPromoStatusMode == 'promoTeaserMode' ) || ( giverPromoStatusMode == 'promoIsActive' ) ) {

			// Show layout 1.
			layout = LAYOUT_1;

		// Else, if the giver promotion is over, but the getter promotion not is over...
		} else if ( ( getterPromoStatusMode == 'promoTeaserMode' ) || ( getterPromoStatusMode == 'promoIsActive' ) ) {

			// Show layout 2.
			layout = LAYOUT_2;

		} // End if.

		var swfFile = 'testers.swf';
		var swfHeight = '493';
		var flashvars = {};

		switch( layout ) {
		
			// If using layout 1...
			case LAYOUT_1:
				swfFile = 'testersPromo.r03.swf';
				swfHeight = '1060';
				flashvars = {
					giveawayPromo_isOver   : 'false',
					giveawayPromo_rulesSrc : RULES_TXT
				};
				break;

			// If using layout 2...
			case LAYOUT_2:
				swfFile = 'testersPromo.r03.swf';
				swfHeight = '1060';
				flashvars = {
					giveawayPromo_isOver   : 'true',
					giveawayPromo_rulesSrc : RULES_TXT
				};
				break;

			// If using the default layout...
			case DEFAULT_LAYOUT:
			default:
				break;

		} // End switch.

		var params = {
			menu            : 'false',
			wmode           : 'transparent',
			bgcolor         : '#ffffff'
		};

		swfobject.embedSWF( '../flash/products/paint-testers/' + swfFile,
				'my_flashContent', '940', swfHeight, '9.0.0',
				null, flashvars, params, null );

	} // End loadFlash().

} // End class PaintTestersPage.

var paintTestersPage = new PaintTestersPage();

function giveawayPromo_goToRegistration() {
	window.location.href = '../register/main-registration/signup.do';
}
