
	/**
	 * Анимации Ui
	 * 
	 * @author Alexander Osin, dev.majesty@gmail.com
	 * @package MajUi
	 */
	var majFx = {};
	
	/**
	 * Угасание
	 */
	majFx.fade = new Class({
		Implements: [Options],
		element: false,
		fx: false,
		options: {
			callShow: function(){},
			callHide: function(){},
			duration: 'normal',
			opacity: 1
		},
		initialize: function(element, options)
		{
			this.setOptions(options);
			
			this.element = element;
			this.fx = new Fx.Tween(element, {duration: this.options.duration});
		},
		show: function()
		{
			var callback = this.options.callShow;
			this.fx.start('opacity', 0, this.options.opacity).chain(
				function(){callback();}
			);
			
			return this;
		},
		hide: function()
		{
			var callback = this.options.callHide;
			this.fx.start('opacity', this.options.opacity, 0).chain(
				function(){callback();}
			);
			
			return this;
		}
	});
	
	/**
	 * Расширение функциональности элемента
	 */
	Element.implement({
		fxFade: function(options) {return new majFx.fade(this, options);}
	});
