AdfPivotTableUtils.prototype.determineScrollbarStatus=function(a,b,c,d,e){for(var f=[],g=0;2>g;++g){var h=c[1-g]+b[g],l=a[g]-d[1-g];f[g]=h>l?!0:h<=l-e[g]?!1:AdfPivotTableUtils.MAYBE}for(g=0;2>g;++g)f[g]===AdfPivotTableUtils.MAYBE&&(f[g]=!0===f[1-g]);return f};AdfPivotTableUtils.allocateSpace=function(a,b,c,d,e){"%"==e?d=Math.floor(d*a):(d=Math.min(d,a-1),d=Math.max(d,0));a>=b+c?(a=b,c=b=!1):b<=d?(a=b,b=!1,c=!0):c<=a-d?(a-=c,b=!0,c=!1):(a=d,c=b=!0);return[a,b,c]};
AdfPivotTableUtils.prototype.displayScrollbarSpacer=function(a){var b=a.spacer;b.style.display="inline";b.style.position="absolute";this.setPos(AdfPivotTableUtils.COLUMN_EDGE,a.left,b,!0);this.setPos(AdfPivotTableUtils.ROW_EDGE,a.top,b);b.style.zIndex="3";this.setCachedSize(b,a.innerWidth,AdfPivotTableUtils.COLUMN_EDGE);this.setCachedSize(b,a.innerHeight,AdfPivotTableUtils.ROW_EDGE)};
AdfPivotTableUtils.prototype.sizePivotTable=function(a,b){this.startTimer(0,2);var c=this._rightToLeft,d=this._hasStatusBar,e=this.isShrinkToFit(),f=this._colHeaders,g=this._rowHeaders,h=this._headers,l=this._databodies,m=this._databodyScrollers,n=this._corner,p=this._statusBar,q=this._scrollbarSpacers,r=this._innerContainer,w=this._scrollbarTester,v=AdfPivotTableUtils.CONTAINER_EXTRA_SIZE,x=AdfPivotTableUtils.DATABODY_EXTRA_SIZE,z=AdfPivotTableUtils.HEADER_EXTRA_PIXEL_EXTENT,t=AdfPivotTableUtils.HEADER_EXTRA_PIXEL_DEPTH,
B=AdfPivotTableUtils.SCROLLBAR_SPACER_EXTRA_LENGTH,F=AdfPivotTableUtils.SCROLLBAR_SPACER_EXTRA_BREADTH,D=[F[1],F[0]],A=[a-v[0],b-v[1]];this.checkpointTimer(0,"get pivot table divs and sizing constants");var y=this._sizeAttr,E=this._splitSlice,G=this._startPane,H=this._paneExtent,I=[[0,0],[0,0]];if(this._pivotTablePeer._isPaging){for(var u=0;2>u;u++)for(var C=this._startPane[u];2>C;C++)I[u][C]=this._pagingControl[u][C].childNodes[0].offsetHeight,this._pagingControl[u][C].parentNode.style.height=I[u][C]+
"px",I[u][C]=this._pagingControl[u][C].parentNode.offsetHeight;A[1]=A[1]-I[0][1]-I[1][1]-I[1][0]}var J=this._pivotTablePeer._isPaging?[0,0]:[w.offsetWidth-w.clientWidth,w.offsetHeight-w.clientHeight],K=d?p.offsetHeight:0,L=[A[0],A[1]-K];this.checkpointTimer(0,"get scrollbar sizes and status bar size");var Q=[[],[]],R=[0,0],M=[],w=[],N=[],T=[],O=this._emptyTextDiv;if(O){for(u=0;2>u;++u)for(C=G[u];2>C;++C)Q[u][C]=0;M=[!1,!1];w=[0,0];u=AdfAgent.AGENT.getIntAttribute(O,"_totHorizMargin");y=AdfAgent.AGENT.getIntAttribute(O,
"_totVertMargin");H=AdfDhtmlPivotTablePeer._getChildById(O,O.id+"Inner");N=AdfPivotTableUtils.HEADER_OUTER_PIXEL_DEPTH_NO_DATA;T=[H.offsetWidth+u,H.offsetHeight+y]}else{for(var V=[],u=0;2>u;++u){for(C=G[u];2>C;++C){var M=this.getHeaderBlocksSize(this._buffers2[u][C],y[u]),Y=H[u][C]-this.getSliceCountInBuffer(u,C);Q[u][C]=M+Y*this._defaultSliceSize[u];R[u]+=Q[u][C]}V[u]=this.getFirstHeaderBlockSize(this._buffers2[u][1],y[1-u])}M=this._pivotTablePeer._isPaging?[!1,!1]:this.determineScrollbarStatus(L,
R,V,t,J);for(u=0;2>u;++u)w[u]=M[1-u]?J[u]:0,N[u]=V[u]+t[u],T[u]=R[u]+w[u]}R=[];y=[];Y=[];H=[[],[]];C=[];V=[[],[]];for(u=0;2>u;++u){var P=L[u]-t[1-u]-w[u],W=N[1-u]-t[1-u],U=T[u]-w[u];if(O)var S=.15,X="%";else S=this._headerSizeAllocation[1-u],X=this._headerSizeAllocUnit[1-u];P=AdfPivotTableUtils.allocateSpace(P,W,U,S,X);R[1-u]=P[0];y[1-u]=R[1-u]+t[1-u];O||this._pivotTablePeer._isPaging?(Y[u]=!1,H[u][1]=!1):(Y[u]=P[1],H[u][1]=P[2]);C[1-u]=Y[u]?J[1-u]:0;V[1-u][1]=H[u][1]?J[1-u]:0}AdfAssert.assert(AdfPivotTableUtils.assertsOff||
w[1]==Math.max(C[1],V[1][1])&&w[0]==Math.max(C[0],V[0][1]));this.checkpointTimer(0,"get block sizes, calc canvas size, and allocate space between headers/databody");if(e){for(u=0;2>u;++u)L[u]=Math.min(L[u],N[1-u]+T[u]);A[0]=L[0];A[1]=L[1]+K}K=[];t=[[],[]];for(u=0;2>u;++u)if(K[u]=L[u]-y[1-u],-1!=E[u])for(C=AdfPivotTableUtils.allocateSpace(K[u]-w[u],Q[u][0],Q[u][1],this._splitPercentage[u],"%"),t[u][0]=C[0],t[u][1]=K[u]-t[u][0],O?(H[u][0]=!1,H[u][1]=!1):(H[u][0]=C[1],H[u][1]=C[2]),C=G[u];2>C;++C)V[1-
u][C]=H[u][C]?J[1-u]:0;else t[u][1]=K[u];this.checkpointTimer(0,"shrink to fit; calc databody region sizes");J=[[],[]];N=[];T=[[],[]];O=[[],[]];for(u=0;2>u;++u){P=0;W=-1==E[u]?2:3;Y[u]&&++P;for(C=G[u];2>C;++C)H[u][C]&&(N[u]=C,++P);if(this._pivotTablePeer._isPaging?0:0<P&&P<W){P=1==u&&c?0:L[1-u]-w[1-u];W=w[1-u]-F[u];U=0;S=y[1-u];if(!Y[u]){var C=N[u],X=q[u][C],Z=S-B[u];if(1==u)J[u][C]={spacer:X,left:P,top:U,innerWidth:W,innerHeight:Z};else{var aa=c?L[u]-S-U:U;J[u][C]={spacer:X,left:aa,top:P,innerWidth:Z,
innerHeight:W}}}for(C=G[u];2>C;++C)U+=S,S=t[u][C],H[u][C]?(T[u][C]=!1,O[1-u][C]=0):(X=q[u][C],1==C&&(S-=w[u]),Z=S-B[u],1==u?J[u][C]={spacer:X,left:P,top:U,innerWidth:W,innerHeight:Z}:(aa=c?L[u]-S-U:U,J[u][C]={spacer:X,left:aa,top:P,innerWidth:Z,innerHeight:W}),T[u][C]=!0,O[1-u][C]=w[1-u])}else for(C=G[u];2>C;++C)T[u][C]=!1,O[1-u][C]=0}if(T[0][1]&&M[1]||T[1][1]&&M[0])var ba={spacer:this._cornerScrollbarSpacer,left:c?0:L[0]-w[0],top:L[1]-w[1],innerWidth:w[0]-D[0],innerHeight:w[1]-D[1]},B=!0;else B=
!1;this.checkpointTimer(0,"Scrollbar spacer calcs");D=y[0];for(u=G[1];2>u;++u){this.setPos(AdfPivotTableUtils.ROW_EDGE,D,g[u]);for(F=G[0];2>F;++F)this.setPos(AdfPivotTableUtils.ROW_EDGE,D,l[u][F]),0<u+F&&this.setPos(AdfPivotTableUtils.ROW_EDGE,D,m[u][F]);D+=t[1][u]+I[1][0]}d&&(this.setPos(AdfPivotTableUtils.ROW_EDGE,L[1],p),this.setPos(AdfPivotTableUtils.COLUMN_EDGE,0,p,!0));if(c){c=0;L=w[0];D=[O[0][0],O[0][1]];for(F=1;F>=G[0];--F){this.setPos(AdfPivotTableUtils.COLUMN_EDGE,c,f[F],!0);for(u=G[1];2>
u;++u)this.setPos(AdfPivotTableUtils.COLUMN_EDGE,L,l[u][F],!0),0<u+F&&this.setPos(AdfPivotTableUtils.COLUMN_EDGE,D[u],m[u][F],!0);L=c+=t[0][F];D[0]=c;D[1]=c}for(u=G[1];2>u;++u)g[u]._left=K[0]}else{c=y[1];for(F=G[0];2>F;++F){this.setPos(AdfPivotTableUtils.COLUMN_EDGE,c,f[F],!0);for(u=G[1];2>u;++u)this.setPos(AdfPivotTableUtils.COLUMN_EDGE,c,l[u][F],!0),0<u+F&&this.setPos(AdfPivotTableUtils.COLUMN_EDGE,c,m[u][F],!0);c+=t[0][F]}for(u=G[1];2>u;++u)g[u]._left=0}this.checkpointTimer(0,"position pt divs");
for(u=0;2>u;++u)for(-1!=E[u]&&(f=this._databodyScrollersByEdgeAndPane[u][0],g=t[u][0],this.setCachedSize(f,g,u),c=this._usableSizeAttr[u],f[c]=g,this._maxScrollPos[u][0]=Math.max(0,Q[u][0]-g)),C=G[u];2>C;++C)f=this._databodyScrollersByEdgeAndPane[u][C],g=t[1-u][1]-O[1-u][C],this.setCachedSize(f,g,1-u),g-=V[1-u][C],c=this._usableSizeAttr[1-u],f[c]=g,1==C&&(this._maxScrollPos[1-u][1]=Math.max(0,Q[1-u][1]-g));for(u=0;2>u;++u)for(C=G[u];2>C;++C)this.setCanvasSizeByEdgeAndPane(u,C,Q[u][C]);this.setCachedSize(n,
y[1],AdfPivotTableUtils.COLUMN_EDGE);this.setCachedSize(n,y[0],AdfPivotTableUtils.ROW_EDGE);Q=[[],[]];for(u=1;0<=u;--u)for(C=G[u];2>C;++C)Q[u][C]=t[u][C]-z[u],this.setCachedSize(h[u][C],R[u],1-u),this.setCachedSize(h[u][C],Q[u][C],u);for(u=0;2>u;++u)for(C=G[u];2>C;++C)for(h=t[u][C]-(C?w[u]:0)-x[u],z=G[1-u];2>z;++z)this.setCachedSize(u?l[C][z]:l[z][C],h,u);d&&this.setCachedSize(p,A[0],AdfPivotTableUtils.COLUMN_EDGE);for(u=0;2>u;++u)for(C=0;2>C;++C)J[u][C]?this.displayScrollbarSpacer(J[u][C]):q[u][C].style.display=
"none";B?this.displayScrollbarSpacer(ba):this._cornerScrollbarSpacer.style.display="none";this.checkpointTimer(0,"size PT divs, show/hide spacers");if(!AdfPivotTableUtils.isMobileTouchDevice()&&!this._pivotTablePeer._isPaging)for(u=0;2>u;++u)for(d=u?"overflowY":"overflowX",C=G[u];2>C;++C)l=H[u][C]?"scroll":"hidden",f=this._databodyScrollersByEdgeAndPane[u][C],f.style[d]=l;this._scrollerInit||(AdfPivotTableUtils.isMobileTouchDevice()||(m[0][1].style.overflowX="hidden",m[1][0].style.overflowY="hidden",
this._headers[0][0].style.overflow="hidden",this._headers[1][0].style.overflow="hidden"),this._scrollerInit=!0);this.setCachedSize(r,A[0],0);-1==E[AdfPivotTableUtils.ROW_EDGE]?this.setCachedSize(r,A[1],1):this.setCachedSize(r,A[1]+I[1][0],1);this._pivotTablePeer._isPaging&&(-1==E[AdfPivotTableUtils.COLUMN_EDGE]?(this._pagingControl[0][1].style.position="absolute",this._pagingControl[0][0].style.visibility="hidden",this._pagingControl[0][1].style.width=t[0][1]+"px",this._rightToLeft?this._pagingControl[0][1].style.marginRight=
n.offsetWidth+"px":this._pagingControl[0][1].style.marginLeft=n.offsetWidth+"px"):(this._pagingControl[0][0].style.position="absolute",this._pagingControl[0][0].style.width=t[0][0]+"px",this._rightToLeft?this._pagingControl[0][0].style.marginRight=n.offsetWidth+"px":this._pagingControl[0][0].style.marginLeft=n.offsetWidth+"px",this._pagingControl[0][0].style.visibility="visible",this._pagingControl[0][1].style.position="absolute",this._pagingControl[0][1].style.width=t[0][1]+"px",this._rightToLeft?
this._pagingControl[0][1].style.marginRight=n.offsetWidth+t[0][0]+"px":this._pagingControl[0][1].style.marginLeft=n.offsetWidth+t[0][0]+"px"),-1==E[AdfPivotTableUtils.ROW_EDGE]?this._pagingControl[1][0].parentNode.style.visibility="hidden":(D=y[0]+t[1][0]+I[1][0]+1,m=this._pagingControl[1][0].parentNode,m.style.top=D+"px",m.style.visibility="visible"));e&&(this.setCachedSize(this._container,A[0]+v[0],AdfPivotTableUtils.COLUMN_EDGE),this.setCachedSize(this._container,A[1]+v[1]+I[0][1]+I[1][0]+I[1][1],
AdfPivotTableUtils.ROW_EDGE));this.stopTimer(0,"Set overflow, size containers","All sizing")};AdfPivotTableUtils.prototype.isShrinkToFit=function(){return AdfPivotTableUtils.isShrinkToFit(this._pivotTable.getSizing(),this._container)};AdfPivotTableUtils.isShrinkToFit=function(a,b){if("auto"==a){var c=b.style;return!("absolute"==c.position&&c.top&&0<c.top.length&&c.bottom&&0<c.bottom.length)}return!1};
AdfPivotTableUtils.prototype.getCanvasSizeByEdgeAndPane=function(a,b){return a==AdfPivotTableUtils.ROW_EDGE?1==b?this._canvasHeight1:this._canvasHeight0:1==b?this._canvasWidth1:this._canvasWidth0};
AdfPivotTableUtils.prototype.setCanvasSizeByEdgeAndPane=function(a,b,c){var d=this._startPane;if(a==AdfPivotTableUtils.ROW_EDGE)for(1==b?this._canvasHeight1=c:this._canvasHeight0=c,d=d[1-a];2>d;++d)(0<b+d||AdfPivotTableUtils.isMobileTouchDevice())&&this.setCachedSize(this.getScrollerCanvas(b,d),c,a);else for(1==b?this._canvasWidth1=c:this._canvasWidth0=c,d=d[1-a];2>d;++d)(0<b+d||AdfPivotTableUtils.isMobileTouchDevice())&&this.setCachedSize(this.getScrollerCanvas(d,b),c,a)};
AdfPivotTableUtils.prototype.getHeaderBlocksSize=function(a,b){for(var c=a.length,d=0,e=0;e<c;e++)d+=a[e][b];return d};AdfPivotTableUtils.prototype.getFirstHeaderBlockSize=function(a,b){return a[0][b]};AdfPivotTableUtils.prototype.hasColHeaderScrollbar=function(){return this._colHeaders[1]._height<this._colHeaderBuffers[1][0]._height};
AdfPivotTableUtils.prototype.getColHeaderScrollbarWidth=function(){return this.hasColHeaderScrollbar()?this._colHeaders[1].offsetWidth-this._colHeaders[1].clientWidth-AdfPivotTableUtils.HEADER_EXTRA_PIXEL_EXTENT[0]:0};
AdfPivotTableUtils.prototype.sizeNewHTMLBlocks=function(){this.coordinateNewBlockSizes();this.setBlockTableStyles(!0);var a,b,c;if(AdfAgent.AGENT.getPlatform()!=AdfAgent.IE_PLATFORM||8<=AdfAgent.AGENT.getVersion())for(var d=this._startPane[1];2>d;++d)for(a=this._rowHeaderBuffers[d],c=a.length,i=0;i<c;i++)b=a[i],!b._placeholder&&b._new&&this.setCachedSize(b,b.childNodes[0].offsetWidth,AdfPivotTableUtils.COLUMN_EDGE);else this.shiftAllPlaceholderCells(!0)};
AdfPivotTableUtils.prototype.setBlockTableStyles=function(a){for(var b=AdfAgent.AGENT.getAttribute(this._colHeaderBuffers[1][0].childNodes[0],"_className"),c=0;2>c;++c)for(var d=this._buffers2[c],e=this._startPane[c];2>e;++e)for(var f=d[e],g=f.length,h=0;h<g;h++)block=f[h],block._placeholder||!block._new&&a||(block.childNodes[0].className=b);for(c=this._startPane[1];2>c;++c)for(d=this._databodyBuffers[c],e=this._startPane[0];2>e;++e)for(var f=d[e],g=f.length,h=0;h<g;h++)for(var l=f[h],m=l.length,
n=0;n<m;n++)!(block=l[n])||!block._new&&a||(block.childNodes[0].className=b);!this._layerLabelBlock||!this._layerLabelBlock._new&&a||(this._layerLabelBlock.childNodes[0].className=b)};AdfPivotTableUtils.prototype.coordinateColumnBlockSizes=function(){for(var a=[],b=this._startPane[0];2>b;++b){for(var c=this._colHeaderBuffers[b],d=c.length,e=0;e<d;e++){var f=c[e];f._placeholder||a.push(f)}this.coordinateColumnHeaderRowHeights(a,!1)}};
AdfPivotTableUtils.prototype.coordinateRowBlockSizes=function(){for(var a=[],b=this._startPane[1];2>b;++b)for(var c=this._rowHeaderBuffers[b],d=c.length,e=0;e<d;e++)for(var f=c[e],g=this._startPane[0];2>g;++g)this.coordinateHTMLBlockRowHeights(f,this._databodyBuffers[b][g][e],a,e)};
AdfPivotTableUtils.prototype.coordinateNewBlockSizes=function(){for(var a=AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM,b=[],c=this._startPane[0];2>c;++c)for(var d=this._colHeaderBuffers[c],e=d.length,f=0;f<e;f++){var g=d[f];if(!g._placeholder){for(var h=[],l=this._startPane[1];2>l;++l)for(var m=this._databodyBuffers[l][c],n=m.length,p=0;p<n;p++){var q=m[p][f];q&&q._new&&h.push(q)}g._new?this.coordinateHTMLBlockColumnWidths(g,h):this.setWidthExpandosOnDatabodyBlocks(g,h);b.push(g)}}for(l=this._startPane[1];2>
l;++l)for(d=this._rowHeaderBuffers[l],e=d.length,p=0;p<e;p++){g=d[p];h=[];n=[];for(c=this._startPane[0];2>c;++c)for(var m=this._databodyBuffers[l][c],r=m[p].length,f=0;f<r;f++)(q=m[p][f])&&q._new?(a&&this._rightToLeft&&(q.childNodes[0].style.position="absolute"),h.push(q)):n.push(q);(g._new||0<h.length)&&this.coordinateHTMLBlockRowHeights(g,h,n,p)}this.coordinateColumnHeaderRowHeights(b,!1)};
AdfPivotTableUtils.prototype.setWidthExpandosOnDatabodyBlocks=function(a,b){for(var c=a._width,d=b.length,e=0;e<d;++e)b[e]._width=c};
AdfPivotTableUtils.prototype.sizeInitialHTMLBlocks=function(a){for(var b=AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM,c=b&&!(8<=AdfAgent.AGENT.getVersion()),d={widthBeforeViewport:[],heightBeforeViewport:[]},e=this._startPane,f=e[0];2>f;++f)var g=0<this._splitSlice[1]?[this._databodyBuffers[0][f][0][0],this._databodyBuffers[1][f][0][0]]:[this._databodyBuffers[1][f][0][0]],h=Math.round(this.coordinateHTMLBlockColumnWidths(this._colHeaderBuffers[f][0],g,d));this.coordinateRowHeaderColumnWidths(0<
this._splitSlice[1]?[this._rowHeaderBuffers[0][0],this._rowHeaderBuffers[1][0]]:[this._rowHeaderBuffers[1][0]]);this.coordinateColumnHeaderRowHeights(0<this._splitSlice[0]?[this._colHeaderBuffers[0][0],this._colHeaderBuffers[1][0]]:[this._colHeaderBuffers[1][0]],!0);if(b&&this._rightToLeft)for(b=this._databodyBuffers,f=e[1];2>f;++f)for(var g=b[f],l=e[0];2>l;++l)g[l][0][0].childNodes[0].style.position="absolute";for(f=e[1];2>f;++f){rowHeaderBlock=this._rowHeaderBuffers[f][0];var g=0<this._splitSlice[0]?
[this._databodyBuffers[f][0][0][0],this._databodyBuffers[f][1][0][0]]:[this._databodyBuffers[f][1][0][0]],m=Math.round(this.coordinateHTMLBlockRowHeights(rowHeaderBlock,g,void 0,void 0,d))}this.setBlockTableStyles(!1);a&&(this._defaultSliceSize=[h,m]);c&&this.shiftAllPlaceholderCells(!1);return d};
AdfPivotTableUtils.prototype.coordinateRowHeaderColumnWidths=function(a){for(var b=a.length,c=a[0].childNodes[0].rows[0].cells.length,d=Array(c),e=0,f=this._pivotTablePeer.getComponent(),g=f.getProperty(AdfRichPivotTable.__ROW_HEADER_START_LAYER_KEY),h=g-1,l=0,m=1;m<c;m++){for(var n=AdfDhtmlPivotTablePeer.MIN_ROW_HEADER_WIDTH,p=0;p<b;p++)n=this.getRowHeaderBlockColumnWidth(a[p],m,n);n=this.getRowHeaderBlockColumnWidth(this._layerLabelBlock,m,n);d[m]=n;e+=n;m-1==h&&(l=e)}this._layerLabelBlock&&(h=
this._layerLabelBlock.childNodes[0].rows[0].cells,m=h[c-1].offsetWidth,this._innerRhLayerLabelPercentage=m/(m+h[c].offsetWidth));for(p=0;p<b;p++)this.setRowHeaderBlockColumnWidths(a[p],d,e);this.setRowHeaderBlockColumnWidths(this._layerLabelBlock,d,e);a=g>=this._rowLayerCount?999999:l+=f.getProperty(AdfRichPivotTable.__ROW_HEADER_START_PIXEL_KEY);for(b=this._startPane[1];2>b;++b)this._rowHeaders[b].scrollLeft=a;this._layerLabelBlock&&(this._corner.scrollLeft=a)};
AdfPivotTableUtils.prototype.getRowHeaderBlockColumnWidth=function(a,b,c){if(a){var d=a.childNodes[0].rows[0].cells,e=d[b],f=e.offsetWidth,g=a==this._layerLabelBlock;g&&b==d.length-2&&(f+=d[b+1].offsetWidth);c<f&&(c=f);"true"==a.childNodes[0].getAttribute("isrowheadercontainsimage")&&(c+=AdfDhtmlPivotTablePeer.ROW_HEADER_IMAGE_WIDTH);g||(a=AdfAgent.getAgent().getIntAttribute(e,"_winW"),void 0!=a&&(a<c&&(this._isRowHeaderWidthOverrideSmaller=!0),c=a))}return c};
AdfPivotTableUtils.prototype.setRowHeaderBlockColumnWidths=function(a,b,c){if(a){for(var d=a.childNodes[0].rows[0].cells,e=d.length,f=a==this._layerLabelBlock,e=f?e-2:e,g=1;g<e;g++)d[g].style.width=b[g]+"px";f&&(b=b[e],f=Math.ceil(this._innerRhLayerLabelPercentage*b),d[e].style.width=f+"px",d[e+1].style.width=b-f+"px");a.style.width=c+"px";a._width=c;a.childNodes[0].style.width=c+"px"}};
AdfPivotTableUtils.prototype.coordinateHTMLBlockColumnWidths=function(a,b,c){for(var d=AdfAgent.getAgent(),e=b.length,f=a.childNodes[0].rows[0].cells,g=f.length-1,h=Array(g),l=0,m=this.getIntAttribute(a,"_startSlice"),n=m<this._splitSlice[0]?0:1,p=this._pivotTablePeer.getViewportStartSliceProperty(0,n,!1)-m-1,q=0,m=0;m<g;m++){var r,w=d.getIntAttribute(f[m+1],"_winW");if(void 0!=w)r=w;else for(r=f[m+1].offsetWidth,w=0;w<e;w++){var v=b[w].childNodes[0],v=v.rows[0].cells;r=Math.max(r,v[m+1].offsetWidth)}h[m]=
r;l+=r;m==p&&(q=l)}c&&(q+=this._pivotTablePeer.getViewportStartSliceProperty(0,n,!0),c.widthBeforeViewport[n]=q);for(m=0;m<g;m++)if(void 0==d.getAttribute(f[m+1],"_winW"))for(c=h[m]+"px",f[m+1].style.width=c,w=0;w<e;w++)v=b[w].childNodes[0],v=v.rows[0].cells,v[m+1].style.width=c;this.setCachedSize(a,l,AdfPivotTableUtils.COLUMN_EDGE);a.childNodes[0].style.width=l+"px";for(w=0;w<e;w++)this.setCachedSize(b[w],l,AdfPivotTableUtils.COLUMN_EDGE),b[w].childNodes[0].style.width=l+"px";return 0==g?0:l/g};
AdfPivotTableUtils.prototype.getSizeString=function(a,b){var c=AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&8<=AdfAgent.AGENT.getVersion(),d="",e=b.childNodes[0];if(a){for(var c=e.rows[0].cells,f=c.length,g=1;g<f;g++)d+=c[g].offsetWidth+",";d+=b.offsetWidth}else{f=e.rows.length;for(g=1;g<f;g++)d+=c?e.rows[g].cells[0].offsetHeight+",":e.rows[g].offsetHeight+",";d+=b.offsetHeight}return d};
AdfPivotTableUtils.prototype.getHeaderSizingBlock=function(a){for(var b=this._startPane[a];2>b;++b){var c=this._buffers2[a][b],d=c.length;for(i=0;i<d;i++){var e=c[i];if(!e._placeholder&&!e._new)return e}}return null};AdfPivotTableUtils.prototype.getRowHeaderWidths=function(){var a=this.getHeaderSizingBlock(1);return this.getSizeString(!0,a)};AdfPivotTableUtils.prototype.getColumnHeaderHeights=function(){var a=this.getHeaderSizingBlock(0);return this.getSizeString(!1,a)};
AdfPivotTableUtils.prototype.coordinateColumnHeaderRowHeights=function(a,b){var c=AdfAgent.getAgent(),d=c.getPlatform(),e=d==AdfAgent.IE_PLATFORM,c=e&&8<=c.getVersion(),d=d==AdfAgent.WEBKIT_PLATFORM,f=a.length,g=a[0].childNodes[0].rows.length,h=Array(g),l=0,m=this._pivotTablePeer.getComponent(),n=m.getProperty(AdfRichPivotTable.__COLUMN_HEADER_START_LAYER_KEY),p=n-1,q=0,r;if(e){r=Array(f);for(var w=0;w<f;w++){var v=a[w];if(void 0==v._processOffsetHeight){v._processOffsetHeight=1;r[w]=Array(g);for(var x=
v.childNodes[0].rows,v=g-1;0<v;v--){var z=x[v];r[w][v]=void 0==r[w][v]?c?z.cells[0].offsetHeight:z.offsetHeight:r[w][v]+(c?z.cells[0].offsetHeight:z.offsetHeight);1==z.cells.length&&z.cells[0].className==AdfPivotTableUtils.COLUMN_HEADER_SIZING_CELL_CLASS&&(r[w][v-1]=r[w][v],r[w][v]=0)}}}}for(v=1;v<g;v++){x=AdfDhtmlPivotTablePeer.MIN_COL_HEADER_HEIGHT;for(w=0;w<f;w++)x=this.getColumnHeaderBlockRowHeight(a[w],w,v,g,x,r,e,c);x=this.getColumnHeaderBlockRowHeight(this._layerLabelBlock,-1,v,g,x,r,e,c);
h[v]=x;l+=x;v-1==p&&(q=l)}for(w=0;w<f;w++)this.setColumnHeaderBlockRowHeights(a[w],h,l,e,c,d);this.setColumnHeaderBlockRowHeights(this._layerLabelBlock,h,l,e,c,d);if(b){e=n>=this._colLayerCount?999999:q+=m.getProperty(AdfRichPivotTable.__COLUMN_HEADER_START_PIXEL_KEY);for(r=this._startPane[0];2>r;++r)this._colHeaders[r].scrollTop=e;this._layerLabelBlock&&(999999==e&&(e=this._colHeaders[1].scrollTop),this._corner.scrollTop=e)}};
AdfPivotTableUtils.prototype.getColumnHeaderBlockRowHeight=function(a,b,c,d,e,f,g,h){if(a){var l=a.childNodes[0].rows[c];g&&1==a._processOffsetHeight?(b=f[b][c],c==d-1&&(a._processOffsetHeight=2)):b=h?l.cells[0].offsetHeight:l.offsetHeight;e<b&&(e=b);void 0==l._minRH&&(l._minRH=Math.max(b,AdfDhtmlPivotTablePeer.MIN_COL_HEADER_HEIGHT),a!=this._layerLabelBlock&&(a=AdfAgent.getAgent().getIntAttribute(l,"_winH"),void 0!=a&&a>e&&(e=a)))}return e};
AdfPivotTableUtils.prototype.setColumnHeaderBlockRowHeights=function(a,b,c,d,e,f){if(a){for(var g=a.childNodes[0],h=g.rows,l=h.length,m=1;m<l;m++){var n=h[m],n=f||e?n.cells[0]:n;n.style.height=b[m]+"px"}if(d)for(m=1;m<l;m++)d=e?h[m].cells[0].offsetHeight:h[m].offsetHeight,d!=b[m]&&(d=b[m]+b[m]-d,0<=d&&(n=h[m],n=f||e?n.cells[0]:n,n.style.height=d+"px"));a.style.height=c+"px";a._height=c;g.style.height=c+"px"}};
AdfPivotTableUtils.prototype.coordinateHTMLBlockRowHeights=function(a,b,c,d,e){var f=AdfAgent.getAgent(),g=f.getPlatform(),h=g==AdfAgent.IE_PLATFORM,l=h&&8<=AdfAgent.AGENT.getVersion();h&&AdfAgent.AGENT.getVersion();for(var m=g==AdfAgent.WEBKIT_PLATFORM,n=a._new,p=a.childNodes[0],g=p.rows.length-1,q=Array(g),r=Array(g),w=0,v,x=this.getIntAttribute(a,"_startSlice"),z=x<this._splitSlice[1]?0:1,t=this._pivotTablePeer.getViewportStartSliceProperty(1,z,!1)-x-1,B=0,x=0;x<g;x++){v=p.rows[x+1];var F=v.cells[0].offsetHeight;
n&&F++;if(void 0==v._minRH){F<AdfDhtmlPivotTablePeer.MIN_ROW_HEIGHT&&(F=AdfDhtmlPivotTablePeer.MIN_ROW_HEIGHT);v._minRH=F;var D=f.getIntAttribute(v,"_winH");void 0!=D&&D>F&&(F=D)}v=b.length;for(var A=F,y=0;y<v;y++){var D=b[y],E=D.childNodes[0],G=E.rows[x+1],H=void 0!=f.getAttribute(G,"_ss")?this.getMaximumScrollHeight(G.cells):0,E=G.cells[0].offsetHeight,E=Math.max(E,H);D._new&&E++;void 0==G._minRH&&(E<AdfDhtmlPivotTablePeer.MIN_ROW_HEIGHT&&(E=AdfDhtmlPivotTablePeer.MIN_ROW_HEIGHT),G._minRH=E,D=f.getIntAttribute(G,
"_winH"),void 0!=D&&D>E&&(E=D));A=Math.max(A,E);a._new||(r[x]=F<A)}q[x]=A;w+=A;x==t&&(B=w)}e&&(B+=this._pivotTablePeer.getViewportStartSliceProperty(1,z,!0),e.heightBeforeViewport[z]=B);f=e=0;h&&!l&&(e=AdfPivotTableUtils.CELL_EXTRA_HEIGHT,f=e+1);for(x=0;x<g;x++){v=p.rows[x+1];n=m||l?v.cells[0]:v;n.style.height=q[x]-f+"px";v=b.length;for(y=0;y<v;y++)E=b[y].childNodes[0],t=E.rows[x+1],n=m||l?t.cells[0]:t,n.style.height=q[x]-e+"px",this.updateTextAreaCellHeights(t,q[x]-e);if(r[x]&&void 0!=c)for(v=c.length,
y=0;y<v;y++)E=c[y].childNodes[0],t=E.rows[x+1],n=m||l?t.cells[0]:t,n.style.height=q[x]-e+"px"}a.style.height=w+"px";a._new||(m=a._height-w,0!=m&&this.moveExistingBlocksTop(z,d+1,m));a._height=w;a.childNodes[0].style.height=h&&!l?w+1+"px":w+"px";v=b.length;for(y=0;y<v;y++)b[y].style.height=h&&!l?w+1+"px":w+"px",b[y]._height=w,b[y].childNodes[0].style.height=w+"px";if(void 0!=c)for(v=c.length,y=0;y<v;y++)c[y].style.height=h&&!l?w+1+"px":w+"px",c[y]._height=w,c[y].childNodes[0].style.height=w+"px";return 0==
g?0:w/g};
AdfPivotTableUtils.prototype.shiftAllPlaceholderCells=function(a){for(var b,c,d=0;2>d;++d)for(var e=this._buffers2[d],f=this._startPane[d];2>f;++f){b=e[f];for(var g=b.length,h=0;h<g;h++)c=b[h],c._placeholder||!c._new&&a||this.shiftPlaceholderCells(c)}for(d=this._startPane[1];2>d;++d)for(e=this._databodyBuffers[d],f=this._startPane[0];2>f;++f){b=e[f];for(var g=b.length,h=0;h<g;h++)for(var l=b[h],m=l.length,n=0;n<m;n++)c=l[n],!c||!c._new&&a||this.shiftPlaceholderCells(c)}!this._layerLabelBlock||!this._layerLabelBlock._new&&
a||this.shiftPlaceholderCells(this._layerLabelBlock)};AdfPivotTableUtils.prototype.shiftPlaceholderCells=function(a){a.style.height=a.childNodes[0].offsetHeight-AdfPivotTableUtils.PLACEHOLDER_ROW_HEIGHT+"px";this.setCachedSize(a,a.childNodes[0].offsetWidth,AdfPivotTableUtils.COLUMN_EDGE);a.style.overflow="hidden"};
AdfPivotTableUtils.prototype.getDatabodySizes=function(){for(var a=AdfAgent.getAgent(),b="",c="Rows:",d=!1,e=1;0<=e;--e){0==e&&(c="Columns:",d=!0);for(var f=this._startPane[e];2>f;++f){for(var b=b+c,g=this._buffers2[e][f],h=g.length,l=0;l<h;l++)var m=g[l],b=b+(a.getAttribute(m,"_startSlice")+":"+this.getSizeString(d,m)+":");b+=";"}}return b};
AdfPivotTableUtils.adjustPrintablePageRendering=function(a,b){for(var c=["width","height"],d=["clientWidth","clientHeight"],e=["offsetWidth","offsetHeight"],f=document.getElementById(a),g=f.childNodes[0],h=[-1==parseInt(f.getAttribute("_splitCol"))?1:0,-1==parseInt(f.getAttribute("_splitRow"))?1:0],l=g.childNodes,m=0,n=l[m++],p,q,r=[],w=[],v=[],x=h[0];2>x;++x)p=l[m++],q=p.childNodes[0],r[x]=p,w[x]=q,v[x]=q.childNodes[0].childNodes[0].childNodes;for(var z=[],x=[],t=[],B=[r,z],w=[w,x],F=[v,t],D=[[],
[]],A=[[],[]],y=[[],[]],E=h[1];2>E;++E){p=l[m++];q=p.childNodes[0];z[E]=p;x[E]=q;t[E]=q.childNodes[0].childNodes[0].childNodes;for(var G=h[0];2>G;++G)p=l[m++],q=p.childNodes[0],D[E][G]=p,A[E][G]=q,y[E][G]=q.childNodes[0].childNodes[0].childNodes}for(x=h[0];2>x;++x)for(E=v[x],l=E.length,m=1;m<l;m++)p=E[m].getAttribute("_winH"),null!=p&&(E[m].style.height=p+"px");for(E=h[1];2>E;++E)for(x=t[E],v=y[E],l=x.length,m=1;m<l;m++)if(p=x[m].getAttribute("_winH"),null!=p)for(p+="px",x[m].style.height=p,G=h[0];2>
G;++G)v[G][m].style.height=p;AdfPivotTableUtils.initSizeConstants();var m=AdfPivotTableUtils.CONTAINER_EXTRA_SIZE,y=AdfPivotTableUtils.DATABODY_EXTRA_SIZE,l=AdfPivotTableUtils.HEADER_EXTRA_PIXEL_EXTENT,H=AdfPivotTableUtils.HEADER_EXTRA_PIXEL_DEPTH,v=[g.clientWidth,g.clientHeight],E=[v[0],v[1]-0],G=[[],[]];q=[];var I=[];if(1==t[1].length){var u=A[1][1],x=u.childNodes[0],t=parseInt(u.getAttribute("_totHorizMargin"));p=parseInt(u.getAttribute("_totVertMargin"));q=AdfPivotTableUtils.HEADER_OUTER_PIXEL_DEPTH_NO_DATA;
I=[x.offsetWidth+t,x.offsetHeight+p]}else for(t=0;2>t;++t){p=e[t];I[t]=0;for(x=h[t];2>x;++x)G[t][x]=w[t][x][p],I[t]+=G[t][x];q[1-t]=w[1-t][1][p]+H[1-t]}p=[];for(var x=[],C=[Number(f.getAttribute("_sizeAlloc0")),Number(f.getAttribute("_sizeAlloc1"))],J=[f.getAttribute("_sizeUnit0"),f.getAttribute("_sizeUnit1")],t=0;2>t;++t){var K=E[t]-H[1-t],L=q[1-t]-H[1-t];if(u)var Q=.15,R="%";else Q=C[1-t],R=J[1-t];K=AdfPivotTableUtils.allocateSpace(K,L,I[t],Q,R);p[1-t]=K[0];x[1-t]=p[1-t]+H[1-t]}t=AdfAgent.getAgent().getAttribute(f,
"sizing");if(u=AdfPivotTableUtils.isShrinkToFit(t,f)){for(t=0;2>t;++t)E[t]=Math.min(E[t],q[1-t]+I[t]);v[0]=E[0];v[1]=E[1]+0}H=[];q=[[],[]];for(t=0;2>t;++t)H[t]=E[t]-x[1-t],0==h[t]?(I=AdfPivotTableUtils.allocateSpace(H[t],G[t][0],G[t][1],.5,"%"),q[t][0]=I[0],q[t][1]=H[t]-q[t][0]):q[t][1]=H[t];t=x[0];H=t+"px";for(E=h[1];2>E;++E){z[E].style.top=H;for(G=h[0];2>G;++G)D[E][G].style.top=H;0==E&&(t+=q[1][E],H=t+"px")}if(b)for(z=0,t="0px",G=1;G>=h[0];--G){r[G].style.left=t;for(E=h[1];2>E;++E)D[E][G].style.left=
t;1==G&&(z+=q[0][G],t=z+"px")}else for(z=x[1],t=z+"px",G=h[0];2>G;++G){r[G].style.left=t;for(E=h[1];2>E;++E)D[E][G].style.left=t;0==G&&(z+=q[0][G],t=z+"px")}n.style.width=x[1]+"px";n.style.height=x[0]+"px";for(t=0;2>t;++t)for(n=B[t],r=c[1-t],z=c[t],E=p[t]+"px",x=h[t];2>x;++x)G=q[t][x]-l[t],n[x].style[r]=E,n[x].style[z]=G+"px";for(t=0;2>t;++t)for(r=c[t],x=h[t];2>x;++x)for(z=q[t][x]-y[t]+"px",n=h[1-t];2>n;++n)(t?D[x][n]:D[n][x]).style[r]=z;g.style.width=v[0]+"px";g.style.height=v[1]+"px";u&&(f.style.width=
v[0]+m[0]+"px",f.style.height=v[1]+m[1]+"px");c=[];g=[];0==h[0]?(c[0]=[parseInt(f.getAttribute("_startCol")),parseInt(f.getAttribute("_secondStartCol"))],g[0]=[parseInt(f.getAttribute("_startColPixel")),parseInt(f.getAttribute("_secondStartColPixel"))]):(c[0]=[null,parseInt(f.getAttribute("_startCol"))],g[0]=[null,parseInt(f.getAttribute("_startColPixel"))]);0==h[1]?(c[1]=[parseInt(f.getAttribute("_startRow")),parseInt(f.getAttribute("_secondStartRow"))],g[1]=[parseInt(f.getAttribute("_startRowPixel")),
parseInt(f.getAttribute("_secondStartRowPixel"))]):(c[1]=[null,parseInt(f.getAttribute("_startRow"))],g[1]=[null,parseInt(f.getAttribute("_startRowPixel"))]);D=[parseInt(f.getAttribute("_colHeaderStartLayer")),parseInt(f.getAttribute("_rowHeaderStartLayer"))];f=[parseInt(f.getAttribute("_colHeaderStartPixel")),parseInt(f.getAttribute("_rowHeaderStartPixel"))];for(t=0;2>t;++t){t?(r="top",z="bottom"):b?(r="right",z="left"):(r="left",z="right");p=e[t];y=d[t];for(x=h[t];2>x;++x){for(var n=B[t][x],v=w[t][x],
M=t?F[t][x]:F[t][x][0].childNodes,N=c[t][x]-parseInt(v.getAttribute("_startslice")),l=-g[t][x],m=0;m<N;m++)l-=M[m+1][p];v[p]+l<n[y]?(M=v[p]<n[y]?r:z,N="0px"):(M=r,N=l+"px");v.style[M]=N;for(n=h[1-t];2>n;++n)(t?A[x][n]:A[n][x]).style[M]=N}u=D[1-t];l=-f[1-t];for(x=h[1-t];2>x;++x){v=w[1-t][x];if(x==h[1-t]){n=B[1-t][x];M=t?F[1-t][x]:F[1-t][x][0].childNodes;for(m=0;m<u;m++)l-=M[m+1][p];v[p]+l<n[y]?(M=z,N="0px"):(M=r,N=l+"px")}v.style[M]=N}}};
AdfPivotTableUtils.prototype.updateTextAreaCellHeights=function(a,b){for(var c=a.cells,d=1;d<c.length;d++){var e=c[d];if(null!=this.getFirstTextArea(e)){var f=this.getCellOffset(e);void 0==b&&(b=a.offsetHeight);e.style.height=Math.max(0,b-f)+"px"}}};AdfPivotTableUtils.prototype.getCellOffset=function(a){return AdfPivotTableUtils.CELL_EXTRA_HEIGHT};AdfPivotTableUtils.prototype.getFirstTextArea=function(a){a=a.getElementsByTagName("TEXTAREA");return 0<a.length?a[0]:null};
AdfPivotTableUtils.prototype.getMaximumScrollHeight=function(a){for(var b=0,c=1;c<a.length;c++)for(var d=a[c],e=this.getCellOffset(d),d=d.getElementsByTagName("*"),f=d.length,g=0;g<f;g++)b=Math.max(b,d[g].scrollHeight+e);return b};