//>>built
define("dojox/layout/GridContainer","dojo/_base/kernel dojo/_base/declare dojo/_base/array dojo/_base/connect dojo/_base/sniff dojo/dom-class dojo/dom-style dojo/dom-geometry dojo/dom-construct dojo/_base/lang dojo/_base/window dojo/ready dojox/layout/GridContainerLite".split(" "),function(y,u,q,k,r,n,t,l,p,v,m,w,x){return u("dojox.layout.GridContainer",x,{hasResizableColumns:!0,liveResizeColumns:!1,minColWidth:20,minChildWidth:150,mode:"right",isRightFixed:!1,isLeftFixed:!1,startup:function(){this.inherited(arguments);
if(this.hasResizableColumns){for(var b=0;b<this._grid.length-1;b++)this._createGrip(b);this.getParent()||w(v.hitch(this,"_placeGrips"))}},resizeChildAfterDrop:function(b,a,c){this.inherited(arguments)&&this._placeGrips()},onShow:function(){this.inherited(arguments);this._placeGrips()},resize:function(){this.inherited(arguments);this._isShown()&&this.hasResizableColumns&&this._placeGrips()},_createGrip:function(b){b=this._grid[b];var a=p.create("div",{"class":"gridContainerGrip"},this.domNode);b.grip=
a;b.gripHandler=[this.connect(a,"onmouseover",function(c){for(var e=!1,d=0;d<this._grid.length-1;d++)if(n.contains(this._grid[d].grip,"gridContainerGripShow")){e=!0;break}e||n.replace(c.target,"gridContainerGripShow","gridContainerGrip")})[0],this.connect(a,"onmouseout",function(c){this._isResized||n.replace(c.target,"gridContainerGrip","gridContainerGripShow")})[0],this.connect(a,"onmousedown","_resizeColumnOn")[0],this.connect(a,"ondblclick","_onGripDbClick")[0]]},_placeGrips:function(){var b,a,
c=0,e;q.forEach(this._grid,function(d){d.grip&&(e=d.grip,b||(b=e.offsetWidth/2),c+=l.getMarginBox(d.node).w,t.set(e,"left",c-b+"px"),a||(a=l.getContentBox(this.gridNode).h),0<a&&t.set(e,"height",a+"px"))},this)},_onGripDbClick:function(){this._updateColumnsWidth(this._dragManager);this.resize()},_resizeColumnOn:function(b){this._activeGrip=b.target;this._initX=b.pageX;b.preventDefault();m.body().style.cursor="ew-resize";this._isResized=!0;b=[];var a;for(a=0;a<this._grid.length;a++)b[a]=l.getContentBox(this._grid[a].node).w;
this._oldTabSize=b;for(a=0;a<this._grid.length;a++){var c=this._grid[a];this._activeGrip==c.grip&&(this._currentColumn=c.node,this._currentColumnWidth=b[a],this._nextColumn=this._grid[a+1].node,this._nextColumnWidth=b[a+1]);c.node.style.width=b[a]+"px"}c=function(e,d){var g=0,h=0;q.forEach(e,function(f){1==f.nodeType&&(f=t.getComputedStyle(f),h=(r("ie")?d:parseInt(f.minWidth))+parseInt(f.marginLeft)+parseInt(f.marginRight),g<h&&(g=h))});return g};b=c(this._currentColumn.childNodes,this.minChildWidth);
c=c(this._nextColumn.childNodes,this.minChildWidth);a=Math.round(l.getMarginBox(this.gridContainerTable).w*this.minColWidth/100);this._currentMinCol=b;this._nextMinCol=c;a>this._currentMinCol&&(this._currentMinCol=a);a>this._nextMinCol&&(this._nextMinCol=a);this._connectResizeColumnMove=k.connect(m.doc,"onmousemove",this,"_resizeColumnMove");this._connectOnGripMouseUp=k.connect(m.doc,"onmouseup",this,"_onGripMouseUp")},_onGripMouseUp:function(){m.body().style.cursor="default";k.disconnect(this._connectResizeColumnMove);
k.disconnect(this._connectOnGripMouseUp);this._connectOnGripMouseUp=this._connectResizeColumnMove=null;this._activeGrip&&n.replace(this._activeGrip,"gridContainerGrip","gridContainerGripShow");this._isResized=!1},_resizeColumnMove:function(b){b.preventDefault();this._connectResizeColumnOff||(k.disconnect(this._connectOnGripMouseUp),this._connectOnGripMouseUp=null,this._connectResizeColumnOff=k.connect(m.doc,"onmouseup",this,"_resizeColumnOff"));var a=b.pageX-this._initX;0==a||this._currentColumnWidth+
a<this._currentMinCol||this._nextColumnWidth-a<this._nextMinCol||(this._currentColumnWidth+=a,this._nextColumnWidth-=a,this._initX=b.pageX,this._activeGrip.style.left=parseInt(this._activeGrip.style.left)+a+"px",this.liveResizeColumns&&(this._currentColumn.style.width=this._currentColumnWidth+"px",this._nextColumn.style.width=this._nextColumnWidth+"px",this.resize()))},_resizeColumnOff:function(b){m.body().style.cursor="default";k.disconnect(this._connectResizeColumnMove);k.disconnect(this._connectResizeColumnOff);
this._connectResizeColumnOff=this._connectResizeColumnMove=null;this.liveResizeColumns||(this._currentColumn.style.width=this._currentColumnWidth+"px",this._nextColumn.style.width=this._nextColumnWidth+"px");b=[];var a=[],c=this.gridContainerTable.clientWidth,e=!1,d;for(d=0;d<this._grid.length;d++){var g=this._grid[d].node;r("ie")?(b[d]=l.getMarginBox(g).w,a[d]=l.getContentBox(g).w):(b[d]=l.getContentBox(g).w,a=b)}for(d=0;d<a.length;d++)if(a[d]!=this._oldTabSize[d]){e=!0;break}if(e){a=r("ie")?100:
1E4;for(d=0;d<this._grid.length;d++)this._grid[d].node.style.width=Math.round(100*a*b[d]/c)/a+"%";this.resize()}this._activeGrip&&n.replace(this._activeGrip,"gridContainerGrip","gridContainerGripShow");this._isResized=!1},setColumns:function(b){var a;if(0<b){var c=this._grid.length;b=c-b;if(0<b){var e=[];if("right"==this.mode){var d=this.isLeftFixed&&0<c?1:0;for(c=a=this.isRightFixed?c-2:c-1;c>=d;c--){var g=0;var h=this._grid[c].node;for(a=0;a<h.childNodes.length;a++)if(1==h.childNodes[a].nodeType&&
""!=h.childNodes[a].id){g++;break}0==g&&(e[e.length]=c);if(e.length>=b){this._deleteColumn(e);break}}}else for(a=this.isLeftFixed&&0<c?1:0,d=this.isRightFixed?c-1:c,c=a;c<d;c++){g=0;h=this._grid[c].node;for(a=0;a<h.childNodes.length;a++)if(1==h.childNodes[a].nodeType&&""!=h.childNodes[a].id){g++;break}0==g&&(e[e.length]=c);if(e.length>=b){this._deleteColumn(e);break}}e.length<b&&k.publish("/dojox/layout/gridContainer/noEmptyColumn",[this])}else 0>b&&this._addColumn(Math.abs(b));this.hasResizableColumns&&
this._placeGrips()}},_addColumn:function(b){var a=this._grid,c="right"==this.mode,e=this.acceptTypes.join(","),d=this._dragManager;this.hasResizableColumns&&(!this.isRightFixed&&c||this.isLeftFixed&&!c&&1==this.nbZones)&&this._createGrip(a.length-1);for(var g=0;g<b;g++){var h=p.create("td",{"class":"gridContainerZone dojoxDndArea",accept:e,id:this.id+"_dz"+this.nbZones});var f=a.length;c?this.isRightFixed?(--f,a.splice(f,0,{node:a[f].node.parentNode.insertBefore(h,a[f].node)})):a.push({node:this.gridNode.appendChild(h)}):
this.isLeftFixed?(f=1==f?0:1,this._grid.splice(1,0,{node:this._grid[f].node.parentNode.appendChild(h,this._grid[f].node)}),f=1):(f-=this.nbZones,this._grid.splice(f,0,{node:a[f].node.parentNode.insertBefore(h,a[f].node)}));this.hasResizableColumns&&(!c&&1!=this.nbZones||!c&&1==this.nbZones&&!this.isLeftFixed||c&&g<b-1||c&&g==b-1&&this.isRightFixed)&&this._createGrip(f);d.registerByNode(a[f].node);this.nbZones++}this._updateColumnsWidth(d)},_deleteColumn:function(b){for(var a,c,e=0,d=b.length,g=this._dragManager,
h=0;h<d;h++)c="right"==this.mode?b[h]:b[h]-e,a=this._grid[c],this.hasResizableColumns&&a.grip&&(q.forEach(a.gripHandler,function(f){k.disconnect(f)}),p.destroy(this.domNode.removeChild(a.grip)),a.grip=null),g.unregister(a.node),p.destroy(this.gridNode.removeChild(a.node)),this._grid.splice(c,1),this.nbZones--,e++;b=this._grid[this.nbZones-1];b.grip&&(q.forEach(b.gripHandler,k.disconnect),p.destroy(this.domNode.removeChild(b.grip)),b.grip=null);this._updateColumnsWidth(g)},_updateColumnsWidth:function(b){this.inherited(arguments);
null===b&&(b=this._dragManager);b._dropMode.updateAreas(b._areaList)},destroy:function(){k.unsubscribe(this._dropHandler);this.inherited(arguments)}})});