Ext.ns('Nexts.layout');

Nexts.layout.CellLayout = Ext.extend(Ext.layout.ContainerLayout, {
	align: 'center',
	
	valign: 'middle',
	
	cellCls: '',
	
	cellStyle: '',
	
	onLayout: function(ct, target) {
		var cs = ct.items.items, len = cs.length, c, i;

		if (!this.cellCt){
			target.addClass('ne-cell-layout-ct');

			// the cellCt prevents wrapping and shuffling while
			// the container is resizing
			this.cellCt = target.createChild({
				tag: 'table',
				cls: 'ne-cell-layout',
				boder: 0,
				cellpadding: 0,
				cellspacing: 0,
				width: '100%',
				height: '100%',
				html: '<tbody><tr><td align="' + this.align + '" valign="' + this.valign + '" class="' + this.cellCls + '" style="' + this.cellStyle + '"></td></tr></tbody>'
			});
		}
		this.renderAll(ct, this.cellCt.child('td'));
	}

});
Ext.Container.LAYOUTS['n.cell'] = Nexts.layout.CellLayout;

