nClass('PhiloxWindow', {
	element: null,
	parameters: null,
	
	initialize: function(id, parameters) {
		this.element = $(id);
		this.parameters = parameters;
		
		// draggable
		if (this.parameters['draggable']) {
			new Draggable(id, { handle: 'PhiloxWindowHandle', starteffect: null, endeffect: null });
		}
		
		// hidden
		if (this.parameters['hidden']) this.hide();
		
		// float
		if (this.parameters['float']) {
			this.element.style.position = 'absolute';
			var innerWidth = ((window.innerWidth) ? window.innerWidth : document.documentElement.clientWidth);
			var innerHeight = ((window.innerHeight) ? window.innerHeight : document.documentElement.clientHeight);
			this.element.style.left = ((innerWidth) ? ((innerWidth > this.element.clientWidth) ? parseInt((innerWidth - this.element.clientWidth) / 2) : 0) : 0) + 'px';
			this.element.style.top = ((innerHeight) ? ((innerHeight > this.element.clientHeight) ? parseInt((innerHeight - this.element.clientHeight) / 3) : 0) : 0) + 'px';
			this.element.style.zIndex = 8;
		}
	},
	
	hide: function() {
		if (this.parameters['float'])
			// floated content does not have a 'width' property when display: none
			this.element.setStyle({ visibility: 'hidden' });
		else
			this.element.hide();
	},
	
	show: function() {
		if (this.parameters['float'])
			// floated content does not have a 'width' property when display: none
			this.element.setStyle({ visibility: 'visible' });
		else
			this.element.show();
	}
});
