try{
Popup = Class.create();
Object.extend(Popup, {
	
	element: null,
	
	show: function(element){
		var options = Object.extend({
			overlay: document.viewport,
			timeout: false
		}, arguments[1] || {});
		
		this.close();
		this.element = $(element); 
		this.element.addClassName('popup_content');
		this.element.show();
		df.modal.lightboxon("cccccc");		
		if(options.timeout)
			this.close.delay(options.timeout);
	}.bind(Popup),
	
	isClosed: function(){
		return this.element == null;
	}.bind(Popup),

	close: function(){
		if(this.isClosed())
			return;
		df.modal.lightboxoff();
		this.element.hide();
		this.element.removeClassName('popup_content');
		this.element = null;
	}.bind(Popup)
	
});
}catch(e){}
