/**
 *
 * @auther Adam Brill adam@solutionset.com
 * @date 20070122
 *
 * @see prototype.js v1.6
 * @see SS.Base.js for v1.6
 */

SS.Layer = Class.create(SS.Base, {
	/**
	 * Object used to store settings. Extends the parent class settings
	 * @var Object
	 */
	s: {
		className: 'box',
		startHidden: false,
		content: ''
	},
	
	/**
	 * Object used to store nodes. Extends the parent class nodes
	 * @var Object
	 */
	n: {
		el: null
	},
	
	/**
	 * @param function $super
	 * @param object options
	 * @return void
	 */
	initialize: function ($super, options) {
		//run the parent initialize function
		$super (options);
		
		this.n.el = new Element('div');
		
		//add the classname and update the content
		this.n.el.addClassName(this.s.className).update(this.s.content);
		
		document.body.appendChild(this.n.el);
		
		//hide the element
		if(this.s.startHidden === true){
			this.hide();
		}
	},
	
	/**
	 * @return void
	 */
	hide: function () {
		this.n.el.hide();
		this.n.el.fire("ss:close");
		//this.destroy();
	},
	
	/**
	 * @return void
	 */
	show: function () {
		this.n.el.show();
	},
	
	/**
	 * @return void
	 */
	destroy: function() {
		this.n.el.remove();
	}
});
