/**
 * @constructor
 * @param {Object} options The options : {modal:false}
 */
hui.ui.Box = function(options) {
	this.options = hui.override({},options);
	this.name = options.name;
	this.element = hui.get(options.element);
	this.body = hui.get.firstByClass(this.element,'hui_box_body');
	this.close = hui.get.firstByClass(this.element,'hui_box_close');
	this.visible = !this.options.absolute;
	if (this.close) {
		hui.listen(this.close,'click',this._close.bind(this));
	}
	hui.ui.extend(this);
};

/**
 * Creates a new box widget
 * @param {Object} options The options : {width:0,padding:0,absolute:false,closable:false}
 */
hui.ui.Box.create = function(options) {
	options = options || {};
	options.element = hui.build('div',{
		'class' : options.absolute ? 'hui_box hui_box_absolute' : 'hui_box',
		html : (options.closable ? '<a class="hui_box_close" href="#"></a>' : '')+
			'<div class="hui_box_top"><div><div></div></div></div>'+
			'<div class="hui_box_middle"><div class="hui_box_middle">'+
			(options.title ? '<div class="hui_box_header"><strong class="hui_box_title">'+hui.string.escape(hui.ui.getTranslated(options.title))+'</strong></div>' : '')+
			'<div class="hui_box_body" style="'+
			(options.padding ? 'padding: '+options.padding+'px;' : '')+
			(options.width ? 'width: '+options.width+'px;' : '')+
			'"></div>'+
			'</div></div>'+
			'<div class="hui_box_bottom"><div><div></div></div></div>',
		style : options.width ? options.width+'px' : null
	});
	return new hui.ui.Box(options);
};

hui.ui.Box.prototype = {
	_close : function(e) {
		hui.stop(e);
		this.hide();
		this.fire('boxWasClosed'); // Deprecated
		this.fire('close');
	},
	shake : function() {
		hui.effect.shake({element:this.element});
	},

	/**
	 * Adds the box to the end of the body
	 */
	addToDocument : function() {
		document.body.appendChild(this.element);
	},
	/**
	 * Adds a child widget or node
	 */
	add : function(widget) {
		if (widget.getElement) {
			this.body.appendChild(widget.getElement());
		} else {
			this.body.appendChild(widget);
		}
	},
	/**
	 * Shows the box
	 */
	show : function() {
		var e = this.element;
		if (this.options.modal) {
			var index = hui.ui.nextPanelIndex();
			e.style.zIndex = index+1;
			hui.ui.showCurtain({widget:this,zIndex:index});
		}
		if (this.options.absolute) {
			hui.style.set(e,{ display : 'block', visibility : 'hidden' });
			var w = e.clientWidth;
			var top = (hui.window.getViewHeight() - e.clientHeight) / 2 + hui.window.getScrollTop();
			hui.style.set(e,{
        marginLeft : (w/-2)+'px',
        top : top+'px',
        display : 'block',
        visibility : 'visible'
      });
		} else {
			e.style.display = 'block';
		}
		this.visible = true;
		hui.ui.callVisible(this);
	},
	/** If the box is visible */
	isVisible : function() {
		return this.visible;
	},
	/** @private */
	$$layout : function() {
		if (this.options.absolute && this.visible) {
			var e = this.element;
			var w = e.clientWidth;
			var top = (hui.window.getViewHeight()-e.clientHeight)/2+hui.window.getScrollTop();
			hui.style.set(e,{'marginLeft':(w/-2)+'px',top:top+'px'});
		}
	},
	/**
	 * Hides the box
	 */
	hide : function() {
		hui.ui.hideCurtain(this);
		this.element.style.display='none';
		this.visible = false;
		hui.ui.callVisible(this);
	},
	/** @private */
	$curtainWasClicked : function() {
		this.fire('boxCurtainWasClicked');
		if (this.options.curtainCloses) {
			this._close();
		}
	}
};
@@ -2506,24 +2506,20 @@
 set(e,%7B%0A
-        
+%09%09%09%09
 marginLe
@@ -2536,24 +2536,20 @@
 )+'px',%0A
-        
+%09%09%09%09
 top : to
@@ -2556,24 +2556,20 @@
 p+'px',%0A
-        
+%09%09%09%09
 display 
@@ -2583,16 +2583,12 @@
 k',%0A
-        
+%09%09%09%09
 visi
@@ -2610,14 +2610,11 @@
 le'%0A
-      
+%09%09%09
 %7D);%0A

Converted spaces to tabs