var Overlay = new Class({

	initialize: function(){
		
	},
	
	show: function(){
		
		this.overlay = new Element('div').setProperty('id', 'overlay').injectInside(document.body);
		
		$$('#overlay').addEvent('click', function(){
			this.exit();
		}.bind(this));
		
		this.fade = new Fx.Morph('overlay', {duration: 'long', transition: Fx.Transitions.Sine.easeOut});
		this.fade.start();
		
		var myEffect = new Fx.Morph('overlay', {duration: 'normal', transition: Fx.Transitions.Quad.easeIn});


		myEffect.start({
		    'filter': ['alpha(opacity=10)','alpha(opacity=70)'],
			'-moz-opacity': [.1,0.7],
			'-khtml-opacity': [.1,0.7],
			'opacity': [.1,0.7],
			'z-index': 5
		});
		
		
	},
	
	exit: function(){
		this.overlay.destroy();
		$('panel-holder').destroy();
	},
	
	test: function(){
		this.bg = new Overlay();
		this.bg.show();
			
		this.holder_status = true;
		this.container = new Element('div').setProperties({'id': 'panel-holder'}).injectInside(document.body);
		
		var myEffect = new Fx.Morph('panel-holder', {duration: 'normal', transition: Fx.Transitions.Quad.easeIn});
		myEffect.start({
		    'filter': ['alpha(opacity=0)','alpha(opacity=100)'],
			'-moz-opacity': [0,1],
			'-khtml-opacity': [0,1],
			'opacity': [0,1]
		});
	}
});

var overlay = new Overlay();