var OM_mooSlideAbsolute = new Class({
	Implements: [Options, Events],
	options: {
		trigger: 'trigger_id',
		holder: 'holder_id',
		slider: 'slider_id',
		transition: Fx.Transitions.Quad.easeInOut,
		duration: 500,
		openDelay: 200,
		closeDelay: 100
	},
	initialize: function(options){
		this.setOptions(options);
		window.addEvent('domready', this.domReady.bind(this));
	},
	domReady: function(){
		this.trigger = $(this.options.trigger);
		this.holder = $(this.options.holder);
		this.slider = $(this.options.slider);
		if(this.validateDomElements()){
			this.slider.set('slide',{
				duration: this.options.duration,
				transition: this.options.transition
			});
			this.slider.slide('hide');
			this.animate();
		}
	},
	animate: function(){
		var that = this;
		this.trigger.addEvents({
			'mouseenter' : function(){
				$clear(that.trigger.retrieve('closeDelay'));
				that.trigger.store('openDelay',that.showDropDown.delay(that.options.openDelay,this,that));
			},
			'mouseleave' : function(){
				$clear(that.trigger.retrieve('openDelay'));
				that.trigger.store('closeDelay',that.hideDropDown.delay(that.options.closeDelay,this,that));
			}
		});
	},
	showDropDown: function(that){
		var slide = that.slider.get('slide');
		that.holder.setStyle('display', 'block');
		slide.slideIn();
	},
	hideDropDown: function(that){
		var slide = that.slider.get('slide');
		slide.slideOut().chain(function(){ that.holder.setStyle('display', 'none'); });
	},
	validateDomElements: function(){
		if(!$defined(this.trigger)){
			alert('DOM Element #' + this.options.trigger + ' manquant');
			return false;
		}
		else if(!$defined(this.holder)){
			alert('DOM Element #' + this.options.holder + ' manquant');
			return false;	
		}
		else if(!$defined(this.slider)){
			alert('DOM Element #' + this.options.slider + ' manquant');
			return false;
		}
		else {
			return true;
		}
	}
});
