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

// Initialize the survey.
//
initialize : function( refererUrl ) {

	// If a referer URL was specified...
	if ( refererUrl != null ) {

		// If not in the calculator...
		if ( window.location.href.indexOf( 'calculator.do' ) == -1 ) {

			// If navigating from the calculator...
			if ( refererUrl.indexOf( 'calculator.do' ) > 0 ) {

				Event.observe( window, 'load', this.showSurvey.bind( this ) );

			} // End if.

		} // End if.

	} // End if.

}, // End initialize().

showSurvey : function() {

	var surveyCalloutShown = ( GetCookie( 'surveyCalloutShown' ) == 'true' );

	if ( surveyCalloutShown == false ) {

		var container = $( 'calculatorSurvey' );
		container.className = 'calculatorSurveyOn';

		SetCookie( 'surveyCalloutShown', 'true', null, '/' );

	} // End if.

} // End showSurvey().

} // End class CalculatorSurvey.

function closeCalculatorSurvey() {

	var container = $( 'calculatorSurvey' );
	container.className = 'calculatorSurveyOff';

} // End closeCalculatorSurvey().
