var SlideshowSlide = new Class({
	Implements: [Options, Events, Log],
	
	options: {
	},
	
	// Variables
	element: null,
	info: null,
	
	/*
	 * Initialize
	 */
	initialize: function(element, options)
	{
		//this.enableLog();
		this.log("SlideshowSlide::initialize(" + element + ", " + options + ")");
		
		// Set options
		this.setOptions(options);

		// Set variables
		this.element = element;

		// Build slide
		this.build();
	},
	
	/*
	 * Reset
	 */
	reset: function()
	{
		this.log("SlideshowSlide::reset()");
		
	},
	
	/*
	 * Build
	 */
	build: function()
	{
		this.log("SlideshowSlide::build()");

		this.info = this.element.getElement('.info');
		this.info.height = this.info.measure( function() { return this.getSize().y; } );
		this.info.fx = new Fx.Morph(this.info, {
			duration: 250,
			transition: Fx.Transitions.Quad.easeOut,
			link: 'cancel'
		});
		this.info.fx.set({
			'opacity': 0,
			'bottom': -this.info.height
		});

		this.element.show();

		this.info.fx.addEvent('complete', function(event) {

			if(this.info.getStyle('opacity').toInt() == 1)
			{
				//this.log("Slide::fire event::show");
				this.fireEvent('show');

				this.hide.delay(this.options.duration, this);
			}
			else
			{
				//this.log("Slide::fire event::hide");
				this.fireEvent('hide');
			}

		}.bind(this));

		var eventItem = new EventItem(this.element);
	},
	
	/*
	 * Show
	 */
	show: function()
	{
		this.log("SlideshowSlide::show()");

		this.info.fx.start({
			'opacity': 1,
			'bottom': 0
		});
	},
	
	/*
	 * Hide
	 */
	hide: function()
	{
		this.log("SlideshowSlide::hide()");

		this.info.fx.start({
			'opacity': 0,
			'bottom': -this.info.height
		});
	}
	
});
