/*
 * Gx.Discreet
 */

Gx.Discreet = new Class({
	Implements: [Events, Options],
	options: {
		duration: 300,
		hide: 0.2
	},
	initialize: function(container, element, options) {
		this.setOptions(options);
		this.container = container;
		this.element = element;
		
		this.container.addEvents({
			mouseenter: this.enter.bind(this),
			mouseleave: this.leave.bind(this)
		});
	
		this.element.setOpacity(this.options.hide);
		this.fx = new Fx.Tween(this.element, {
			duration: this.options.duration, 
			link: 'ignore'
		});
	},
	enter: function() {
		this.fx.start('opacity', 1);
	},
	leave: function() {
		this.fx.start('opacity', this.options.hide);
	}
});
