var Disabler = new Class({
	initialize: function(disabler_id, hidden_class){
		this.disabler = $(disabler_id);
		this.hidden_class = hidden_class;
		this.max_opacity = 0.5;
	}
});

Disabler.implement({
	show: function() {
		var obj = this;
		this.setPosition();
		this.disabler.removeClass(this.hidden_class);
		new Fx.Morph(this.disabler, {
			duration: 300
		}).start({
			opacity: [0, obj.max_opacity]
		});
	},
	hide: function() {
		var obj = this;
		new Fx.Morph(this.disabler, {
			duration: 100, 
			onComplete: function() {
				obj.disabler.addClass(obj.hidden_class);
			}
		}).start({
			opacity: [obj.max_opacity, 0]
		});
	}, 
	setPosition: function() {
		var coord = this.disabler.getParent().getCoordinates();
		
		this.disabler.setStyles({
			top: coord.top, 
			left: coord.left, 
			width: coord.width, 
			height: coord.height, 
			opacity: 0
		});
	}
});