/**
 * Component: Banner Fade JS
 * la.jimmy
 *
 * (c) Copyright 2008 James Thomas
 *
 * @version 1.0.0, 09/01/2008
 * @author	James Thomas <me@jimmy.la>
 * @requires Mootools 1.2
 *
 */

var Banner = new Class({

	/**
	 * Creates an instance of the Banner class and initializes required properties
	 *
	 * @param objElem Object The HTML element of a nifty title
	 * @param objSettings Object An associative array containing settings for this instance
	 * @param fnAfterInit Function OPTIONAL - Call this function after initializing the rack
	 *
	 */
	initialize: function( objElem, objSettings, fnAfterInit )
	{

		// Copy the values into the rack object
		this.objElem = objElem;

		// if the settings object was not passed in, or is null, then use default settings
		if( $chk( objSettings ))
		{
			this.objSettings = objSettings;
		}
		else
		{
			// Create the settings object
			this.objSettings = new Object();

			// The color to fade the background to
			this.objSettings.strFadeTo = '#FFFFC2';
		}

		// If there was an "AfterInit" function passed, call it
		if( fnAfterInit )
		{
			// Call the "AfterInit" function
			fnAfterInit();
		}

		// Fade the bg
		var objFadeEffect = new Fx.Morph( objElem, {duration: 2000, transition: Fx.Transitions.Sine.easeIn });
		
		objFadeEffect.start({
			'background-color': this.objSettings.strFadeTo
		});

	}

});
