AdfPivotTableUtils.Nn=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]};function A_Ai(a,b){var c=b.zl;c.style.display="inline";c.style.position="absolute";A_3(a,AdfPivotTableUtils.o,b.left,c,!0);A_3(a,AdfPivotTableUtils.s,b.top,c);c.style.zIndex="3";A_2(a,c,b.innerWidth,AdfPivotTableUtils.o);A_2(a,c,b.innerHeight,AdfPivotTableUtils.s)}
AdfPivotTableUtils.prototype.Sg=function(a,b){this.Ft(0,2);var c=this.U,d=this.ar,e=this.kl(),f=this.nb,g=this.Tb,h=this.Fc,l=this.tb,m=this.se,n=this.bc,p=this.Tr,q=this.Nr,u=this.Ja,v=this.SI,x=AdfPivotTableUtils.Ot,w=AdfPivotTableUtils.Rt,y=AdfPivotTableUtils.bp,r=AdfPivotTableUtils.Xt,z=AdfPivotTableUtils.vD,C=AdfPivotTableUtils.uD,H=[C[1],C[0]],D=[a-x[0],b-x[1]];this.La(0,"get pivot table divs and sizing constants");var F=this.Sh,A=this.u,B=this.j,I=this.Hx,G=[[0,0],[0,0]];if(this.Ga.Oa){for(var t=
0;2>t;t++)for(var E=this.j[t];2>E;E++)G[t][E]=this.Fa[t][E].childNodes[0].offsetHeight,this.Fa[t][E].parentNode.style.height=G[t][E]+"px",G[t][E]=this.Fa[t][E].parentNode.offsetHeight;D[1]=D[1]-G[0][1]-G[1][1]-G[1][0]}var L=this.Ga.Oa?[0,0]:[v.offsetWidth-v.clientWidth,v.offsetHeight-v.clientHeight],K=d?p.offsetHeight:0,J=[D[0],D[1]-K];this.La(0,"get scrollbar sizes and status bar size");var M=[[],[]],S=[0,0],O=[],P=[],Ka=[],ia=[],sa=this.Mw;if(sa){for(t=0;2>t;++t)for(E=B[t];2>E;++E)M[t][E]=0;var O=
[!1,!1],P=[0,0],Jb=AdfAgent.AGENT.getIntAttribute(sa,"_totHorizMargin"),Ab=AdfAgent.AGENT.getIntAttribute(sa,"_totVertMargin"),kb=AdfDhtmlPivotTablePeer.W(sa,sa.id+"Inner"),Ka=AdfPivotTableUtils.Yt,ia=[kb.offsetWidth+Jb,kb.offsetHeight+Ab]}else{for(var lb=[],mb,t=0;2>t;++t){for(E=B[t];2>E;++E){for(var nb=this.$[t][E],Bb=nb.length,cb=0,La=0;La<Bb;La++)cb+=nb[La][F[t]];mb=cb;var ob=I[t][E],db,pb=this.$[t][E],X=pb[pb.length-1],Sa=this.getIntAttribute(pb[0],"_startSlice");db=this.getIntAttribute(X,"_startSlice")+
this.getIntAttribute(X,"_numSlices")-Sa;M[t][E]=mb+(ob-db)*this.Lm[t];S[t]+=M[t][E]}lb[t]=this.$[t][1][0][F[1-t]]}var Ta;if(this.Ga.Oa)Ta=[!1,!1];else{for(var ta=[],Z=0;2>Z;++Z){var Cb=lb[1-Z]+S[Z],eb=J[Z]-r[1-Z];ta[Z]=Cb>eb?!0:Cb<=eb-L[Z]?!1:AdfPivotTableUtils.Ul}for(Z=0;2>Z;++Z)ta[Z]===AdfPivotTableUtils.Ul&&(ta[Z]=!0===ta[1-Z]);Ta=ta}O=Ta;for(t=0;2>t;++t)P[t]=O[1-t]?L[t]:0,Ka[t]=lb[t]+r[t],ia[t]=S[t]+P[t]}for(var fb=[],da=[],Ca=[],aa=[[],[]],gb=[],Ua=[[],[]],t=0;2>t;++t){var qb=J[t]-r[1-t]-P[t],
ua=Ka[1-t]-r[1-t],Db=ia[t]-P[t];if(sa)var Eb=.15,hb="%";else Eb=this.EH[1-t],hb=this.DH[1-t];var Va=AdfPivotTableUtils.Nn(qb,ua,Db,Eb,hb);fb[1-t]=Va[0];da[1-t]=fb[1-t]+r[1-t];sa||this.Ga.Oa?(Ca[t]=!1,aa[t][1]=!1):(Ca[t]=Va[1],aa[t][1]=Va[2]);gb[1-t]=Ca[t]?L[1-t]:0;Ua[1-t][1]=aa[t][1]?L[1-t]:0}AdfAssert.assert(AdfPivotTableUtils.Qa||P[1]==Math.max(gb[1],Ua[1][1])&&P[0]==Math.max(gb[0],Ua[0][1]));this.La(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],Ka[1-t]+ia[t]);D[0]=J[0];D[1]=J[1]+K}for(var ja=[],T=[[],[]],t=0;2>t;++t)if(ja[t]=J[t]-da[1-t],-1!=A[t]){var Wa=AdfPivotTableUtils.Nn(ja[t]-P[t],M[t][0],M[t][1],this.Bk[t],"%");T[t][0]=Wa[0];T[t][1]=ja[t]-T[t][0];sa?(aa[t][0]=!1,aa[t][1]=!1):(aa[t][0]=Wa[1],aa[t][1]=Wa[2]);for(E=B[t];2>E;++E)Ua[1-t][E]=aa[t][E]?L[1-t]:0}else T[t][1]=ja[t];this.La(0,"shrink to fit; calc databody region sizes");for(var ea=[[],[]],va=[],na=[[],[]],ka=[[],[]],t=0;2>t;++t){var Y=0,Xa=-1==A[t]?
2:3;Ca[t]&&++Y;for(E=B[t];2>E;++E)aa[t][E]&&(va[t]=E,++Y);if(this.Ga.Oa?0:0<Y&&Y<Xa){var Ya=1==t&&c?0:J[1-t]-P[1-t],Za=P[1-t]-C[t],oa=0,pa=da[1-t];if(!Ca[t]){var E=va[t],Ma=q[t][E],$a=pa-z[t];if(1==t)ea[t][E]={zl:Ma,left:Ya,top:oa,innerWidth:Za,innerHeight:$a};else{var Da=c?J[t]-pa-oa:oa;ea[t][E]={zl:Ma,left:Da,top:Ya,innerWidth:$a,innerHeight:Za}}}for(E=B[t];2>E;++E)oa+=pa,pa=T[t][E],aa[t][E]?(na[t][E]=!1,ka[1-t][E]=0):(Ma=q[t][E],1==E&&(pa-=P[t]),$a=pa-z[t],1==t?ea[t][E]={zl:Ma,left:Ya,top:oa,innerWidth:Za,
innerHeight:$a}:(Da=c?J[t]-pa-oa:oa,ea[t][E]={zl:Ma,left:Da,top:Ya,innerWidth:$a,innerHeight:Za}),na[t][E]=!0,ka[1-t][E]=P[1-t])}else for(E=B[t];2>E;++E)na[t][E]=!1,ka[1-t][E]=0}if(na[0][1]&&O[1]||na[1][1]&&O[0])var Kb={zl:this.Aw,left:c?0:J[0]-P[0],top:J[1]-P[1],innerWidth:P[0]-H[0],innerHeight:P[1]-H[1]},Fb=!0;else Fb=!1;this.La(0,"Scrollbar spacer calcs");for(var wa=da[0],Q=B[1];2>Q;++Q){A_3(this,AdfPivotTableUtils.s,wa,g[Q]);for(var V=B[0];2>V;++V)A_3(this,AdfPivotTableUtils.s,wa,l[Q][V]),0<Q+
V&&A_3(this,AdfPivotTableUtils.s,wa,m[Q][V]);wa+=T[1][Q]+G[1][0]}d&&(A_3(this,AdfPivotTableUtils.s,J[1],p),A_3(this,AdfPivotTableUtils.o,0,p,!0));if(c){for(var Ea=0,Na=P[0],xa=[ka[0][0],ka[0][1]],V=1;V>=B[0];--V){A_3(this,AdfPivotTableUtils.o,Ea,f[V],!0);for(Q=B[1];2>Q;++Q)A_3(this,AdfPivotTableUtils.o,Na,l[Q][V],!0),0<Q+V&&A_3(this,AdfPivotTableUtils.o,xa[Q],m[Q][V],!0);Na=Ea+=T[0][V];xa[0]=Ea;xa[1]=Ea}for(Q=B[1];2>Q;++Q)g[Q].ak=ja[0]}else{for(var la=da[1],V=B[0];2>V;++V){A_3(this,AdfPivotTableUtils.o,
la,f[V],!0);for(Q=B[1];2>Q;++Q)A_3(this,AdfPivotTableUtils.o,la,l[Q][V],!0),0<Q+V&&A_3(this,AdfPivotTableUtils.o,la,m[Q][V],!0);la+=T[0][V]}for(Q=B[1];2>Q;++Q)g[Q].ak=0}this.La(0,"position pt divs");for(t=0;2>t;++t){var qa,ra,ha,ya;-1!=A[t]&&(qa=this.Hd[t][0],ra=T[t][0],A_2(this,qa,ra,t),ha=ra,ya=this.$r[t],qa[ya]=ha,this.we[t][0]=Math.max(0,M[t][0]-ha));for(E=B[t];2>E;++E)qa=this.Hd[t][E],ra=T[1-t][1]-ka[1-t][E],A_2(this,qa,ra,1-t),ha=ra-Ua[1-t][E],ya=this.$r[1-t],qa[ya]=ha,1==E&&(this.we[1-t][1]=
Math.max(0,M[1-t][1]-ha))}for(t=0;2>t;++t)for(E=B[t];2>E;++E){var U=t,Fa=E,Ga=M[t][E],rb=this.j;if(U==AdfPivotTableUtils.s){1==Fa?this.dG=Ga:this.cG=Ga;for(var N=rb[1-U];2>N;++N)(0<Fa+N||AdfPivotTableUtils.R())&&A_2(this,A_xi(this,Fa,N),Ga,U)}else for(1==Fa?this.fG=Ga:this.eG=Ga,N=rb[1-U];2>N;++N)(0<Fa+N||AdfPivotTableUtils.R())&&A_2(this,A_xi(this,N,Fa),Ga,U)}A_2(this,n,da[1],AdfPivotTableUtils.o);A_2(this,n,da[0],AdfPivotTableUtils.s);for(var R=[[],[]],t=1;0<=t;--t)for(E=B[t];2>E;++E)R[t][E]=T[t][E]-
y[t],A_2(this,h[t][E],fb[t],1-t),A_2(this,h[t][E],R[t][E],t);for(t=0;2>t;++t)for(E=B[t];2>E;++E)for(var ib=T[t][E]-(E?P[t]:0)-w[t],fa=B[1-t];2>fa;++fa)A_2(this,t?l[E][fa]:l[fa][E],ib,t);d&&A_2(this,p,D[0],AdfPivotTableUtils.o);for(t=0;2>t;++t)for(E=0;2>E;++E)ea[t][E]?A_Ai(this,ea[t][E]):q[t][E].style.display="none";Fb?A_Ai(this,Kb):this.Aw.style.display="none";this.La(0,"size PT divs, show/hide spacers");if(!AdfPivotTableUtils.R()&&!this.Ga.Oa)for(t=0;2>t;++t)for(var za=t?"overflowY":"overflowX",
E=B[t];2>E;++E){var Ha=aa[t][E]?"scroll":"hidden";qa=this.Hd[t][E];qa.style[za]=Ha}this.TI||(AdfPivotTableUtils.R()||(m[0][1].style.overflowX="hidden",m[1][0].style.overflowY="hidden",this.Fc[0][0].style.overflow="hidden",this.Fc[1][0].style.overflow="hidden"),this.TI=!0);A_2(this,u,D[0],0);-1==A[AdfPivotTableUtils.s]?A_2(this,u,D[1],1):A_2(this,u,D[1]+G[1][0],1);if(this.Ga.Oa)if(-1==A[AdfPivotTableUtils.o]?(this.Fa[0][1].style.position="absolute",this.Fa[0][0].style.visibility="hidden",this.Fa[0][1].style.width=
T[0][1]+"px",this.U?this.Fa[0][1].style.marginRight=n.offsetWidth+"px":this.Fa[0][1].style.marginLeft=n.offsetWidth+"px"):(this.Fa[0][0].style.position="absolute",this.Fa[0][0].style.width=T[0][0]+"px",this.U?this.Fa[0][0].style.marginRight=n.offsetWidth+"px":this.Fa[0][0].style.marginLeft=n.offsetWidth+"px",this.Fa[0][0].style.visibility="visible",this.Fa[0][1].style.position="absolute",this.Fa[0][1].style.width=T[0][1]+"px",this.U?this.Fa[0][1].style.marginRight=n.offsetWidth+T[0][0]+"px":this.Fa[0][1].style.marginLeft=
n.offsetWidth+T[0][0]+"px"),-1==A[AdfPivotTableUtils.s])this.Fa[1][0].parentNode.style.visibility="hidden";else{var wa=da[0]+T[1][0]+G[1][0]+1,ab=this.Fa[1][0].parentNode;ab.style.top=wa+"px";ab.style.visibility="visible"}e&&(A_2(this,this.hc,D[0]+x[0],AdfPivotTableUtils.o),A_2(this,this.hc,D[1]+x[1]+G[0][1]+G[1][0]+G[1][1],AdfPivotTableUtils.s));this.Gt(0,"Set overflow, size containers","All sizing")};AdfPivotTableUtils.prototype.sizePivotTable=AdfPivotTableUtils.prototype.Sg;
AdfPivotTableUtils.prototype.kl=function(){return AdfPivotTableUtils.kl(this.zI.getSizing(),this.hc)};AdfPivotTableUtils.kl=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};function A_Ch(a,b,c){return b==AdfPivotTableUtils.s?1==c?a.dG:a.cG:1==c?a.fG:a.eG}
function A_Mg(a,b){for(var c=AdfAgent.AGENT.getAttribute(a.wa[1][0].childNodes[0],"_className"),d=0;2>d;++d)for(var e=a.$[d],f=a.j[d];2>f;++f)for(var g=e[f],h=g.length,l=0;l<h;l++)block=g[l],block._placeholder||!block._new&&b||(block.childNodes[0].className=c);for(d=a.j[1];2>d;++d)for(e=a.V[d],f=a.j[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++)!(block=m[p])||!block._new&&b||(block.childNodes[0].className=c);!a.za||!a.za._new&&b||(a.za.childNodes[0].className=
c)}function A_wh(a){for(var b=[],c=a.j[0];2>c;++c){for(var d=a.wa[c],e=d.length,f=0;f<e;f++){var g=d[f];g._placeholder||b.push(g)}A_Lg(a,b,!1)}}function A_tg(a){for(var b=[],c=a.j[1];2>c;++c)for(var d=a.Pa[c],e=d.length,f=0;f<e;f++)for(var g=d[f],h=a.j[0];2>h;++h)A_Kg(a,g,a.V[c][h][f],b,f)}
function A_rg(a,b){for(var c=AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM,d=c&&!(8<=AdfAgent.AGENT.getVersion()),e={hA:[],uz:[]},f=a.j,g=f[0];2>g;++g)var h=0<a.u[1]?[a.V[0][g][0][0],a.V[1][g][0][0]]:[a.V[1][g][0][0]],l=Math.round(A_Jg(a,a.wa[g][0],h,e));for(var g=0<a.u[1]?[a.Pa[0][0],a.Pa[1][0]]:[a.Pa[1][0]],h=g.length,m=g[0].childNodes[0].rows[0].cells.length,n=Array(m),p=0,q=a.Ga.getComponent(),u=q.getProperty(AdfRichPivotTable.uj),v=u-1,x=0,w=1;w<m;w++){for(var y=AdfDhtmlPivotTablePeer.np,
r=0;r<h;r++)y=A_Bi(a,g[r],w,y);y=A_Bi(a,a.za,w,y);n[w]=y;p+=y;w-1==v&&(x=p)}a.za&&(v=a.za.childNodes[0].rows[0].cells,w=v[m-1].offsetWidth,a.gx=w/(w+v[m].offsetWidth));for(r=0;r<h;r++)A_Ci(a,g[r],n,p);A_Ci(a,a.za,n,p);g=u>=a.Lb?999999:x+=q.getProperty(AdfRichPivotTable.vj);for(h=a.j[1];2>h;++h)a.Tb[h].scrollLeft=g;a.za&&(a.bc.scrollLeft=g);A_Lg(a,0<a.u[0]?[a.wa[0][0],a.wa[1][0]]:[a.wa[1][0]],!0);if(c&&a.U)for(c=a.V,g=f[1];2>g;++g)for(h=c[g],m=f[0];2>m;++m)h[m][0][0].childNodes[0].style.position="absolute";
for(g=f[1];2>g;++g){rowHeaderBlock=a.Pa[g][0];var h=0<a.u[0]?[a.V[g][0][0][0],a.V[g][1][0][0]]:[a.V[g][1][0][0]],z=Math.round(A_Kg(a,rowHeaderBlock,h,void 0,void 0,e))}A_Mg(a,!1);b&&(a.Lm=[l,z]);d&&A_Ng(a,!1);return e}
function A_Bi(a,b,c,d){if(b){var e=b.childNodes[0].rows[0].cells,f=e[c],g=f.offsetWidth,h=b==a.za;h&&c==e.length-2&&(g+=e[c+1].offsetWidth);d<g&&(d=g);"true"==b.childNodes[0].getAttribute("isrowheadercontainsimage")&&(d+=AdfDhtmlPivotTablePeer.tD);h||(b=AdfAgent.getAgent().getIntAttribute(f,"_winW"),void 0!=b&&(b<d&&(a.nr=!0),d=b))}return d}
function A_Ci(a,b,c,d){if(b){for(var e=b.childNodes[0].rows[0].cells,f=e.length,g=b==a.za,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.gx*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_Jg(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.u[0]?0:1,q=A_3g(a.Ga,0,p,!1)-n-1,u=0,n=0;n<h;n++){var v,x=e.getIntAttribute(g[n+1],"_winW");if(void 0!=x)v=x;else for(v=g[n+1].offsetWidth,x=0;x<f;x++){var w=c[x].childNodes[0],w=w.rows[0].cells;v=Math.max(v,w[n+1].offsetWidth)}l[n]=v;m+=v;n==q&&(u=m)}d&&(u+=A_3g(a.Ga,0,p,!0),d.hA[p]=u);for(n=0;n<h;n++)if(void 0==e.getAttribute(g[n+
1],"_winW"))for(d=l[n]+"px",g[n+1].style.width=d,x=0;x<f;x++)w=c[x].childNodes[0],w=w.rows[0].cells,w[n+1].style.width=d;A_2(a,b,m,AdfPivotTableUtils.o);b.childNodes[0].style.width=m+"px";for(x=0;x<f;x++)A_2(a,c[x],m,AdfPivotTableUtils.o),c[x].childNodes[0].style.width=m+"px";return 0==h?0:m/h}
function A_Fh(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_fh(a,b){for(var c=a.j[b];2>c;++c){var d=a.$[b][c],e=d.length;for(i=0;i<e;i++){var f=d[i];if(!f._placeholder&&!f._new)return f}}return null}function A_Hh(a){a=A_fh(a,1);return A_Fh(!0,a)}function A_Ih(a){a=A_fh(a,0);return A_Fh(!1,a)}
function A_Lg(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.Ga.getComponent(),p=n.getProperty(AdfRichPivotTable.sj),q=p-1,u=0,v;if(f){v=Array(g);for(var x=0;x<g;x++){var w=b[x];if(void 0==w.Ir){w.Ir=1;v[x]=Array(h);for(var y=w.childNodes[0].rows,w=h-1;0<w;w--){var r=y[w];v[x][w]=void 0==v[x][w]?d?r.cells[0].offsetHeight:r.offsetHeight:v[x][w]+(d?r.cells[0].offsetHeight:
r.offsetHeight);1==r.cells.length&&r.cells[0].className==AdfPivotTableUtils.GA&&(v[x][w-1]=v[x][w],v[x][w]=0)}}}}for(w=1;w<h;w++){y=AdfDhtmlPivotTablePeer.Vl;for(x=0;x<g;x++)y=A_Di(a,b[x],x,w,h,y,v,f,d);y=A_Di(a,a.za,-1,w,h,y,v,f,d);l[w]=y;m+=y;w-1==q&&(u=m)}for(x=0;x<g;x++)A_Ei(b[x],l,m,f,d,e);A_Ei(a.za,l,m,f,d,e);if(c){b=p>=a.Qb?999999:u+=n.getProperty(AdfRichPivotTable.tj);for(c=a.j[0];2>c;++c)a.nb[c].scrollTop=b;a.za&&(999999==b&&(b=a.nb[1].scrollTop),a.bc.scrollTop=b)}}
function A_Di(a,b,c,d,e,f,g,h,l){if(b){var m=b.childNodes[0].rows[d];h&&1==b.Ir?(c=g[c][d],d==e-1&&(b.Ir=2)):c=l?m.cells[0].offsetHeight:m.offsetHeight;f<c&&(f=c);void 0==m.Hc&&(m.Hc=Math.max(c,AdfDhtmlPivotTablePeer.Vl),b!=a.za&&(a=AdfAgent.getAgent().getIntAttribute(m,"_winH"),void 0!=a&&a>f&&(f=a)))}return f}
function A_Ei(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_Kg(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.Mh,q=b.childNodes[0],h=q.rows.length-1,u=Array(h),v=Array(h),x=0,w,y=a.getIntAttribute(b,"_startSlice"),r=y<a.u[1]?0:1,z=A_3g(a.Ga,1,r,!1)-y-1,C=0,y=0;y<h;y++){w=q.rows[y+1];var H=w.cells[0].offsetHeight;p&&H++;if(void 0==w.Hc){H<AdfDhtmlPivotTablePeer.ah&&(H=AdfDhtmlPivotTablePeer.ah);w.Hc=H;var D=
g.getIntAttribute(w,"_winH");void 0!=D&&D>H&&(H=D)}w=c.length;for(var F=H,A=0;A<w;A++){var D=c[A],B=D.childNodes[0],B=B.rows[y+1],I;if(void 0!=g.getAttribute(B,"_ss")){var G=B.cells;I=0;for(var t=1;t<G.length;t++)for(var E=AdfPivotTableUtils.Ii,L=G[t].getElementsByTagName("*"),K=L.length,J=0;J<K;J++)I=Math.max(I,L[J].scrollHeight+E)}else I=0;G=B.cells[0].offsetHeight;G=Math.max(G,I);D.Mh&&G++;void 0==B.Hc&&(G<AdfDhtmlPivotTablePeer.ah&&(G=AdfDhtmlPivotTablePeer.ah),B.Hc=G,D=g.getIntAttribute(B,"_winH"),
void 0!=D&&D>G&&(G=D));F=Math.max(F,G);b._new||(v[y]=H<F)}u[y]=F;x+=F;y==z&&(C=x)}f&&(C+=A_3g(a.Ga,1,r,!0),f.uz[r]=C);g=f=0;l&&!m&&(f=AdfPivotTableUtils.Ii,g=f+1);for(y=0;y<h;y++){w=q.rows[y+1];p=n||m?w.cells[0]:w;p.style.height=u[y]-g+"px";w=c.length;for(A=0;A<w;A++)B=c[A].childNodes[0],z=B.rows[y+1],p=n||m?z.cells[0]:z,p.style.height=u[y]-f+"px",A_hg(z,u[y]-f);if(v[y]&&void 0!=d)for(w=d.length,A=0;A<w;A++)B=d[A].childNodes[0],z=B.rows[y+1],p=n||m?z.cells[0]:z,p.style.height=u[y]-f+"px"}b.style.height=
x+"px";b._new||(n=b._height-x,0!=n&&A_yh(a,r,e+1,n));b._height=x;b.childNodes[0].style.height=l&&!m?x+1+"px":x+"px";w=c.length;for(A=0;A<w;A++)c[A].style.height=l&&!m?x+1+"px":x+"px",c[A]._height=x,c[A].childNodes[0].style.height=x+"px";if(void 0!=d)for(w=d.length,A=0;A<w;A++)d[A].style.height=l&&!m?x+1+"px":x+"px",d[A]._height=x,d[A].childNodes[0].style.height=x+"px";return 0==h?0:x/h}
function A_Ng(a,b){for(var c,d,e=0;2>e;++e)for(var f=a.$[e],g=a.j[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_Fi(a,d)}for(e=a.j[1];2>e;++e)for(f=a.V[e],g=a.j[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||!d._new&&b||A_Fi(a,d)}!a.za||!a.za._new&&b||A_Fi(a,a.za)}
function A_Fi(a,b){b.style.height=b.childNodes[0].offsetHeight-AdfPivotTableUtils.aD+"px";A_2(a,b,b.childNodes[0].offsetWidth,AdfPivotTableUtils.o);b.style.overflow="hidden"}
AdfPivotTableUtils.BS=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,u=[],v=[],x=[],w=h[0];2>w;++w)p=l[m++],q=p.childNodes[0],u[w]=p,v[w]=q,x[w]=q.childNodes[0].childNodes[0].childNodes;for(var y=[],w=[],r=[],z=[u,y],v=[v,w],C=[x,r],H=[[],[]],D=[[],[]],F=[[],[]],A=
h[1];2>A;++A){p=l[m++];q=p.childNodes[0];y[A]=p;w[A]=q;r[A]=q.childNodes[0].childNodes[0].childNodes;for(var B=h[0];2>B;++B)p=l[m++],q=p.childNodes[0],H[A][B]=p,D[A][B]=q,F[A][B]=q.childNodes[0].childNodes[0].childNodes}for(w=h[0];2>w;++w)for(A=x[w],l=A.length,m=1;m<l;m++)p=A[m].getAttribute("_winH"),null!=p&&(A[m].style.height=p+"px");for(A=h[1];2>A;++A)for(w=r[A],x=F[A],l=w.length,m=1;m<l;m++)if(p=w[m].getAttribute("_winH"),null!=p)for(p+="px",w[m].style.height=p,B=h[0];2>B;++B)x[B][m].style.height=
p;AdfPivotTableUtils.xz();var m=AdfPivotTableUtils.Ot,F=AdfPivotTableUtils.Rt,l=AdfPivotTableUtils.bp,I=AdfPivotTableUtils.Xt,x=[g.clientWidth,g.clientHeight],A=[x[0],x[1]-0],B=[[],[]];q=[];var G=[];if(1==r[1].length){var t=D[1][1],w=t.childNodes[0],r=parseInt(t.getAttribute("_totHorizMargin"));p=parseInt(t.getAttribute("_totVertMargin"));q=AdfPivotTableUtils.Yt;G=[w.offsetWidth+r,w.offsetHeight+p]}else for(r=0;2>r;++r){p=e[r];G[r]=0;for(w=h[r];2>w;++w)B[r][w]=v[r][w][p],G[r]+=B[r][w];q[1-r]=v[1-
r][1][p]+I[1-r]}p=[];for(var w=[],E=[Number(f.getAttribute("_sizeAlloc0")),Number(f.getAttribute("_sizeAlloc1"))],L=[f.getAttribute("_sizeUnit0"),f.getAttribute("_sizeUnit1")],r=0;2>r;++r){var K=A[r]-I[1-r],J=q[1-r]-I[1-r];if(t)var M=.15,S="%";else M=E[1-r],S=L[1-r];p[1-r]=AdfPivotTableUtils.Nn(K,J,G[r],M,S)[0];w[1-r]=p[1-r]+I[1-r]}r=AdfAgent.getAgent().getAttribute(f,"sizing");if(t=AdfPivotTableUtils.kl(r,f)){for(r=0;2>r;++r)A[r]=Math.min(A[r],q[1-r]+G[r]);x[0]=A[0];x[1]=A[1]+0}I=[];q=[[],[]];for(r=
0;2>r;++r)I[r]=A[r]-w[1-r],0==h[r]?(q[r][0]=AdfPivotTableUtils.Nn(I[r],B[r][0],B[r][1],.5,"%")[0],q[r][1]=I[r]-q[r][0]):q[r][1]=I[r];r=w[0];I=r+"px";for(A=h[1];2>A;++A){y[A].style.top=I;for(B=h[0];2>B;++B)H[A][B].style.top=I;0==A&&(r+=q[1][A],I=r+"px")}if(b)for(y=0,r="0px",B=1;B>=h[0];--B){u[B].style.left=r;for(A=h[1];2>A;++A)H[A][B].style.left=r;1==B&&(y+=q[0][B],r=y+"px")}else for(y=w[1],r=y+"px",B=h[0];2>B;++B){u[B].style.left=r;for(A=h[1];2>A;++A)H[A][B].style.left=r;0==B&&(y+=q[0][B],r=y+"px")}n.style.width=
w[1]+"px";n.style.height=w[0]+"px";for(r=0;2>r;++r)for(n=z[r],u=c[1-r],y=c[r],A=p[r]+"px",w=h[r];2>w;++w)B=q[r][w]-l[r],n[w].style[u]=A,n[w].style[y]=B+"px";for(r=0;2>r;++r)for(u=c[r],w=h[r];2>w;++w)for(y=q[r][w]-F[r]+"px",n=h[1-r];2>n;++n)(r?H[w][n]:H[n][w]).style[u]=y;g.style.width=x[0]+"px";g.style.height=x[1]+"px";t&&(f.style.width=x[0]+m[0]+"px",f.style.height=x[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"))]);H=[parseInt(f.getAttribute("_colHeaderStartLayer")),
parseInt(f.getAttribute("_rowHeaderStartLayer"))];f=[parseInt(f.getAttribute("_colHeaderStartPixel")),parseInt(f.getAttribute("_rowHeaderStartPixel"))];for(r=0;2>r;++r){r?(u="top",y="bottom"):b?(u="right",y="left"):(u="left",y="right");p=e[r];F=d[r];for(w=h[r];2>w;++w){for(var n=z[r][w],x=v[r][w],O=r?C[r][w]:C[r][w][0].childNodes,P=c[r][w]-parseInt(x.getAttribute("_startslice")),t=-g[r][w],m=0;m<P;m++)t-=O[m+1][p];x[p]+t<n[F]?(O=x[p]<n[F]?u:y,P="0px"):(O=u,P=t+"px");x.style[O]=P;for(n=h[1-r];2>n;++n)(r?
D[w][n]:D[n][w]).style[O]=P}l=H[1-r];t=-f[1-r];for(w=h[1-r];2>w;++w){x=v[1-r][w];if(w==h[1-r]){n=z[1-r][w];O=r?C[1-r][w]:C[1-r][w][0].childNodes;for(m=0;m<l;m++)t-=O[m+1][p];x[p]+t<n[F]?(O=y,P="0px"):(O=u,P=t+"px")}x.style[O]=P}}};function A_hg(a,b){for(var c=a.cells,d=1;d<c.length;d++){var e=c[d],f=e.getElementsByTagName("TEXTAREA");null!=(0<f.length?f[0]:null)&&(f=AdfPivotTableUtils.Ii,void 0==b&&(b=a.offsetHeight),e.style.height=Math.max(0,b-f)+"px")}};