function A_Rf(a,b,c){if(!A_8e(a))return A_c;var d=A_b;if(AdfPivotTableUtils.F()){var d=A_c,e=b.edge,f=b.layer;if(A_lc(a,AdfAgent.AGENT.getEventTarget(c),"_sorted")){c=A_2(a,e);for(var g=c.length-1;0<=g;--g){var h=c[g];if(A_Kh(h)){var l=h.startIndex;if(l.layer==f){var m=b.slice;if(!(l.slice>m)&&(h=h.endIndex,h==A_&&(h=l),!(h.slice<m)))return d}}}}A_Lh(a,b,A_b);b=A_oc(a,e,f);if(a.gc==A_||b!=A_&&b.id!=a.gc.id)A_3e(a),b!=A_&&A_Nf(a,e,f,b)}else e="keydown"==c.type?c.ctrlKey:A_Cf(c),f=c.shiftKey,!e&&!f?
A_cf(a,b):d=!e&&f?A_Mh(a,b,AdfPivotTableUtils.rl):A_Lh(a,b,A_c);return d}
function A_bg(a,b,c){if(A_8e(a)){var d=A_df(a,b.rg.cell);if(AdfPivotTableUtils.F())if(a.isSelected(d)){c=A_n(d);A_Nh(a,c,AdfPivotTableUtils.D,AdfDhtmlPivotTablePeer.Xd);c=A_Oh(a);b=A_2(a,AdfPivotTableUtils.D,c);for(var e=d.row,d=d.column,f=b.length-1;-1<f;f--){var g=b[f];if(A_Kh(g))if(g.endIndex==A_)g.startIndex.column==d&&g.startIndex.row==e&&b.splice(f,1);else{var h=g.startIndex,l=h.row,h=h.column;if(!(l>e||h>d)){var m=A_Ph(g),g=m.row,m=m.column;if(!(g<e||m<d)){var n=[f,1];if(e>l){var p=A_m(l,h);
m>h||1<e-l?(l=A_m(e-1,m),l=A_n(p,l)):l=A_n(p);n.push(l)}d>h&&(p=A_m(e,h),1<d-h?(l=A_m(e,d-1),l=A_n(p,l)):l=A_n(p),n.push(l));m>d&&(p=A_m(e,d+1),1<m-d?(l=A_m(e,m),l=A_n(p,l)):l=A_n(p),n.push(l));g>e&&(p=A_m(e+1,h),m>h||1<g-e?(l=A_m(g,m),l=A_n(p,l)):l=A_n(p),n.push(l));Array.prototype.splice.apply(b,n)}}}}a.v!=A_&&(a.v.row==e&&a.v.column==d)&&(0!=b.length?(g=b[b.length-1],A_Kh(g)?A_Qh(a,g.startIndex,A_,A_b,c):a.v=A_):a.v=A_);A_Rh(a,c);A_Sh(a,c)}else A_Th(a,d,A_b);else a.hm=A_b,AdfPage.PAGE.startDrag(c,
a.px,a.qx),b=A_Cf(c),c=c.shiftKey,!b&&!c?A_1(a,d):!b&&c?A_Uh(a,d):A_Th(a,d,A_c)}}A_g=AdfDhtmlPivotTablePeer.prototype;
A_g.YK=function(a){var b=A_af(this,a);if(this.ym){if(A_8e(this)&&b.ka&&b.ka.cell){a=A_bf(b.ka.cell);var c=a.edge;c===A_of(this)&&(AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&8<=AdfAgent.AGENT.getVersion()||AdfDhtmlPivotTablePeer.Ca(b.ka.cell,this.nw[c]),b=A_rf(this).startIndex.layer,a.layer==b&&(A_Df(this,A_),A_Mh(this,a,A_c)))}}else this.hm&&A_8e(this)&&(b.rg?(!a.shiftKey&&!A_Cf(a)&&A_Df(this,A_),b=A_df(this,b.rg.cell),A_Uh(this,b)):b.ka&&b.ka.cell&&(AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM&&
8<=AdfAgent.AGENT.getVersion()||AdfDhtmlPivotTablePeer.Ca(b.ka.cell,"")))};A_g.ZK=function(){this.hm=this.ym=A_c};
function A_Pf(a,b,c,d){if(A_8e(a)&&(d||!Boolean(A_Ze(a))))if(d=a.v,d!=A_)if(d=A_Ef(d),a.b.R&&(c==AdfKeyStroke.ARROWLEFT_KEY?c=AdfKeyStroke.ARROWRIGHT_KEY:c==AdfKeyStroke.ARROWRIGHT_KEY&&(c=AdfKeyStroke.ARROWLEFT_KEY)),d==AdfPivotTableUtils.D)a:{if(b){if(d=a.eg,d==A_)break a}else{d=a.Xb;if(d==A_)break a;d=d.startIndex}var e=d.row,f=d.column;switch(c){case AdfKeyStroke.ARROWLEFT_KEY:0==f?A_Vh(a,AdfPivotTableUtils.l,e,b):f==a.b.o[0]?A_Wh(a,0,0,A_c,e):(d=A_m(e,f-1),b?A_Uh(a,d):A_1(a,d),A_0f(a,d));break;
case AdfKeyStroke.ARROWRIGHT_KEY:f==a.b.o[0]-1?A_Wh(a,0,1,A_b,e):f+1<a.b.fc?(d=A_m(e,f+1),b?A_Uh(a,d):A_1(a,d),A_0f(a,d)):b||(A_1(a,d),A_0f(a,d));break;case AdfKeyStroke.ARROWUP_KEY:0==e?A_Vh(a,AdfPivotTableUtils.n,f,b):e==a.b.o[1]?A_Wh(a,1,0,A_c,f):(d=A_m(e-1,f),b?A_Uh(a,d):A_1(a,d),A_0f(a,d));break;case AdfKeyStroke.ARROWDOWN_KEY:e==a.b.o[1]-1?A_Wh(a,1,1,A_b,f):e+1<a.b.pe?(d=A_m(e+1,f),b?A_Uh(a,d):A_1(a,d),A_0f(a,d)):b||(A_1(a,d),A_0f(a,d));break;default:AdfAssert.assert(AdfPivotTableUtils.Ha,"unexpected keyCode in handleDatabodyKeyboardNavigation")}}else{f=
a.v;d=f.edge;var g=f.layer,h=f.slice;switch(A_Xh(d,c)){case AdfDhtmlPivotTablePeer.Ko:0!=g&&(c=g-1,e=h,A_Yh(a,f)||(c=A_Zh(a,d,c),e=A__h(a,d,e)),a.fm=c,a.gm=e,f=A_Ug(a,d,c,e),g=e<a.b.o[d]?0:1,f==A_?(f=e<A_Xf(a,d,g)?-100:100,A_0h(a,f,d,c,e,b)):A_Vg(a,f,g,b));break;case AdfDhtmlPivotTablePeer.Lo:c=A_1h(a,f);var l=d?a.b.Db:a.b.Hb;c=g+(c?f.depth:1);e=h;c>=l?b||(b=1-d,A_Wh(a,b,a.b.i[b],A_b,e)):(A_Yh(a,f)||(c=A_Zh(a,d,c),e=A__h(a,d,e)),a.fm=c,a.gm=e,f=A_Ug(a,d,c,e),g=e<a.b.o[d]?0:1,f==A_?(f=e<A_Xf(a,d,g)?
-100:100,A_0h(a,f,d,c,e,b)):A_Vg(a,f,g,b));break;case AdfDhtmlPivotTablePeer.Mo:h==a.b.o[d]?A_2h(a,d,0,A_c,g):(c=g,e=h-1,A_Yh(a,f)||(c=A_Zh(a,d,c),e=A__h(a,d,e)),-1==e?A_2h(a,1-d,a.b.i[1-d],A_b,c):(a.fm=c,a.gm=e,f=A_Ug(a,d,c,e),f==A_?A_0h(a,-100,d,c,e,b):(g=e<a.b.o[d]?0:1,A_Vg(a,f,g,b))));break;case AdfDhtmlPivotTablePeer.No:e=(c=A_1h(a,f))?f.extent:1;c=g;e=h+e;l=a.b.o[d];if(h<l&&e>=l)A_2h(a,d,1,A_b,g);else if(A_Yh(a,f)||(c=A_Zh(a,d,c),e=A__h(a,d,e)),e<(d?a.b.pe:a.b.fc))a.fm=c,a.gm=e,f=A_Ug(a,d,c,
e),f==A_?A_0h(a,100,d,c,e,b):(g=e<a.b.o[d]?0:1,A_Vg(a,f,g,b));break;default:AdfAssert.assert(AdfPivotTableUtils.Ha,"unexpected navType in handleHeaderKeyboardNavigation")}}}
function A_Qf(a,b){var c=a.v;if(c!=A_){a.b.R&&(b==AdfKeyStroke.ARROWLEFT_KEY?b=AdfKeyStroke.ARROWRIGHT_KEY:b==AdfKeyStroke.ARROWRIGHT_KEY&&(b=AdfKeyStroke.ARROWLEFT_KEY));var d=b==AdfKeyStroke.ARROWRIGHT_KEY||b==AdfKeyStroke.ARROWDOWN_KEY,e=b==AdfKeyStroke.ARROWUP_KEY||b==AdfKeyStroke.ARROWDOWN_KEY?AdfPivotTableUtils.l:AdfPivotTableUtils.n,f=A_Ef(c);if(f==AdfPivotTableUtils.D){var g;e?(f=c.column,g=c.row):(f=c.row,g=c.column);var h=a.b.o[e];g=g<h?0:1;d?0==g&&A_Wh(a,e,1,d,f):g==a.b.i[e]?A_Vh(a,1-e,
f,A_c):A_Wh(a,e,0,d,f)}else f==e?(h=a.b.o[e],g=c.slice,g=g<h?0:1,d?0==g&&A_2h(a,e,1,d,c.layer):g==a.b.i[e]?(e=1-e,f=a.b.i[e],A_2h(a,e,f,!d,c.layer)):A_2h(a,e,0,d,c.layer)):d&&(f=a.b.i[e],A_Wh(a,e,f,d,c.slice))}}function A_Wh(a,b,c,d,e){A_8e(a)&&(e=A__h(a,1-b,e),b=A_Zf(a,b,c,d,e),A_1(a,b),!A_We(a)&&!A_Xe(a)&&!a.Cq?A_Sf(a):A_0f(a,b))}function A_Zf(a,b,c,d,e){a=d?A_3h(a,b,c):A_4h(a,b,c);b?b=a:(b=e,e=a);return A_m(b,e)}
function A_2h(a,b,c,d,e){if(A_8e(a)&&0!=(b?a.b.Db:a.b.Hb))e=A_Zh(a,b,e),c=d?A_3h(a,b,c):A_4h(a,b,c),b=A_Ug(a,b,e,c),A_Qh(a,b)}function A_Vh(a,b,c,d){if(A_8e(a)){var e=b==AdfPivotTableUtils.n?a.b.Hb:a.b.Db;if(!d&&0<e){A_Tg(a,A_b);d=A_5h();a.Xb=A_;a.eg=A_;var e=(b?a.b.Db:a.b.Hb)-1,f=A_Ug(a,b,e,c);f==A_&&(c=A__h(a,b,c),f=A_Ug(a,b,e,c));A_Qh(a,f,b,A_c,d);a.fm=e;a.gm=c;A_Rh(a,d);A_Sh(a,d)}}}
function A_Xh(a,b){if(a==AdfPivotTableUtils.n)switch(b){case AdfKeyStroke.ARROWLEFT_KEY:return AdfDhtmlPivotTablePeer.Mo;case AdfKeyStroke.ARROWRIGHT_KEY:return AdfDhtmlPivotTablePeer.No;case AdfKeyStroke.ARROWUP_KEY:return AdfDhtmlPivotTablePeer.Ko;case AdfKeyStroke.ARROWDOWN_KEY:return AdfDhtmlPivotTablePeer.Lo;default:AdfAssert.assert(AdfPivotTableUtils.Ha,"unexpected keyCode in getNavigationType")}else switch(b){case AdfKeyStroke.ARROWLEFT_KEY:return AdfDhtmlPivotTablePeer.Ko;case AdfKeyStroke.ARROWRIGHT_KEY:return AdfDhtmlPivotTablePeer.Lo;
case AdfKeyStroke.ARROWUP_KEY:return AdfDhtmlPivotTablePeer.Mo;case AdfKeyStroke.ARROWDOWN_KEY:return AdfDhtmlPivotTablePeer.No;default:AdfAssert.assert(AdfPivotTableUtils.Ha,"unexpected keyCode in getNavigationType")}}function A_0h(a,b,c,d,e,f){var g=e<a.b.o[c]?0:1,h=a.b.aa(c,g);a.Ja&&A_rg(a,"postponeHandlingHeaderKeyboardNavigation calling setScrollPos("+c+", "+g+", "+(h+b)+", true)");a.b.setScrollPos(c,g,h+b,A_b);a.Bb();a.lr=A_b;a.AI={Md:c,AL:d,BL:e,$T:A_c,aU:A_c,extend:f,zs:g}}
function A_Vg(a,b,c,d){d?A_Mh(a,b,A_b):A_Qh(a,b);a:{d=b.edge;var e=b.slice,f=A_Xf(a,d,c),g=A_Yf(a,d,c);if(e>=g)e=30;else if(b=A_1h(a,b)?b.extent:1,b=e+b,b<=f)e=-30;else if(e=Math.max(e,f),b=Math.min(b,g),g=A_6h(a,d,c,e),f=g.position,b==e+1?(e=g.size,g=f+e):(g=A_6h(a,d,c,b),g=g.position,e=g-f),b=a.b.Ad[d][c],b=d?b._usableHeight:b._usableWidth,e<=b)if(0>f)e=f;else if(g>b)e=g-b;else break a;else if(g<b)e=g-b;else if(0<f)e=f;else break a;f=a.b.aa(d,c);a.Ja&&A_rg(a,"scrollToHeaderCell calling setScrollPos("+
d+", "+c+", "+(f+e)+", true)");a.b.setScrollPos(d,c,f+e,A_b);a.Bb()}}function A_Sh(a,b){a.getComponent().setProperty(AdfRichPivotTable.Ta,b);a.cz=A_b}function A_Cg(a,b){var c=eval(b);A_7h(a,c);A_Rh(a,c);var d=A_c;A_8h(a.getDomElement())?d=A_0e(a,c):a.nq=A_b;d||A_Sh(a,c)}function A_Eg(a,b){var c=eval(b);A_Rh(a,c);A_Sh(a,c)}
function A_Sg(a,b){var c=eval(b),d=A_of(a,c),e=A_of(a);if(!(d==A_||d!=e)){for(var f=A_Oh(a),e=A_2(a,e,f),c=A_2(a,d,c),d=0;d<e.length;++d){var g=e[d],h=c[d];if(g.startIndex==A_)if(h&&A_9h(h.startKey,g.startKey))g.startIndex=h.startIndex;else for(var l=0;l<c.length;++l){var m=c[l];if(A_9h(m.startKey,g.startKey)){g.startIndex=m.startIndex;break}}else g.startKey==A_&&h&&A_$h(h.startIndex,g.startIndex)&&(g.startKey=h.startKey);g.endIndex!=A_&&g.endKey==A_&&h&&A_$h(h.endIndex,g.endIndex)&&(g.endKey=h.endKey)}A_Rh(a,
f);A_Sh(a,f)}}
function A_7h(a,b){var c=A_of(a,b);switch(c){case AdfPivotTableUtils.D:var d=A_rf(a,b),e=d.startIndex,f=A_Ph(d),g=a.Xb,g=g==A_?A_:g.startIndex,c=a.eg,h=g!=A_&&A_Ef(g)==AdfPivotTableUtils.D&&c!=A_;if(h)var h=e.row,l=f.row,m=e.column,n=f.column,m=g.column==m&&c.column==n||g.column==n&&c.column==m,g=!(g.row==h&&c.row==l||g.row==l&&c.row==h)||!m;else g=A_b;g&&(A_ai(a,e,A_,d.startKey),a.eg=f);break;case AdfPivotTableUtils.l:case AdfPivotTableUtils.n:d=A_rf(a,b);e=d.startIndex;f=A_Ph(d);g=a.Xb;g=g==A_?
A_:g.startIndex;(h=g!=A_&&A_Ef(g)==c)?(h=g.layer==e.layer,f=a.zh?g.slice==e.slice||g.slice==f.slice:A_bi(a,g)&&!a.isSelected(g,b),g=!h||!f):g=A_b;g&&(A_ai(a,e,c,d.startKey),a.zh=A_b);break;case A_:break;default:AdfAssert.assert(AdfPivotTableUtils.Ha,"unexpected selectedEdge in initializeAnchorAndFrontierCells")}}
function A_0e(a,b){var c=A_of(a,b),d=A_c;a.v==A_?c==A_?(c=A_ci(a),A_1(a,c,A_b),d=A_b):c==AdfPivotTableUtils.D?A_Qh(a,a.Xb.startIndex,A_a,A_b,b):A_di(a,b,c):c==A_?A_Ef(a.v)==AdfPivotTableUtils.D?(c=A_ci(a),A_1(a,c,A_b),d=A_b):A_bi(a,a.v)?A_1e(a,A_c,b):(c=A_ci(a),A_1(a,c,A_b),d=A_b):c==AdfPivotTableUtils.D?A_Qh(a,a.Xb.startIndex,A_a,A_b,b):A_Ef(a.v)==AdfPivotTableUtils.D?A_di(a,b,c):A_bi(a,a.v)?A_1e(a,A_c,b):A_di(a,b,c);a.nq=A_c;return d}
function A_di(a,b,c){var d=A_rf(a,b),e=A_Ph(d);a.Xb.startIndex!=A_&&e!=A_&&a.Xb.startIndex.edge==c&&a.Xb.startIndex.layer==e.layer&&a.Xb.startIndex.slice==e.slice?A_Qh(a,d.startIndex,c,A_b,b):A_Qh(a,e,c,A_b,b)}function A_Tg(a,b,c){var d=a.getSelection();A_ei(a,d.columnHeaderCells,AdfPivotTableUtils.n,b,c);A_ei(a,d.rowHeaderCells,AdfPivotTableUtils.l,b,c);A_ei(a,d.dataCells,AdfPivotTableUtils.D,b,c)}
function A_ei(a,b,c,d,e){d=d?AdfDhtmlPivotTablePeer.Xd:AdfDhtmlPivotTablePeer.qd;for(var f=0;f<b.length;++f)A_Nh(a,b[f],c,d,A_c,e)}
function A_Nh(a,b,c,d,e,f,g){var h;if(e)switch(d){case AdfDhtmlPivotTablePeer.Xd:h=A_c;break;case AdfDhtmlPivotTablePeer.qd:h=A_b;break;case AdfDhtmlPivotTablePeer.Bi:case AdfDhtmlPivotTablePeer.Ig:h=A_a;break;default:AdfAssert.assert(AdfPivotTableUtils.Ha,"unexpected highlightType in highlightCellRange")}else h=A_a;var l=c!=AdfPivotTableUtils.D;e=l&&f?[]:A_a;b=l?A_0a(a,b,c,h,e,g):A_Za(a,b,h,f,g);A_fi(a,b,d,c,e)}
function A_fi(a,b,c,d,e){var f,g,h;switch(c){case AdfDhtmlPivotTablePeer.Xd:switch(d){case AdfPivotTableUtils.n:f=a.r(AdfPivotTableUtils.ui);g=a.r(AdfPivotTableUtils.ti);h=a.r(AdfPivotTableUtils.si);break;case AdfPivotTableUtils.l:f=a.r(AdfPivotTableUtils.Mi);g=a.r(AdfPivotTableUtils.Li);h=a.r(AdfPivotTableUtils.Ki);break;case AdfPivotTableUtils.D:f=a.r(AdfPivotTableUtils.Ae);g=a.r(AdfPivotTableUtils.Vd);h=a.r(AdfPivotTableUtils.ze);break;default:AdfAssert.assert(AdfPivotTableUtils.Ha,"unexpected edge in highlightCells")}break;
case AdfDhtmlPivotTablePeer.qd:switch(d){case AdfPivotTableUtils.n:f=a.r(AdfPivotTableUtils.ti);g=a.r(AdfPivotTableUtils.ui);h=a.r(AdfPivotTableUtils.si);break;case AdfPivotTableUtils.l:f=a.r(AdfPivotTableUtils.Li);g=a.r(AdfPivotTableUtils.Mi);h=a.r(AdfPivotTableUtils.Ki);break;case AdfPivotTableUtils.D:f=a.r(AdfPivotTableUtils.Vd);g=a.r(AdfPivotTableUtils.Ae);h=a.r(AdfPivotTableUtils.ze);break;default:AdfAssert.assert(AdfPivotTableUtils.Ha,"unexpected edge in highlightCells")}break;case AdfDhtmlPivotTablePeer.Bi:case AdfDhtmlPivotTablePeer.Ig:switch(d){case AdfPivotTableUtils.n:f=
a.r(AdfPivotTableUtils.si);g=a.r(AdfPivotTableUtils.ui);h=a.r(AdfPivotTableUtils.ti);break;case AdfPivotTableUtils.l:f=a.r(AdfPivotTableUtils.Ki);g=a.r(AdfPivotTableUtils.Mi);h=a.r(AdfPivotTableUtils.Li);break;case AdfPivotTableUtils.D:f=a.r(AdfPivotTableUtils.ze);g=a.r(AdfPivotTableUtils.Ae);h=a.r(AdfPivotTableUtils.Vd);break;default:AdfAssert.assert(AdfPivotTableUtils.Ha,"unexpected edge in highlightCells")}break;default:AdfAssert.assert(AdfPivotTableUtils.Ha,"unexpected highlightType in highlightCells")}var l;
if(d==AdfPivotTableUtils.D)for(var m=0;m<b.length;++m)l=b[m],A_k.S(l,g),A_k.S(l,h),A_$g(l,f),A_gi(l,c,d);else{for(var n=c==AdfDhtmlPivotTablePeer.qd||c==AdfDhtmlPivotTablePeer.Ig,p=e!=A_,m=0;m<b.length;++m){l=b[m];var q="true"==AdfAgent.AGENT.getAttribute(l,"_selected");(p||q^n)&&A_hi(a,d,l,!n,p);A_k.S(l,g);A_k.S(l,h);A_$g(l,f);A_gi(l,c,d);AdfAgent.AGENT.setAttribute(l,"_selected",String(n))}if(p)for(m=0;m<e.length;++m)l=e[m],A_hi(a,d,l,!n,p)}}
function A_gi(a,b,c){var d;if(!(d=a==A_))if(!(d=a.style==A_))if(!(d=a.style.backgroundColor==A_))if(d=""==a.style.backgroundColor)d=a[AdfDhtmlPivotTablePeer.Wn],d==A_&&(d=AdfAgent.AGENT.getAttribute(a,AdfDhtmlPivotTablePeer.Wn)),d=d==A_;if(!d){d=a[AdfDhtmlPivotTablePeer.Ng];d==A_&&(d=AdfAgent.AGENT.getAttribute(a,AdfDhtmlPivotTablePeer.Ng));if(d==A_){d=a.style.backgroundColor;d=d.replace(AdfDhtmlPivotTablePeer.ME,"").toUpperCase();if(0==d.indexOf("RGB"))d="rgb"+d.substring(3);else if(0!=d.indexOf("#")){var e=
AdfDhtmlPivotTablePeer.WD[d];e&&(d=e)}a[AdfDhtmlPivotTablePeer.Ng]=d}if(b==AdfDhtmlPivotTablePeer.Xd)b=d;else{var f=d,g=-1;d=e=-1;7==f.length&&"#"==f.charAt(0)?(g=parseInt(f.substring(1,3),16),e=parseInt(f.substring(3,5),16),d=parseInt(f.substring(5,7),16)):0==f.indexOf("rgb(")&&(f=f.match(AdfDhtmlPivotTablePeer.zD),f!=A_&&2<f.length&&(g=f[0]-0,e=f[1]-0,d=f[2]-0));if(0<=g&&0<=e&&0<=d&&256>g&&256>e&&256>d)if(c==AdfPivotTableUtils.D&&255==g&&255==e&&255==d)b="";else{var h;c==AdfPivotTableUtils.D?b==
AdfDhtmlPivotTablePeer.Bi||b==AdfDhtmlPivotTablePeer.Ig?h=0.9:b==AdfDhtmlPivotTablePeer.qd&&(h=0.8):b==AdfDhtmlPivotTablePeer.Bi||b==AdfDhtmlPivotTablePeer.Ig?h=0.5:b==AdfDhtmlPivotTablePeer.qd&&(h=0.8);0==d&&(0==g&&0==e)&&(g=e=d=200);g=Math.round(g*h);e=Math.round(e*h);d=Math.round(d*h);75>d&&75>g&&75>e?(d+=100*h,g+=100*h):30>g+e&&(g+=100*h);b=g.toString(16).toUpperCase();1==b.length&&(b="0"+b);c=e.toString(16).toUpperCase();1==c.length&&(c="0"+c);h=d.toString(16).toUpperCase();1==h.length&&(h="0"+
h);b="#"+b+c+h}else b=A_}b!=A_&&(a.style.backgroundColor=b,""==b&&(a[AdfDhtmlPivotTablePeer.Wn]="t"))}}
function A_hi(a,b,c,d,e){var f;f=b?c.parentNode.rowIndex-1:AdfAgent.AGENT.getIntAttribute(c,"_iCol",0);var g=A_9f(a,c),g=AdfAgent.AGENT.getIntAttribute(g,"_startSlice");f+=g;for(c=f+(b?c.rowSpan:c.colSpan);f<c;f++){var g=a,h=b,l=f,m=e,n=A_a,p=A_a,q=A_a,v=A_a;d?(n=g.r(AdfPivotTableUtils.Ae),p=g.r(AdfPivotTableUtils.Vd),q=g.r(AdfPivotTableUtils.ze),v=AdfDhtmlPivotTablePeer.Xd):(n=g.r(AdfPivotTableUtils.Vd),p=g.r(AdfPivotTableUtils.Ae),q=g.r(AdfPivotTableUtils.ze),v=AdfDhtmlPivotTablePeer.qd);for(var u=
l<g.b.o[h]?0:1,w=g.b.i[1-h];2>w;++w)for(var r=h?g.b.N[u][w]:g.b.N[w][u],x=r.length,s=0;s<x;s++)for(var z=r[s].length,A=0;A<z;A++){var G=r[s][A];if(G&&(!m||G.vh)){var B=G.childNodes[0],D=B.rows.length-1,y=B.rows[0].cells.length-1,C;h?(G=AdfAgent.AGENT.getIntAttribute(G,"_startRow"),C=D):(G=AdfAgent.AGENT.getIntAttribute(G,"_startCol"),C=y);if(l>=G&&l<G+C)if(G=l-G,h){D=B.rows[G+1];for(G=0;G<y;G++)B=D.cells[G+1],A_k.S(B,p),A_k.S(B,q),A_$g(B,n),A_gi(B,v,AdfPivotTableUtils.D)}else{y=B.rows;for(C=0;C<D;C++)B=
y[C+1].cells[G+1],A_k.S(B,p),A_k.S(B,q),A_$g(B,n),A_gi(B,v,AdfPivotTableUtils.D)}}}}}function A_1e(a,b,c){if(b||A_8h(a.getDomElement())){var d=a.v;if(d!=A_){if(A_5f(d))var e=A__a(d),e=A_0a(a,e,d.edge),f=d.edge;else e=A_n(d),e=A_Za(a,e),f=AdfPivotTableUtils.D;highlightType=b?a.isSelected(d,c)?AdfDhtmlPivotTablePeer.qd:AdfDhtmlPivotTablePeer.Xd:a.isSelected(d,c)?AdfDhtmlPivotTablePeer.Ig:AdfDhtmlPivotTablePeer.Bi;A_fi(a,e,highlightType,f)}}}
function A_cf(a,b){A_Tg(a,A_b);var c=A_5h(),d=A__a(b);A_2(a,b.edge,c).push(d);A_ai(a,b);a.zh=A_b;A_Qh(a,b,A_,A_c,c);A_Rh(a,c);A_Sh(a,c)}
function A_Mh(a,b,c){var d=A_b,e=A_b,f=a.Xb;if(f==A_)e=d=A_c;else{var g=f.startIndex,h=A_Ef(g);if(h!=b.edge||g.layer!=b.layer)e=d=A_c}if(d){var l=A__a(g,b,f.startKey,A_,A_b),f=A_2(a,h),m;0<f.length&&a.zh&&(m=f[f.length-1],f=m.endIndex?l.endIndex&&m.endIndex.slice==l.endIndex.slice:l.endIndex==A_,m.startIndex.slice==l.startIndex.slice&&f&&(e=A_c))}if(e){var n=A_Oh(a),f=A_2(a,h,n);m&&(m=f.pop());f.push(l);a.zh=A_b;m&&A_Nh(a,m,h,AdfDhtmlPivotTablePeer.Xd,A_b,A_a,n);A_Nh(a,l,h,AdfDhtmlPivotTablePeer.qd,
A_c,A_a,n)}c===A_b||c===AdfPivotTableUtils.rl&&d?A_Qh(a,b,A_,A_c,n):e&&A_1e(a,A_c,n);e&&(A_Rh(a,n),A_Sh(a,n));return d}
function A_Uh(a,b){var c=a.Xb;if(c!=A_){var d=c.startIndex;if(A_Ef(d)==AdfPivotTableUtils.D){var c=A_n(d,b,c.startKey,A_,A_b),e=A_2(a,AdfPivotTableUtils.D),d=e[e.length-1],e=d.endIndex?c.endIndex&&d.endIndex.row==c.endIndex.row&&d.endIndex.zr==c.endIndex.zr:c.endIndex==A_;if(!(d.startIndex.row==c.startIndex.row&&d.startIndex.zr==c.startIndex.zr)||!e){var f=A_Oh(a),e=A_2(a,AdfPivotTableUtils.D,f),d=e.pop();e.push(c);A_Nh(a,d,AdfPivotTableUtils.D,AdfDhtmlPivotTablePeer.Xd,A_b,A_a,f);A_Nh(a,c,AdfPivotTableUtils.D,
AdfDhtmlPivotTablePeer.qd,A_c,A_a,f);A_1e(a,A_c,f);a.eg=b;A_Rh(a,f);A_Sh(a,f)}}}}
function A_Lh(a,b,c){var d=b.edge,e=A_of(a),e=e==A_||e==d&&A_Mf(a)==b.layer;c?(c=A_b,e=!e):(c=e,e=A_c);if(c){e?(A_Tg(a,A_b),c=A_5h()):c=A_Oh(a);A_ai(a,b);for(var e=b.edge,f=b.layer,g=b.slice,h=A_2(a,e,c),l=A_c,m=h.length-1;0<=m;--m){var n=h[m];if(A_Kh(n)){var p=n.startIndex;if(p.layer==f&&!(p.slice>g)){var q=n.endIndex;q==A_&&(q=p);if(!(q.slice<g))if(l=A_b,q=n.endIndex,q==A_)h.splice(m,1);else if(p.slice==g){A_1h(a,b);var v=A_ii(a,e,f,g+b.extent,A_b);if(v==A_)break;h[m]=A__a(v,q,A_,n.endKey)}else if(q.slice==
g){var u=A_ii(a,e,f,g-1,A_c);if(u==A_)break;h[m]=A__a(p,u,n.startKey,A_)}else{u=A_ii(a,e,f,g-1,A_c);if(u==A_)break;A_1h(a,b);v=A_ii(a,e,f,g+b.extent,A_b);if(v==A_)break;h[m]=A__a(p,u,n.startKey,A_);n=A__a(v,q,A_,n.endKey);h.splice(m+1,0,n)}}}}(e=l)?a.zh=A_c:(f=A__a(b),A_2(a,d,c).push(f),a.zh=A_b);A_Qh(a,b,A_,A_c,c);A_Rh(a,c);A_Sh(a,c);return!e}return A_c}function A_ii(a,b,c,d,e){for(;;){var f=A_Ug(a,b,c,d);if(f==A_)break;else if(f.layer==c)break;else d=e?d+f.extent:f.slice-1}return f}
function A_Th(a,b,c){var d=a.getSelection(),d=0==d.columnHeaderCells.length&&0==d.rowHeaderCells.length;c?(c=A_b,d=!d):(c=d,d=A_c);c&&(d?(A_Tg(a,A_b),d=A_5h()):d=A_Oh(a),c=A_n(b),d.dataCells.push(c),A_Qh(a,b,A_,A_c,d),a.Xb=A_n(b),a.eg=b,A_Rh(a,d),A_Sh(a,d))}function A_1(a,b,c){A_Tg(a,A_b);var d=A_5h(),e=A_n(b);A_2(a,AdfPivotTableUtils.D,d).push(e);a.Xb=A_n(b);a.eg=b;A_Qh(a,b,A_a,c,d);A_Rh(a,d);A_Sh(a,d)}
function A_Qh(a,b,c,d,e){!d&&a.v!=A_&&A_1e(a,A_b,e);A_5f(b)&&b.edge==A_&&(b.edge=c);a.v=b;A_1e(a,A_c,e);A_bh(a,b)}
function A_bh(a,b,c,d){var e={startIndex:b},f="";if(A_5f(b)){edge=b.edge;c=c||A_0a(a,e,edge)[0];if(!c)return;var e=b.layer+1,g=b.slice,f=f+A_ji(a,e,g);b=c.getAttribute("id")}else{c=c||A_Za(a,e)[0];if(!c)return;for(edge=1;0<=edge;--edge)e=a.b.dH[edge],g=edge?b.row:b.column,f+=A_ji(a,e,g);b=c.getAttribute("id");f+=b}AdfAgent.AGENT.setAttribute(c,"aria-labelledby",f);AdfAgent.AGENT.setAttribute(a.b.ac,"aria-activedescendant",b);d=d||A_tf(a,c);for(a=0;a<d.length;++a)AdfAgent.AGENT.setAttribute(d[a],"aria-labelledby",
f)}function A_ji(a,b,c){for(var d=edge,e="",f=0;f<b;){var g=A_Ug(a,d,f,c,A_b);if(g==A_)return"";e+=g.cell.getAttribute("id");e+=" ";f+=g.depth}return e}function A_ai(a,b,c,d){var e=A_5f(b);e&&b.edge==A_&&(b.edge=c);a.Xb=e?A__a(b,A_,d,A_):A_n(b,A_,d,A_,A_c)}function A_Rh(a,b){var c=A_ki(a,b);if(a.b.tq){var d=a.b.gr.childNodes,e=d[0],d=d[1],f=c[0],c=c[1];""==f&&(f="\u00a0");""==c&&(c="\u00a0");AdfAgent.AGENT.setTextContent(e,f);AdfAgent.AGENT.setTextContent(d,c)}}
function A_ki(a,b){if(!a.b.tq)return"";var c=A_of(a,b);switch(c){case A_:return["",""];case AdfPivotTableUtils.D:c=A_2(a,c,b);a:if(2<c.length)c=-1;else{for(var d=0,e=0;e<c.length;++e){var f;var g=c[e];A_Kh(g)?(f=g.startIndex,g=A_Ph(g),f=(g.row-f.row+1)*(g.column-f.column+1)):f=1;d+=f}if(2==c.length){if(-1==A_li(c[0],c[1])){c=-1;break a}d-=A_li(c[0],c[1])}c=d}return-1==c?[a.Cv,a.Lq]:[a.Cv,c];case AdfPivotTableUtils.n:return c=A_2(a,c,b),c=A_mi(c),-1==c?[a.Iv,a.Lq]:[a.Iv,c];case AdfPivotTableUtils.l:return c=
A_2(a,c,b),c=A_mi(c),-1==c?[a.mx,a.Lq]:[a.mx,c];default:AdfAssert.assert(AdfPivotTableUtils.Ha,"unexpected edge in getSelectionStringsForStatusBar")}}
function A_0f(a,b){var c=A_ni(a,AdfPivotTableUtils.n,b.column),d=A_ni(a,AdfPivotTableUtils.l,b.row),e=b.row<a.b.o[1]?0:1,f=b.column<a.b.o[0]?0:1;if(0!=c){var g=a.b.aa(AdfPivotTableUtils.n,f);a.Ja&&A_rg(a,"scrollToDataCell calling setScrollPos(0, "+f+", "+(g+c)+", true)");a.b.setScrollPos(AdfPivotTableUtils.n,f,g+c,A_b)}0!=d&&(f=a.b.aa(AdfPivotTableUtils.l,e),a.Ja&&A_rg(a,"scrollToDataCell calling setScrollPos(1, "+e+", "+(f+d)+", true)"),a.b.setScrollPos(AdfPivotTableUtils.l,e,f+d,A_b));a.b.uq=A_oi(a,
AdfPivotTableUtils.n,b.column);a.b.pr=A_oi(a,AdfPivotTableUtils.l,b.row);(0!=c||0!=d)&&a.Bb()}function A_5h(){return{columnHeaderCells:[],rowHeaderCells:[],dataCells:[]}}function A_Oh(a){return a.Er(a.getSelection())}function A__a(a,b,c,d,e){b!=A_&&a.slice==b.slice&&(b=A_);b==A_&&(c==A_&&d!=A_&&(c=d),endkey=A_);e&&(b&&b.slice<a.slice)&&(e=a,a=b,b=e,e=c,c=d,d=e);return{startKey:c,endKey:d,startIndex:a,endIndex:b}}function A_pi(a,b,c,d){return{edge:a,layer:b,slice:c,extent:d}}
function A_n(a,b,c,d,e){b!=A_&&(a!=A_&&b!=A_&&a.row==b.row&&a.column==b.column)&&(b=A_);b==A_&&(c==A_&&d!=A_&&(c=d),endkey=A_);if(e&&b){var f,g,h,l,m;a.row<b.row?(e=a.row,h=c==A_?A_:c.P,f=b.row,l=d==A_?A_:d.P):(e=b.row,h=d==A_?A_:d.P,f=a.row,l=c==A_?A_:c.P);a.column<b.column?(g=a.column,m=c==A_?A_:c.lk,b=b.column,d=d==A_?A_:d.lk):(g=b.column,m=d==A_?A_:d.lk,b=a.column,d=c==A_?A_:c.lk);a=A_m(e,g);b=A_m(f,b);c=h&&m?{rowKey:h,columnKey:m}:A_;d=l&&d?{rowKey:l,columnKey:d}:A_}return{startKey:c,endKey:d,
startIndex:a,endIndex:b}}function A_m(a,b){return{row:a,column:b}}function A_bf(a){var b=A_wf(a),c=Number(b.edge);return A_pi(c,Number(b.startLayer),Number(b.startSlice),A_qi(c,a,b))}function A_wf(a){a=AdfAgent.AGENT.getAttribute(a,"_coords");if(a!=A_a)return a=a.split(":"),4==a.length?{edge:a[0],startLayer:a[1],startSlice:a[2],extent:a[3]}:{edge:a[0],startLayer:a[1],startSlice:a[2],extent:A_}}function A_df(a,b){var c=A_Af(a,b);return A_m(c.row,c.col)}
function A_8e(a){return a.Ma!=AdfDhtmlPivotTablePeer.va}A_g.getSelection=function(){var a=this.getComponent().getProperty(AdfRichPivotTable.Ta);a==A_&&(a=A_5h(),A_Sh(this,a));return a};function A_5f(a){return a.row==A_}function A_9h(a,b){return a==A_||b==A_?A_c:a.P==A_?b.P==A_?A_ri(a,b):A_c:b.P==A_?A_c:a==A_||b==A_?A_c:A_ri(a.P,b.P)&&A_ri(a.lk,b.lk)}function A_ri(a,b){if(a==A_||b==A_||a.length!=b.length)return A_c;for(var c=0;c<a.length;++c)if(a[c]!=b[c])return A_c;return A_b}
function A_$h(a,b){return a==A_||b==A_?A_c:a.layer==b.layer&&a.slice==b.slice&&a.row==b.row&&a.column==b.column}function A_Ph(a){return a.endIndex==A_?a.startIndex:a.endIndex}function A_Ef(a){a=a.edge;a===A_a&&(a=AdfPivotTableUtils.D);return a}function A_bi(a,b){var c=b.edge==A_a?A_a:b.edge,d=b.layer,e=b.slice,f=c?a.b.Db:a.b.Hb;if(0>d||d>=f)return A_c;c=A_Ug(a,c,d,e);return c!=A_&&c.layer==d&&c.slice==e}
function A_li(a,b){if(!A_Kh(a)||!A_Kh(b))return-1;var c=a.startIndex,d=A_Ph(a),e=b.startIndex,f=A_Ph(b),g=Math.max(c.row,e.row),c=Math.max(c.column,e.column),e=Math.min(d.row,f.row),d=Math.min(d.column,f.column),g=Math.max(0,e-g+1),d=Math.max(0,d-c+1);return g*d}
function A_mi(a){if(2<a.length)return-1;for(var b=0,c=0;c<a.length;++c){var d;d=a[c];if(A_Kh(d)){var e=A_Ph(d);d=e.slice+e.extent-d.startIndex.slice}else d=-1;if(-1==d)return-1;b+=d}if(2==a.length){c=a[0];a=a[1];!A_Kh(c)||!A_Kh(a)?c=-1:(d=A_Ph(c),e=A_Ph(a),d=d.slice+d.extent,e=e.slice+e.extent,c=Math.max(c.startIndex.slice,a.startIndex.slice),a=Math.min(d,e),c=Math.max(0,a-c));if(-1==c)return-1;b-=c}return b}
A_g.isSelected=function(a,b){if(A_5f(a))for(var c=a.layer,d=a.slice,e=A_2(this,a.edge,b),f=0;f<e.length;++f){var g=e[f];if(A_Kh(g)){var h=g.startIndex;if(h.layer==c&&!(h.slice>d)&&(g=A_Ph(g),!(g.slice<d)))return A_b}}else{c=a.row;d=a.column;e=A_2(this,AdfPivotTableUtils.D,b);for(f=0;f<e.length;++f)if(g=e[f],A_Kh(g)&&(h=g.startIndex,!(h.row>c||h.column>d)))if(g=A_Ph(g),!(g.row<c||g.column<d))return A_b}return A_c};
function A_ef(a,b,c,d){if(c==A_a)return(c=A_ef(a,b,AdfPivotTableUtils.n,d))?A_b:(a=A_ef(a,b,AdfPivotTableUtils.l,d))?A_b:c==A_c&&a==A_c?A_c:A_;b=c?b.row:b.column;for(var e=A_2(a,c),f=A_c,g=-42,h=0;h<e.length;++h){var l=e[h];if(A_Kh(l)){var m=l.startIndex;if(!(m.slice>b)){var n=A_Ph(l);if(!(n.slice+n.extent-1<b)){if(!(l.endIndex==A_&&l.endKey==A_))if(l=m.layer,-42==g&&(g=A_Ug(a,c,l,b),g=g!=A_?g.layer:A_),g==A_){f=A_;continue}else if(g!=l)continue;return A_b}}}else d||(f=A_)}return f}
function A_0a(a,b,c,d,e,f){for(var g=[],h=a.b.i[c];2>h;++h)a:{var l=a,m=c,n=e,p=g,q=f,v=A_a;if(A_Kh(b)){var u=d===A_b,w=d===A_c,r=!u&&!w,x=b.startIndex,s=x.layer,x=x.slice,z=A_Ph(b).slice,A=l.b.T[m][h],G=A_c;if(m==AdfPivotTableUtils.n)for(var B=0,D=A.length;B<D;++B){var y=A[B];if(!G){var v=AdfAgent.AGENT.getIntAttribute(y,"_startSlice"),C=AdfAgent.AGENT.getIntAttribute(y,"_numSlices"),v=v+C;if(v<=x)continue}for(var v=n!=A_&&!y.vh?n:p,H=y.firstChild.firstChild.rows,F=H[s+1],H=F.cells,y=1,C=H.length;y<
C;++y){var t=H[y],F=A_wf(t),E=Number(F.startSlice);if(z<E)break a;if(x<=E&&(r||u&&l.isSelected(A_pi(m,s,E,0),q)||w&&!l.isSelected(A_pi(m,s,E,0),q)))v.push(t),G=A_b}}else{B=0;for(D=A.length;B<D;++B){y=A[B];if(!G&&(v=AdfAgent.AGENT.getIntAttribute(y,"_startSlice"),C=AdfAgent.AGENT.getIntAttribute(y,"_numSlices"),v+=C,v<=x))continue;v=n!=A_&&!y.vh?n:p;H=y.firstChild.firstChild.rows;y=1;for(C=H.length;y<C;){F=H[y];b:{t=s;F=F.cells;for(E=F.length-1;1<=E;--E){cell=F[E];var K=A_wf(cell);if(Number(K.startLayer)<=
t){t=cell;break b}}t=A_a}if(!t)break a;F=A_wf(t);E=Number(F.startSlice);if(z<E)break a;if(x<=E&&s==Number(F.startLayer)&&(r||u&&l.isSelected(A_pi(m,s,E,0),q)||w&&!l.isSelected(A_pi(m,s,E,0),q)))v.push(t),G=A_b;y+=t.rowSpan}}}}}return g}
function A_Za(a,b,c,d,e){for(var f=[],g=a.b.i[1];2>g;++g)for(var h=a.b.i[0];2>h;++h){var l=a,m=f,n=g,p=h,q=e;if(A_Kh(b)){var v=c===A_b,u=c===A_c,w=!v&&!u,r=d===A_b,x=d===A_c,s=b.startIndex,z=s.row,s=s.column,A=A_Ph(b),G=A.row+1,A=A.column+1,B=l.b.na[p],D=AdfAgent.AGENT.getIntAttribute(B[0],"_startSlice");if(!(A<=D)){var y=B[B.length-1],D=AdfAgent.AGENT.getIntAttribute(y,"_startSlice"),y=AdfAgent.AGENT.getIntAttribute(y,"_numSlices");if(!(D+y<=s)){for(var D=0,y=B.length,C=0,H=B.length;C<H;++C){var F=
B[C],t=AdfAgent.AGENT.getIntAttribute(F,"_startSlice"),E=AdfAgent.AGENT.getIntAttribute(F,"_numSlices"),K=t+E;t<=s&&s<K&&(D=C);if(t<A&&A<=K){y=C+1;break}}H=l.b.Ga[n];n=l.b.N[n][p];p=0;for(K=H.length;p<K;++p){var C=H[p],I=AdfAgent.AGENT.getIntAttribute(C,"_startSlice"),C=AdfAgent.AGENT.getIntAttribute(C,"_numSlices");if(!(I+C<=z)){if(G<=I)break;for(var J=Math.max(1,z-I+1),L=Math.min(C+1,G-I+1),R=n[p],C=D;C<y;++C){var F=B[C],t=AdfAgent.AGENT.getIntAttribute(F,"_startSlice"),E=AdfAgent.AGENT.getIntAttribute(F,
"_numSlices"),F=Math.max(1,s-t+1),E=Math.min(E+1,A-t+1),N=R[C];if(!(r&&!N.vh||x&&N.vh))for(var N=N.firstChild.firstChild.rows,O=J;O<L;++O)for(var Ga=N[O].cells,ia=F;ia<E;++ia)(w||v&&l.isSelected(A_m(I+O-1,t+ia-1),q)||u&&!l.isSelected(A_m(I+O-1,t+ia-1),q))&&m.push(Ga[ia])}}}}}}}return f}function A_Kh(a){return a.startIndex!=A_}function A_1h(a,b){if(b.depth!=A_)return A_b;var c=A_Ug(a,b.edge,b.layer,b.slice);if(c==A_)return A_c;b.depth=c.depth;b.extent=c.extent;return A_b}
function A_Ug(a,b,c,d,e){var f=a.b.T[b],g=a.b.i[b],h=f[g],l=h[0],m=AdfAgent.AGENT.getIntAttribute(l,"_startSlice");if(d<m)return a=A_si(l,b,c,0,e),a.slice<=d?a:A_;var l=f[1],m=l[l.length-1],n=AdfAgent.AGENT.getIntAttribute(m,"_startSlice"),p=AdfAgent.AGENT.getIntAttribute(m,"_numSlices");if(n+p<=d)return a=A_si(m,b,c,p-1,e),d<a.slice+a.extent?a:A_;if(0==g&&(l=l[0],m=AdfAgent.AGENT.getIntAttribute(l,"_startSlice"),d<m&&(m=h[h.length-1],n=AdfAgent.AGENT.getIntAttribute(m,"_startSlice"),p=AdfAgent.AGENT.getIntAttribute(m,
"_numSlices"),n+p<=d))){a=A_si(l,b,c,0,e);if(a.slice<=d)return a;a=A_si(m,b,c,p-1,e);return d<a.slice+a.extent?a:A_}g=d<a.b.o[b]?0:1;f=f[g];a=A_sf(a,b,d,g);a=f[a];f=AdfAgent.AGENT.getIntAttribute(a,"_startSlice");return A_si(a,b,c,d-f,e)}
function A_si(a,b,c,d,e){b==AdfPivotTableUtils.n?(c=A_ti(a,c,d),a=c.cell,c=a.parentNode.rowIndex-1,d=a.rowSpan):(c=A_ti(a,d,c),a=c.cell,c=c.startColumn,d=a.colSpan);var f=A_wf(a),g=Number(f.startSlice),f=A_qi(b,a,f);return e?{edge:b,layer:c,slice:g,depth:d,extent:f,cell:a}:{edge:b,layer:c,slice:g,depth:d,extent:f}}
function A_ti(a,b,c){var d;c+=1;var e=0;a=a.firstChild.firstChild.rows;for(var f=[],g=0;g<=b;++g)f[g]=0;for(g=0;g<=b;++g){for(var h=a[g+1].cells,l=0;f[g]<c;++l){d=h[l+1];for(var m=d.rowSpan,n=Math.min(d.colSpan,c-f[g]),p=g,q=Math.min(g+m,b+1);p<q;++p)f[p]+=n}if(g==e){if(g+m>b)return{cell:d,startColumn:c-n};e=g+m}}return d}function A_qi(a,b,c){return c.extent!=A_?Number(c.extent):a?b.rowSpan:b.colSpan}function A_Mf(a){var b=A_of(a);return b==A_||b==AdfPivotTableUtils.D?-1:a.Xb.startIndex.layer}
function A_2(a,b,c){c==A_a&&(c=a.getSelection());switch(b){case AdfPivotTableUtils.n:return c.columnHeaderCells;case AdfPivotTableUtils.l:return c.rowHeaderCells;case AdfPivotTableUtils.D:return c.dataCells;default:AdfAssert.assert(AdfPivotTableUtils.Ha,"unexpected edge in getSelectionForEdge")}}function A_of(a,b){b==A_a&&(b=a.getSelection());return 0<b.columnHeaderCells.length?AdfPivotTableUtils.n:0<b.rowHeaderCells.length?AdfPivotTableUtils.l:0<b.dataCells.length?AdfPivotTableUtils.D:A_}
function A_rf(a,b){var c=A_of(a,b);if(c==A_)return A_;c=A_2(a,c,b);return c[c.length-1]}function A_oi(a,b,c){var d=c<a.b.o[b]?0:1,e=A_Xf(a,b,d);a=A_Yf(a,b,d);return c>=a||c<e}function A_ui(a,b){if(a.b.Bv==A_||a.b.Av==A_){var c=a.getComponent().getProperty(AdfRichPivotTable.Sl),d=a.getComponent().getProperty(AdfRichPivotTable.Rl),c=A_Ff(a,A_m(c,d));a.b.Bv=c.offsetWidth;a.b.Av=c.offsetHeight}return b==AdfPivotTableUtils.l?Math.max(17,a.b.Av):b==AdfPivotTableUtils.n?Math.max(1,a.b.Bv):30}
function A_ni(a,b,c){var d=c<a.b.o[b]?0:1,e=A_Xf(a,b,d),f=A_Yf(a,b,d);if(c>=f)return A_ui(a,b);if(c<e)return 0-A_ui(a,b);e=A_6h(a,b,d,c);c=e.position;e=e.size;f=c+e;a=a.b.Ad[b][d];b=b?a._usableHeight:a._usableWidth;return e<=b?0>c?c:f>b?f-b:0:f<b?f-b:0<c?c:0}
function A_6h(a,b,c,d){c=a.b.T[b][c];var e=c[c.length-1],f=AdfAgent.AGENT.getIntAttribute(e,"_startSlice"),g=AdfAgent.AGENT.getIntAttribute(e,"_numSlices");if(d==f+g)return b==AdfPivotTableUtils.l?{position:e._top+e._height,size:A_}:{position:e._horizPos+e._width,size:A_};e=A_sf(a,b,d);if(-1==e)return A_;f=c[e];e=f.firstChild.rows;c=f[a.b.$f[b]];e=b?e:e[0].cells;a=a.b.Nk[b];f=AdfAgent.AGENT.getIntAttribute(f,"_startSlice");d=d-f+1;b=b==AdfPivotTableUtils.l&&AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM;
for(f=1;f<d;++f)c+=b?e[f].firstChild[a]:e[f][a];return{position:c,size:b?e[d].firstChild[a]:e[d][a]}}function A_sf(a,b,c,d){d===A_a&&(d=c<a.b.o[b]?0:1);a=a.b.T[b][d];b=0;for(d=a.length;b<d;++b){var e=a[b],f=AdfAgent.AGENT.getIntAttribute(e,"_startSlice"),e=AdfAgent.AGENT.getIntAttribute(e,"_numSlices");if(f<=c&&c<f+e)return b}return-1}function A_ci(a){return A_df(a,a.b.N[a.b.i[1]][a.b.i[0]][0][0].firstChild.rows[1].cells[1])}
function A_Xf(a,b,c){return AdfAgent.AGENT.getIntAttribute(a.b.T[b][c][0],"_startSlice")}function A_Yf(a,b,c){a=a.b.T[b][c];b=a[a.length-1];a=AdfAgent.AGENT.getIntAttribute(b,"_startSlice");b=AdfAgent.AGENT.getIntAttribute(b,"_numSlices");return a+b}function A_3h(a,b,c){return A_Yg(a.b,b,c,0).slice}function A_4h(a,b,c){return A_Zg(a.b,b,c).slice}function A__h(a,b,c){var d=c<a.b.o[b]?0:1,e=A_3h(a,b,d);if(c<e)return e;a=A_4h(a,b,d);return a<c?a:c}
function A_Zh(a,b,c){if(0>c)return 0;a=(b?a.b.Db:a.b.Hb)-1;return a<c?a:c}function A_Yh(a,b){var c=b.edge,d=b.layer;if((c?a.b.Db:a.b.Hb)-1<d)return A_c;var e=b.slice;if(A_4h(a,c,1)<e||A_1h(a,b)==A_c||0>=d+b.depth)return A_c;var f=a.b.i[c],d=e+b.extent,g=A_3h(a,c,f);return d<=g||0==f&&(f=A_4h(a,c,0),c=A_3h(a,c,1),f<e&&d<=c)?A_c:A_b}function A_8h(a){for(var b=AdfPage.PAGE.getActiveDomElement();b!=A_;){if(b==a)return A_b;b=b.parentNode}return A_c}
function A_ff(a){a=A_2(a,AdfPivotTableUtils.D);return 1<a.length||1==a.length&&!(a[0].endIndex==A_&&a[0].endKey==A_)?A_b:A_c}function A_ig(a,b){var c=AdfAgent.AGENT.getAttribute(a,b?"_row_header_cursor":"_col_header_cursor");return AdfAgent.AGENT.getPlatform()==AdfAgent.WEBKIT_PLATFORM?"url("+c+") 15 16,default":"url("+c+"),default"}
function A_hg(a,b,c){if(0==a.mv[0]||0==a.mv[1])c=A_5h(),a.gh=-1;else{for(var d=0;d<c.length;++d){var e=c[d];if(e.id&&-1!=e.id.indexOf(AdfDhtmlPivotTablePeer.tu)){var f=e.getAttribute("_selection");break}}c=eval(f);a.gh=A_vi(a,c);a.tG||(A_wi(a,b),a.Tp=A_b,A_xi(a,AdfDhtmlPivotTablePeer.eD,a.NK),A_xi(a,AdfDhtmlPivotTablePeer.gD,a.PK))}A_Sh(a,c)}
function A_xi(a,b,c){b=AdfRichUIPeer.CreateSubId(a.getComponent().getClientId(),b);b=document.getElementById(b);a=a.createCallback(c);AdfAgent.getAgent().addBubbleEventListener(b,"click",a)}function A_wi(a,b){for(var c=AdfAgent.getAgent(),d=a.createCallback(a.OK),e=b.getElementsByTagName("input"),f=[],g=0;g<e.length;++g){var h=e[g];h.id&&-1!=h.id.indexOf(AdfDhtmlPivotTablePeer.fD)&&(f.push(h),c.addBubbleEventListener(h,"click",d))}a.nv=f}
A_g.OK=function(a){a=AdfAgent.getAgent().getEventTarget(a);var b;var c=a.id.split("::"),d=c.length;b=Number(c[d-3]);var e=Number(c[d-2]),c=Number(c[d-1]);if(b==AdfPivotTableUtils.D)b=A_m(e,c);else{var d=a.parentNode.parentNode,f=A_wf(d);b=A_pi(b,e,c,A_qi(b,d,f))}if(a.checked)e=b,d=A_of(this),b=A_Ef(e),c=A_c,d==A_?a=A_c:d!=b||d!=AdfPivotTableUtils.D&&this.gh!=e.layer?(A_yi(this,a),a=A_c,c=A_b):a=this.isSelected(e),a||(b==AdfPivotTableUtils.D?(a=A_n(e),this.gh=-1):(a=A__a(e),this.gh=e.layer),e=c?A_5h():
A_Oh(this),A_2(this,b,e).push(a),A_Sh(this,e));else{a=b;e=A_Ef(a);b=A_Oh(this);e=A_2(this,e,b);for(c=e.length-1;0<=c;--c)if(A_$h(a,e[c].startIndex)){e.splice(c,1);0==e.length&&(this.gh=-1);break}A_Sh(this,b)}};A_g.NK=function(){A_yi(this);this.gh=-1;A_Sh(this,A_5h())};
A_g.PK=function(a){var b=AdfAgent.getAgent().getEventTarget(a),c;this.Tp?(c=b.getAttribute("_showText"),a="none"):(c=b.getAttribute("_hideText"),a="");b.firstChild.data=c;b=this.nv;for(c=0;c<b.length;++c)b[c].style.display=a;this.Tp=!this.Tp};function A_yi(a,b){for(var c=a.nv,d=0;d<c.length;++d){var e=c[d];e!=b&&e.checked&&(e.checked=A_c)}}function A_vi(a,b){var c=A_rf(a,b);if(c==A_)return-1;c=c.startIndex.layer;return c==A_?-1:c};