AdfPivotTableUtils.hn=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=A_c):b<=d?(a=b,b=A_c,c=A_b):c<=a-d?(a-=c,b=A_b,c=A_c):(a=d,c=b=A_b);return[a,b,c]};function A_Fi(a,b){var c=b.Yk;c.style.display="inline";c.style.position="absolute";A_4(a,AdfPivotTableUtils.n,b.left,c,A_b);A_4(a,AdfPivotTableUtils.l,b.top,c);c.style.zIndex="3";A_3(a,c,b.innerWidth,AdfPivotTableUtils.n);A_3(a,c,b.innerHeight,AdfPivotTableUtils.l)}
AdfPivotTableUtils.prototype.Cg=function(a,b){this.Us(0,2);var c=this.R,d=this.tq,e=this.Kk(),f=this.fb,g=this.Kb,h=this.xc,l=this.kb,m=this.he,n=this.Tb,p=this.gr,q=this.br,v=this.Aa,u=this.XH,w=AdfPivotTableUtils.bt,r=AdfPivotTableUtils.et,x=AdfPivotTableUtils.wo,s=AdfPivotTableUtils.jt,z=AdfPivotTableUtils.CC,A=AdfPivotTableUtils.BC,G=[A[1],A[0]],B=[a-w[0],b-w[1]];this.Da(0,"get pivot table divs and sizing constants");var D=this.Bh,y=this.o,C=this.i,H=this.Uw,F=[[0,0],[0,0]];if(this.Ba.Fa){for(var t=
0;2>t;t++)for(var E=this.i[t];2>E;E++)F[t][E]=this.wa[t][E].childNodes[0].offsetHeight,this.wa[t][E].parentNode.style.height=F[t][E]+"px",F[t][E]=this.wa[t][E].parentNode.offsetHeight;B[1]=B[1]-F[0][1]-F[1][1]-F[1][0]}var K=this.Ba.Fa?[0,0]:[u.offsetWidth-u.clientWidth,u.offsetHeight-u.clientHeight],I=d?p.offsetHeight:0,J=[B[0],B[1]-I];this.Da(0,"get scrollbar sizes and status bar size");var L=[[],[]],R=[0,0],N=[],O=[],Ga=[],ia=[],qa=this.Xv;if(qa){for(t=0;2>t;++t)for(E=C[t];2>E;++E)L[t][E]=0;var N=
[A_c,A_c],O=[0,0],ib=AdfAgent.AGENT.getIntAttribute(qa,"_totHorizMargin"),jb=AdfAgent.AGENT.getIntAttribute(qa,"_totVertMargin"),kb=AdfDhtmlPivotTablePeer.O(qa,qa.id+"Inner"),Ga=AdfPivotTableUtils.kt,ia=[kb.offsetWidth+ib,kb.offsetHeight+jb]}else{for(var Ua=[],Ya,t=0;2>t;++t){for(E=C[t];2>E;++E){for(var Za=this.T[t][E],lb=Za.length,Ha=0,Na=0;Na<lb;Na++)Ha+=Za[Na][D[t]];Ya=Ha;var $a=H[t][E],mb,X=this.T[t][E],Ia=X[X.length-1],ab=this.getIntAttribute(X[0],"_startSlice");mb=this.getIntAttribute(Ia,"_startSlice")+
this.getIntAttribute(Ia,"_numSlices")-ab;L[t][E]=Ya+($a-mb)*this.jm[t];R[t]+=L[t][E]}Ua[t]=this.T[t][1][0][D[1-t]]}var Ja;if(this.Ba.Fa)Ja=[A_c,A_c];else{for(var za=[],ba=0;2>ba;++ba){var Va=Ua[1-ba]+R[ba],bb=J[ba]-s[1-ba];za[ba]=Va>bb?A_b:Va<=bb-K[ba]?A_c:AdfPivotTableUtils.rl}for(ba=0;2>ba;++ba)za[ba]===AdfPivotTableUtils.rl&&(za[ba]=za[1-ba]===A_b);Ja=za}N=Ja;for(t=0;2>t;++t)O[t]=N[1-t]?K[t]:0,Ga[t]=Ua[t]+s[t],ia[t]=R[t]+O[t]}for(var ra=[],ja=[],ka=[],fa=[[],[]],cb=[],Aa=[[],[]],t=0;2>t;++t){var sa=
J[t]-s[1-t]-O[t],nb=Ga[1-t]-s[1-t],tb=ia[t]-O[t];if(qa)var Wa=0.15,Xa="%";else Wa=this.KG[1-t],Xa=this.JG[1-t];var Oa=AdfPivotTableUtils.hn(sa,nb,tb,Wa,Xa);ra[1-t]=Oa[0];ja[1-t]=ra[1-t]+s[1-t];qa||this.Ba.Fa?(ka[t]=A_c,fa[t][1]=A_c):(ka[t]=Oa[1],fa[t][1]=Oa[2]);cb[1-t]=ka[t]?K[1-t]:0;Aa[1-t][1]=fa[t][1]?K[1-t]:0}AdfAssert.assert(AdfPivotTableUtils.Ha||O[1]==Math.max(cb[1],Aa[1][1])&&O[0]==Math.max(cb[0],Aa[0][1]));this.Da(0,"get block sizes, calc canvas size, and allocate space between headers/databody");
if(e){for(t=0;2>t;++t)J[t]=Math.min(J[t],Ga[1-t]+ia[t]);B[0]=J[0];B[1]=J[1]+I}for(var Ka=[],W=[[],[]],t=0;2>t;++t)if(Ka[t]=J[t]-ja[1-t],-1!=y[t]){var Ba=AdfPivotTableUtils.hn(Ka[t]-O[t],L[t][0],L[t][1],this.bk[t],"%");W[t][0]=Ba[0];W[t][1]=Ka[t]-W[t][0];qa?(fa[t][0]=A_c,fa[t][1]=A_c):(fa[t][0]=Ba[1],fa[t][1]=Ba[2]);for(E=C[t];2>E;++E)Aa[1-t][E]=fa[t][E]?K[1-t]:0}else W[t][1]=Ka[t];this.Da(0,"shrink to fit; calc databody region sizes");for(var ha=[[],[]],Pa=[],la=[[],[]],ma=[[],[]],t=0;2>t;++t){var S=
0,ob=-1==y[t]?2:3;ka[t]&&++S;for(E=C[t];2>E;++E)fa[t][E]&&(Pa[t]=E,++S);if(this.Ba.Fa?0:0<S&&S<ob){var Qa=1==t&&c?0:J[1-t]-O[1-t],Ra=O[1-t]-A[t],M=0,P=ja[1-t];if(!ka[t]){var E=Pa[t],ta=q[t][E],ca=P-z[t];if(1==t)ha[t][E]={Yk:ta,left:Qa,top:M,innerWidth:Ra,innerHeight:ca};else{var na=c?J[t]-P-M:M;ha[t][E]={Yk:ta,left:na,top:Qa,innerWidth:ca,innerHeight:Ra}}}for(E=C[t];2>E;++E)M+=P,P=W[t][E],fa[t][E]?(la[t][E]=A_c,ma[1-t][E]=0):(ta=q[t][E],1==E&&(P-=O[t]),ca=P-z[t],1==t?ha[t][E]={Yk:ta,left:Qa,top:M,
innerWidth:Ra,innerHeight:ca}:(na=c?J[t]-P-M:M,ha[t][E]={Yk:ta,left:na,top:Qa,innerWidth:ca,innerHeight:Ra}),la[t][E]=A_b,ma[1-t][E]=O[1-t])}else for(E=C[t];2>E;++E)la[t][E]=A_c,ma[1-t][E]=0}if(la[0][1]&&N[1]||la[1][1]&&N[0])var Ca={Yk:this.Lv,left:c?0:J[0]-O[0],top:J[1]-O[1],innerWidth:O[0]-G[0],innerHeight:O[1]-G[1]},Sa=A_b;else Sa=A_c;this.Da(0,"Scrollbar spacer calcs");for(var ua=ja[0],Q=C[1];2>Q;++Q){A_4(this,AdfPivotTableUtils.l,ua,g[Q]);for(var T=C[0];2>T;++T)A_4(this,AdfPivotTableUtils.l,
ua,l[Q][T]),0<Q+T&&A_4(this,AdfPivotTableUtils.l,ua,m[Q][T]);ua+=W[1][Q]+F[1][0]}d&&(A_4(this,AdfPivotTableUtils.l,J[1],p),A_4(this,AdfPivotTableUtils.n,0,p,A_b));if(c){for(var pa=0,La=O[0],db=[ma[0][0],ma[0][1]],T=1;T>=C[0];--T){A_4(this,AdfPivotTableUtils.n,pa,f[T],A_b);for(Q=C[1];2>Q;++Q)A_4(this,AdfPivotTableUtils.n,La,l[Q][T],A_b),0<Q+T&&A_4(this,AdfPivotTableUtils.n,db[Q],m[Q][T],A_b);La=pa+=W[0][T];db[0]=pa;db[1]=pa}for(Q=C[1];2>Q;++Q)g[Q].Fj=Ka[0]}else{for(var U=ja[1],T=C[0];2>T;++T){A_4(this,
AdfPivotTableUtils.n,U,f[T],A_b);for(Q=C[1];2>Q;++Q)A_4(this,AdfPivotTableUtils.n,U,l[Q][T],A_b),0<Q+T&&A_4(this,AdfPivotTableUtils.n,U,m[Q][T],A_b);U+=W[0][T]}for(Q=C[1];2>Q;++Q)g[Q].Fj=0}this.Da(0,"position pt divs");for(t=0;2>t;++t){var va,Da,da,Ta;-1!=y[t]&&(va=this.Ad[t][0],Da=W[t][0],A_3(this,va,Da,t),da=Da,Ta=this.nr[t],va[Ta]=da,this.ke[t][0]=Math.max(0,L[t][0]-da));for(E=C[t];2>E;++E)va=this.Ad[t][E],Da=W[1-t][1]-ma[1-t][E],A_3(this,va,Da,1-t),da=Da-Aa[1-t][E],Ta=this.nr[1-t],va[Ta]=da,1==
E&&(this.ke[1-t][1]=Math.max(0,L[1-t][1]-da))}for(t=0;2>t;++t)for(E=C[t];2>E;++E){var Ea=t,Z=E,oa=L[t][E],wa=this.i;if(Ea==AdfPivotTableUtils.l){1==Z?this.lF=oa:this.kF=oa;for(var Y=wa[1-Ea];2>Y;++Y)(0<Z+Y||AdfPivotTableUtils.F())&&A_3(this,AdfPivotTableUtils.F()?this.lj[Z][Y]:this.Rv[Z][Y],oa,Ea)}else{1==Z?this.nF=oa:this.mF=oa;for(Y=wa[1-Ea];2>Y;++Y)(0<Z+Y||AdfPivotTableUtils.F())&&A_3(this,AdfPivotTableUtils.F()?this.lj[Y][Z]:this.Rv[Y][Z],oa,Ea)}}A_3(this,n,ja[1],AdfPivotTableUtils.n);A_3(this,
n,ja[0],AdfPivotTableUtils.l);for(var Ma=[[],[]],t=1;0<=t;--t)for(E=C[t];2>E;++E)Ma[t][E]=W[t][E]-x[t],A_3(this,h[t][E],ra[t],1-t),A_3(this,h[t][E],Ma[t][E],t);for(t=0;2>t;++t)for(E=C[t];2>E;++E)for(var ub=W[t][E]-(E?O[t]:0)-r[t],ea=C[1-t];2>ea;++ea)A_3(this,t?l[E][ea]:l[ea][E],ub,t);d&&A_3(this,p,B[0],AdfPivotTableUtils.n);for(t=0;2>t;++t)for(E=0;2>E;++E)ha[t][E]?A_Fi(this,ha[t][E]):q[t][E].style.display="none";Sa?A_Fi(this,Ca):this.Lv.style.display="none";this.Da(0,"size PT divs, show/hide spacers");
if(!AdfPivotTableUtils.F()&&!this.Ba.Fa)for(t=0;2>t;++t)for(var xa=t?"overflowY":"overflowX",E=C[t];2>E;++E){var pb=fa[t][E]?"scroll":"hidden";va=this.Ad[t][E];va.style[xa]=pb}this.YH||(AdfPivotTableUtils.F()||(m[0][1].style.overflowX="hidden",m[1][0].style.overflowY="hidden",this.xc[0][0].style.overflow="hidden",this.xc[1][0].style.overflow="hidden"),this.YH=A_b);A_3(this,v,B[0],0);-1==y[AdfPivotTableUtils.l]?A_3(this,v,B[1],1):A_3(this,v,B[1]+F[1][0],1);if(this.Ba.Fa)if(-1==y[AdfPivotTableUtils.n]?
(this.wa[0][1].style.position="absolute",this.wa[0][0].style.visibility="hidden",this.wa[0][1].style.width=W[0][1]+"px",this.R?this.wa[0][1].style.marginRight=n.offsetWidth+"px":this.wa[0][1].style.marginLeft=n.offsetWidth+"px"):(this.wa[0][0].style.position="absolute",this.wa[0][0].style.width=W[0][0]+"px",this.R?this.wa[0][0].style.marginRight=n.offsetWidth+"px":this.wa[0][0].style.marginLeft=n.offsetWidth+"px",this.wa[0][0].style.visibility="visible",this.wa[0][1].style.position="absolute",this.wa[0][1].style.width=
W[0][1]+"px",this.R?this.wa[0][1].style.marginRight=n.offsetWidth+W[0][0]+"px":this.wa[0][1].style.marginLeft=n.offsetWidth+W[0][0]+"px"),-1==y[AdfPivotTableUtils.l])this.wa[1][0].parentNode.style.visibility="hidden";else{var ua=ja[0]+W[1][0]+F[1][0]+1,qb=this.wa[1][0].parentNode;qb.style.top=ua+"px";qb.style.visibility="visible"}e&&(A_3(this,this.ac,B[0]+w[0],AdfPivotTableUtils.n),A_3(this,this.ac,B[1]+w[1]+F[0][1]+F[1][0]+F[1][1],AdfPivotTableUtils.l));this.Vs(0,"Set overflow, size containers",
"All sizing")};AdfPivotTableUtils.prototype.sizePivotTable=AdfPivotTableUtils.prototype.Cg;AdfPivotTableUtils.prototype.Kk=function(){return AdfPivotTableUtils.Kk(this.DH.getSizing(),this.ac)};AdfPivotTableUtils.Kk=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 A_c};function A_yh(a,b,c){return b==AdfPivotTableUtils.l?1==c?a.lF:a.kF:1==c?a.nF:a.mF}
function A_Og(a,b){for(var c=AdfAgent.AGENT.getAttribute(a.na[1][0].childNodes[0],"_className"),d=0;2>d;++d)for(var e=a.T[d],f=a.i[d];2>f;++f)for(var g=e[f],h=g.length,l=0;l<h;l++)if(block=g[l],!block._placeholder&&(block._new||!b))block.childNodes[0].className=c;for(d=a.i[1];2>d;++d){e=a.N[d];for(f=a.i[0];2>f;++f)for(var g=e[f],h=g.length,l=0;l<h;l++)for(var m=g[l],n=m.length,p=0;p<n;p++)if((block=m[p])&&(block._new||!b))block.childNodes[0].className=c}if(a.qa&&(a.qa._new||!b))a.qa.childNodes[0].className=
c}function A_vh(a){for(var b=[],c=a.i[0];2>c;++c){for(var d=a.na[c],e=d.length,f=0;f<e;f++){var g=d[f];g._placeholder||b.push(g)}A_Ng(a,b,A_c)}}function A_zg(a){for(var b=[],c=a.i[1];2>c;++c)for(var d=a.Ga[c],e=d.length,f=0;f<e;f++)for(var g=d[f],h=a.i[0];2>h;++h)A_Mg(a,g,a.N[c][h][f],b,f)}
function A_xg(a,b){for(var c=AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM,d=c&&!(8<=AdfAgent.AGENT.getVersion()),e={sz:[],Hy:[]},f=a.i,g=f[0];2>g;++g)var h=0<a.o[1]?[a.N[0][g][0][0],a.N[1][g][0][0]]:[a.N[1][g][0][0]],l=Math.round(A_Lg(a,a.na[g][0],h,e));for(var g=0<a.o[1]?[a.Ga[0][0],a.Ga[1][0]]:[a.Ga[1][0]],h=g.length,m=g[0].childNodes[0].rows[0].cells.length,n=Array(m),p=0,q=a.Ba.getComponent(),v=q.getProperty(AdfRichPivotTable.Zi),u=v-1,w=0,r=1;r<m;r++){for(var x=AdfDhtmlPivotTablePeer.Ho,
s=0;s<h;s++)x=A_Gi(a,g[s],r,x);x=A_Gi(a,a.qa,r,x);n[r]=x;p+=x;r-1==u&&(w=p)}a.qa&&(u=a.qa.childNodes[0].rows[0].cells,r=u[m-1].offsetWidth,a.tw=r/(r+u[m].offsetWidth));for(s=0;s<h;s++)A_Hi(a,g[s],n,p);A_Hi(a,a.qa,n,p);g=v>=a.Db?999999:w+=q.getProperty(AdfRichPivotTable.$i);for(h=a.i[1];2>h;++h)a.Kb[h].scrollLeft=g;a.qa&&(a.Tb.scrollLeft=g);A_Ng(a,0<a.o[0]?[a.na[0][0],a.na[1][0]]:[a.na[1][0]],A_b);if(c&&a.R){c=a.N;for(g=f[1];2>g;++g){h=c[g];for(m=f[0];2>m;++m)h[m][0][0].childNodes[0].style.position=
"absolute"}}for(g=f[1];2>g;++g){rowHeaderBlock=a.Ga[g][0];var h=0<a.o[0]?[a.N[g][0][0][0],a.N[g][1][0][0]]:[a.N[g][1][0][0]],z=Math.round(A_Mg(a,rowHeaderBlock,h,A_a,A_a,e))}A_Og(a,A_c);b&&(a.jm=[l,z]);d&&A_Pg(a,A_c);return e}function A_Gi(a,b,c,d){if(b){var e=b.childNodes[0].rows[0].cells,f=e[c],g=f.offsetWidth;(b=b==a.qa)&&c==e.length-2&&(g+=e[c+1].offsetWidth);d<g&&(d=g);b||(c=AdfAgent.getAgent().getIntAttribute(f,"_winW"),c!=A_a&&(c<d&&(a.Fq=A_b),d=c))}return d}
function A_Hi(a,b,c,d){if(b){for(var e=b.childNodes[0].rows[0].cells,f=e.length,g=b==a.qa,f=g?f-2:f,h=1;h<f;h++)e[h].style.width=c[h]+"px";g&&(c=c[f],a=Math.ceil(a.tw*c),e[f].style.width=a+"px",e[f+1].style.width=c-a+"px");b.style.width=d+"px";b._width=d;b.childNodes[0].style.width=d+"px"}}
function A_Lg(a,b,c,d){for(var e=AdfAgent.getAgent(),f=c.length,g=b.childNodes[0].rows[0].cells,h=g.length-1,l=Array(h),m=0,n=a.getIntAttribute(b,"_startSlice"),p=n<a.o[0]?0:1,q=A_3g(a.Ba,0,p,A_c)-n-1,v=0,n=0;n<h;n++){var u,w=e.getIntAttribute(g[n+1],"_winW");if(w!=A_a)u=w;else{u=g[n+1].offsetWidth;for(w=0;w<f;w++){var r=c[w].childNodes[0],r=r.rows[0].cells;u=Math.max(u,r[n+1].offsetWidth)}}l[n]=u;m+=u;n==q&&(v=m)}d&&(v+=A_3g(a.Ba,0,p,A_b),d.sz[p]=v);for(n=0;n<h;n++)if(e.getAttribute(g[n+1],"_winW")==
A_a){d=l[n]+"px";g[n+1].style.width=d;for(w=0;w<f;w++)r=c[w].childNodes[0],r=r.rows[0].cells,r[n+1].style.width=d}A_3(a,b,m,AdfPivotTableUtils.n);b.childNodes[0].style.width=m+"px";for(w=0;w<f;w++)A_3(a,c[w],m,AdfPivotTableUtils.n),c[w].childNodes[0].style.width=m+"px";return 0==h?0:m/h}
function A_Ch(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}
function A_eh(a,b){for(var c=a.i[b];2>c;++c){var d=a.T[b][c],e=d.length;for(i=0;i<e;i++){var f=d[i];if(!f._placeholder&&!f._new)return f}}return A_}function A_Eh(a){a=A_eh(a,1);return A_Ch(A_b,a)}function A_Fh(a){a=A_eh(a,0);return A_Ch(A_c,a)}
function A_Ng(a,b,c){var d=AdfAgent.getAgent(),e=d.getPlatform(),f=e==AdfAgent.IE_PLATFORM,d=f&&8<=d.getVersion(),e=e==AdfAgent.WEBKIT_PLATFORM,g=b.length,h=b[0].childNodes[0].rows.length,l=Array(h),m=0,n=a.Ba.getComponent(),p=n.getProperty(AdfRichPivotTable.Xi),q=p-1,v=0,u;if(f){u=Array(g);for(var w=0;w<g;w++){var r=b[w];if(r.Xq==A_a){r.Xq=1;u[w]=Array(h);for(var x=r.childNodes[0].rows,r=h-1;0<r;r--){var s=x[r];u[w][r]=u[w][r]==A_a?d?s.cells[0].offsetHeight:s.offsetHeight:u[w][r]+(d?s.cells[0].offsetHeight:
s.offsetHeight);1==s.cells.length&&s.cells[0].className==AdfPivotTableUtils.Qz&&(u[w][r-1]=u[w][r],u[w][r]=0)}}}}for(r=1;r<h;r++){x=AdfDhtmlPivotTablePeer.sl;for(w=0;w<g;w++)x=A_Ii(a,b[w],w,r,h,x,u,f,d);x=A_Ii(a,a.qa,-1,r,h,x,u,f,d);l[r]=x;m+=x;r-1==q&&(v=m)}for(w=0;w<g;w++)A_Ji(b[w],l,m,f,d,e);A_Ji(a.qa,l,m,f,d,e);if(c){b=p>=a.Hb?999999:v+=n.getProperty(AdfRichPivotTable.Yi);for(c=a.i[0];2>c;++c)a.fb[c].scrollTop=b;a.qa&&(999999==b&&(b=a.fb[1].scrollTop),a.Tb.scrollTop=b)}}
function A_Ii(a,b,c,d,e,f,g,h,l){if(b){var m=b.childNodes[0].rows[d];h&&1==b.Xq?(c=g[c][d],d==e-1&&(b.Xq=2)):c=l?m.cells[0].offsetHeight:m.offsetHeight;f<c&&(f=c);m.zc==A_a&&(m.zc=Math.max(c,AdfDhtmlPivotTablePeer.sl),b!=a.qa&&(a=AdfAgent.getAgent().getIntAttribute(m,"_winH"),a!=A_a&&a>f&&(f=a)))}return f}
function A_Ji(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"}}
function A_Mg(a,b,c,d,e,f){var g=AdfAgent.getAgent(),h=g.getPlatform(),l=h==AdfAgent.IE_PLATFORM,m=l&&8<=AdfAgent.AGENT.getVersion();l&&AdfAgent.AGENT.getVersion();for(var n=h==AdfAgent.WEBKIT_PLATFORM,p=b.vh,q=b.childNodes[0],h=q.rows.length-1,v=Array(h),u=Array(h),w=0,r,x=a.getIntAttribute(b,"_startSlice"),s=x<a.o[1]?0:1,z=A_3g(a.Ba,1,s,A_c)-x-1,A=0,x=0;x<h;x++){r=q.rows[x+1];var G=r.cells[0].offsetHeight;p&&G++;if(r.zc==A_a){G<AdfDhtmlPivotTablePeer.Lg&&(G=AdfDhtmlPivotTablePeer.Lg);r.zc=G;var B=
g.getIntAttribute(r,"_winH");B!=A_a&&B>G&&(G=B)}r=c.length;for(var D=G,y=0;y<r;y++){var B=c[y],C=B.childNodes[0],C=C.rows[x+1],H;if(g.getAttribute(C,"_ss")!=A_a){var F=C.cells;H=0;for(var t=1;t<F.length;t++)for(var E=AdfPivotTableUtils.qi,K=F[t].getElementsByTagName("*"),I=K.length,J=0;J<I;J++)H=Math.max(H,K[J].scrollHeight+E)}else H=0;F=C.cells[0].offsetHeight;F=Math.max(F,H);B.vh&&F++;C.zc==A_a&&(F<AdfDhtmlPivotTablePeer.Lg&&(F=AdfDhtmlPivotTablePeer.Lg),C.zc=F,B=g.getIntAttribute(C,"_winH"),B!=
A_a&&B>F&&(F=B));D=Math.max(D,F);b._new||(u[x]=G<D)}v[x]=D;w+=D;x==z&&(A=w)}f&&(A+=A_3g(a.Ba,1,s,A_b),f.Hy[s]=A);g=f=0;l&&!m&&(f=AdfPivotTableUtils.qi,g=f+1);for(x=0;x<h;x++){r=q.rows[x+1];p=n||m?r.cells[0]:r;p.style.height=v[x]-g+"px";r=c.length;for(y=0;y<r;y++)C=c[y].childNodes[0],z=C.rows[x+1],p=n||m?z.cells[0]:z,p.style.height=v[x]-f+"px",A_ng(z,v[x]-f);if(u[x]&&d!=A_a){r=d.length;for(y=0;y<r;y++)C=d[y].childNodes[0],z=C.rows[x+1],p=n||m?z.cells[0]:z,p.style.height=v[x]-f+"px"}}b.style.height=
w+"px";b._new||(n=b._height-w,0!=n&&A_xh(a,s,e+1,n));b._height=w;b.childNodes[0].style.height=l&&!m?w+1+"px":w+"px";r=c.length;for(y=0;y<r;y++)c[y].style.height=l&&!m?w+1+"px":w+"px",c[y]._height=w,c[y].childNodes[0].style.height=w+"px";if(d!=A_a){r=d.length;for(y=0;y<r;y++)d[y].style.height=l&&!m?w+1+"px":w+"px",d[y]._height=w,d[y].childNodes[0].style.height=w+"px"}return 0==h?0:w/h}
function A_Pg(a,b){for(var c,d,e=0;2>e;++e)for(var f=a.T[e],g=a.i[e];2>g;++g){c=f[g];for(var h=c.length,l=0;l<h;l++)d=c[l],!d._placeholder&&(d._new||!b)&&A_Ki(a,d)}for(e=a.i[1];2>e;++e){f=a.N[e];for(g=a.i[0];2>g;++g){c=f[g];for(var h=c.length,l=0;l<h;l++)for(var m=c[l],n=m.length,p=0;p<n;p++)(d=m[p])&&(d._new||!b)&&A_Ki(a,d)}}a.qa&&(a.qa._new||!b)&&A_Ki(a,a.qa)}
function A_Ki(a,b){b.style.height=b.childNodes[0].offsetHeight-AdfPivotTableUtils.iC+"px";A_3(a,b,b.childNodes[0].offsetWidth,AdfPivotTableUtils.n);b.style.overflow="hidden"}
AdfPivotTableUtils.iS=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,v=[],u=[],w=[],r=h[0];2>r;++r)p=l[m++],q=p.childNodes[0],v[r]=p,u[r]=q,w[r]=q.childNodes[0].childNodes[0].childNodes;for(var x=[],r=[],s=[],z=[v,x],u=[u,r],A=[w,s],G=[[],[]],B=[[],[]],D=[[],[]],y=
h[1];2>y;++y){p=l[m++];q=p.childNodes[0];x[y]=p;r[y]=q;s[y]=q.childNodes[0].childNodes[0].childNodes;for(var C=h[0];2>C;++C)p=l[m++],q=p.childNodes[0],G[y][C]=p,B[y][C]=q,D[y][C]=q.childNodes[0].childNodes[0].childNodes}for(r=h[0];2>r;++r){y=w[r];l=y.length;for(m=1;m<l;m++)p=y[m].getAttribute("_winH"),p!=A_&&(y[m].style.height=p+"px")}for(y=h[1];2>y;++y){r=s[y];w=D[y];l=r.length;for(m=1;m<l;m++)if(p=r[m].getAttribute("_winH"),p!=A_){p+="px";r[m].style.height=p;for(C=h[0];2>C;++C)w[C][m].style.height=
p}}AdfPivotTableUtils.Ky();var m=AdfPivotTableUtils.bt,D=AdfPivotTableUtils.et,l=AdfPivotTableUtils.wo,H=AdfPivotTableUtils.jt,w=[g.clientWidth,g.clientHeight],y=[w[0],w[1]-0],C=[[],[]];q=[];var F=[];if(1==s[1].length){var t=B[1][1],r=t.childNodes[0],s=parseInt(t.getAttribute("_totHorizMargin"));p=parseInt(t.getAttribute("_totVertMargin"));q=AdfPivotTableUtils.kt;F=[r.offsetWidth+s,r.offsetHeight+p]}else for(s=0;2>s;++s){p=e[s];F[s]=0;for(r=h[s];2>r;++r)C[s][r]=u[s][r][p],F[s]+=C[s][r];q[1-s]=u[1-
s][1][p]+H[1-s]}p=[];for(var r=[],E=[Number(f.getAttribute("_sizeAlloc0")),Number(f.getAttribute("_sizeAlloc1"))],K=[f.getAttribute("_sizeUnit0"),f.getAttribute("_sizeUnit1")],s=0;2>s;++s){var I=y[s]-H[1-s],J=q[1-s]-H[1-s];if(t)var L=0.15,R="%";else L=E[1-s],R=K[1-s];I=AdfPivotTableUtils.hn(I,J,F[s],L,R);p[1-s]=I[0];r[1-s]=p[1-s]+H[1-s]}s=AdfAgent.getAgent().getAttribute(f,"sizing");if(t=AdfPivotTableUtils.Kk(s,f)){for(s=0;2>s;++s)y[s]=Math.min(y[s],q[1-s]+F[s]);w[0]=y[0];w[1]=y[1]+0}H=[];q=[[],[]];
for(s=0;2>s;++s)H[s]=y[s]-r[1-s],0==h[s]?(F=AdfPivotTableUtils.hn(H[s],C[s][0],C[s][1],0.5,"%"),q[s][0]=F[0],q[s][1]=H[s]-q[s][0]):q[s][1]=H[s];s=r[0];H=s+"px";for(y=h[1];2>y;++y){x[y].style.top=H;for(C=h[0];2>C;++C)G[y][C].style.top=H;0==y&&(s+=q[1][y],H=s+"px")}if(b){x=0;s="0px";for(C=1;C>=h[0];--C){v[C].style.left=s;for(y=h[1];2>y;++y)G[y][C].style.left=s;1==C&&(x+=q[0][C],s=x+"px")}}else{x=r[1];s=x+"px";for(C=h[0];2>C;++C){v[C].style.left=s;for(y=h[1];2>y;++y)G[y][C].style.left=s;0==C&&(x+=q[0][C],
s=x+"px")}}n.style.width=r[1]+"px";n.style.height=r[0]+"px";for(s=0;2>s;++s){n=z[s];v=c[1-s];x=c[s];y=p[s]+"px";for(r=h[s];2>r;++r)C=q[s][r]-l[s],n[r].style[v]=y,n[r].style[x]=C+"px"}for(s=0;2>s;++s){v=c[s];for(r=h[s];2>r;++r){x=q[s][r]-D[s]+"px";for(n=h[1-s];2>n;++n)(s?G[r][n]:G[n][r]).style[v]=x}}g.style.width=w[0]+"px";g.style.height=w[1]+"px";t&&(f.style.width=w[0]+m[0]+"px",f.style.height=w[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]=[A_,parseInt(f.getAttribute("_startCol"))],g[0]=[A_,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]=[A_,parseInt(f.getAttribute("_startRow"))],g[1]=[A_,parseInt(f.getAttribute("_startRowPixel"))]);
G=[parseInt(f.getAttribute("_colHeaderStartLayer")),parseInt(f.getAttribute("_rowHeaderStartLayer"))];f=[parseInt(f.getAttribute("_colHeaderStartPixel")),parseInt(f.getAttribute("_rowHeaderStartPixel"))];for(s=0;2>s;++s){s?(v="top",x="bottom"):b?(v="right",x="left"):(v="left",x="right");p=e[s];D=d[s];for(r=h[s];2>r;++r){for(var n=z[s][r],w=u[s][r],N=s?A[s][r]:A[s][r][0].childNodes,O=c[s][r]-parseInt(w.getAttribute("_startslice")),l=-g[s][r],m=0;m<O;m++)l-=N[m+1][p];w[p]+l<n[D]?(N=w[p]<n[D]?v:x,O=
"0px"):(N=v,O=l+"px");w.style[N]=O;for(n=h[1-s];2>n;++n)(s?B[r][n]:B[n][r]).style[N]=O}t=G[1-s];l=-f[1-s];for(r=h[1-s];2>r;++r){w=u[1-s][r];if(r==h[1-s]){n=z[1-s][r];N=s?A[1-s][r]:A[1-s][r][0].childNodes;for(m=0;m<t;m++)l-=N[m+1][p];w[p]+l<n[D]?(N=x,O="0px"):(N=v,O=l+"px")}w.style[N]=O}}};
function A_ng(a,b){for(var c=a.cells,d=1;d<c.length;d++){var e=c[d],f=e.getElementsByTagName("TEXTAREA");if((0<f.length?f[0]:A_)!=A_)f=AdfPivotTableUtils.qi,b==A_a&&(b=a.offsetHeight),f=Math.max(0,b-f),e.style.height=f+"px"}};