/*
--------------------------------------------------------------------------------
 JavaScript: Dynamic Event Landing Page.
--------------------------------------------------------------------------------
*/

var PromotionPage = Class.extend( {

// Reference to the disclaimers.
disclaimers : null,

// Reference to the disclaimers link.
disclaimersLink : null,

// Reference to the details pane.
details : null,

// Reference to the details link.
detailsLink : null,

// Initializer.
//
init : function() {

	var thisObj = this;

	this.disclaimers = $( '#my_disclaimers' )[ 0 ];
	if ( this.disclaimers != null ) {
		this.disclaimersLink = $( '#my_disclaimersLink' )[ 0 ];
		this.toggleDisclaimers(); // Start with the disclaimers collapsed.
		$( this.disclaimersLink ).click(
			function( e ) {
				thisObj.toggleDisclaimers();
			}
		);
	}
	
	this.details = $( '#my_details' )[ 0 ];
	this.detailsLink = $( '#my_detailsLink' )[ 0 ];
	this.toggleDetails(); // Start with the details collapsed.
	if ( this.detailsLink != null ) {
		$( this.detailsLink ).click(
			function( e ) {
				thisObj.toggleDetails();
			}
		);
	} // End if.

	// If the showTires variable is in the URL, open the details pane.
	var startWithTires = ( $.getQueryString( { id: "showTires" } ) == 'true' );
	if ( startWithTires ) this.toggleDetails();

}, // End init().

toggleDisclaimers : function() {

	if ( this.disclaimers.className == 'my_disclaimersOff' ) {
		this.disclaimers.className = 'my_disclaimersOn';
	} else {
		this.disclaimers.className = 'my_disclaimersOff';
	} // End if.

}, // End toggleDisclaimers().

toggleDetails : function() {

	if ( this.details.className == 'my_detailsOff' ) {
		this.details.className = 'my_detailsOn';
	} else {
		this.details.className = 'my_detailsOff';
	} // End if.

} // End toggleDetails().

} ); // End class PromotionPage.
