// properties are directly passed to `create` method
var piLayer;
var pubInterface;
var pubInterfaceClass = Class.create();
pubInterfaceClass.prototype = {
		initialize: function() {
			this.trigger = new Element('a', {href: '#'});
			this.id = "piLayer";
			
			var elm = "<div id='lightbox-layer-"+this.id+"' class='lightbox-layer'><div class='close'><a href='javascript:void(0);'>";
			elm += "<span class='access'>Close Layer</span></a></div>";
			elm += "<div class='layer-content'><div id='layer-content-"+this.id+"'></div></div></div>";
			
			new Insertion.Before($('footer-position-placeholder'), elm);

			var node = $("lightbox-layer-" + this.id);
			var key="lightbox-layer-"+ this.id;

			piLayer = new pubLayer(node, this.trigger, this.id, layerOptions['external']);
			GLOBAL_LAYER_CONTROLLER[key] = piLayer;
		},
		
		openLinkLayer: function(link, type) {
			//set class of layer
			$('lightbox-layer-'+this.id).addClassName('lightbox-layer-'+type);
			
//			piLayer.debug = true;
			piLayer.iframehref = link;
			
			piLayer.open();
		}
};

document.observe('dom:loaded', function() {
	pubInterface = new pubInterfaceClass();
});
