function AdfDhtmlShadowDecorator(){this.Init()}AdfObject.createSubclass(AdfDhtmlShadowDecorator);AdfDhtmlShadowDecorator.prototype.Init=function(){AdfDhtmlShadowDecorator.superclass.Init.call(this)};AdfDhtmlShadowDecorator.getShadowSize=function(){var a=AdfDhtmlShadowDecorator._SHADOW_PIXEL_SIZE;null==a&&(a=AdfPage.PAGE.getLookAndFeel(),a=parseInt(a.getSkinProperty("af|popup-tr-shadow-pixel-size")),a=isNaN(a)?0:a,AdfDhtmlShadowDecorator._SHADOW_PIXEL_SIZE=a);return a};
AdfDhtmlShadowDecorator.prototype._create=function(a,b,d,e,f,g){null==d&&(d=3);this._shadowOffsetTop=d;null==e&&(e=3);this._shadowOffsetLeft=e;null==g&&(g=100);this._isRelative=f;var h=AdfDhtmlShadowDecorator.getShadowSize(),k=2*h,l=AdfPage.PAGE,m=AdfAgent.AGENT;this._maskFrame||(this._maskFrame=l.createMaskingFrame(a));if(!AdfDhtmlShadowDecorator._usesNativeShadows(a)&&!this._shadeElements){var n=m.getComputedStyle(a);this._shadeElements=Array(k);if(void 0==n.zIndex||2>=AdfAgent.getCSSLengthAsInt(n.zIndex))a.style.zIndex=
3;var q=a.ownerDocument,l=l.getLocaleContext().isRightToLeft(),r=f?{x:0,y:0}:m.getElementPosition(a);f=r.y+d;var t;t=l?r.x-(e+h):r.x+e;var u=a.offsetWidth,v=a.offsetHeight;b=b?b:q.body;this._anchorBox={x:r.x,y:r.y,offsetWidth:u,offsetHeight:v};a=q.createElement("div");AdfDomUtils.addCSSClassName(a,AdfDhtmlShadowDecorator._SHADOW_STYLE_CLASS);r=a.style;r.zIndex=AdfAgent.getCSSLengthAsInt(n.zIndex)-1;r.position="absolute";r.left=t+"px";r.top=f+"px";r.width=u+h+"px";r.height=v+h+"px";f=0;t=l?h+e:0;e=
u-e+"px";d=v-d+"px";for(h=0;h<k;h++)n=q.createElement("div"),r=n.style,r.position="absolute",r.left=t+"px",r.top=f+"px",0==h%2?l?t--:t++:f++,r.width=e,r.height=d,r.backgroundColor="#000000",m.setOpacity(n,Math.floor(g/(2*h+4))),a.appendChild(n),this._shadeElements[h]=n;b.appendChild(a);this._shadeContainer=a}};
AdfDhtmlShadowDecorator.prototype._move=function(a){var b=AdfAgent.AGENT,d=AdfPage.PAGE,e=this._maskFrame;e&&d.moveMaskingFrame(a,e);if(this._shadeElements){var f=this._anchorBox,e=a.offsetWidth,d=a.offsetHeight,g=this._isRelative?{x:0,y:0}:b.getElementPosition(a);if(f.x!=g.x||f.y!=g.y||f.offsetWidth!=e||f.offsetHeight!=d){this._anchorBox={x:g.x,y:g.y,offsetWidth:e,offsetHeight:d};var b=b.getComputedStyle(a).zIndex-1,f=this._shadowOffsetTop,h=this._shadowOffsetLeft,k=AdfPage.PAGE.getLocaleContext().isRightToLeft();
a=this._shadeContainer.style;a.zIndex=b;var l=AdfDhtmlShadowDecorator.getShadowSize(),b=2*l;a.left=(k?g.x-(h+l):g.x+h)+"px";a.top=g.y+f+"px";a.width=e+l+"px";a.height=d+l+"px";AdfAssert.assert(0<e-h,"Computed shadow width is less than one");AdfAssert.assert(0<d-f,"Computed shadow height is less than one");e=e-h+"px";d=d-f+"px";for(g=0;g<b;g++)a=this._shadeElements[g].style,a.width=e,a.height=d}}};
AdfDhtmlShadowDecorator.prototype._show=function(a,b){this._maskFrame&&(this._maskFrame.style.visibility=b?"visible":"hidden");this._shadeElements&&(this._shadeContainer.style.display=b?"block":"none")};AdfDhtmlShadowDecorator.prototype._remove=function(a){if(a=this._maskFrame)AdfPage.PAGE.removeMaskingFrame(a),delete this._maskFrame;this._shadeElements&&(this._shadeContainer.parentNode.removeChild(this._shadeContainer),delete this._shadeElements,delete this._shadeContainer)};
AdfDhtmlShadowDecorator.createShadowDecorator=function(a,b,d){var e=AdfDhtmlShadowDecorator._getShadowDecorator(a);if(!e){var e=new AdfDhtmlShadowDecorator,f=AdfDhtmlShadowDecorator._getShadowOffset(),g=AdfDhtmlShadowDecorator._getShadowStartingBlackPercent();e._create(a,b,f,f,d,g);AdfDhtmlShadowDecorator._uniqueIdCounter||(AdfDhtmlShadowDecorator._uniqueIdCounter=0);b="sd$"+ ++AdfDhtmlShadowDecorator._uniqueIdCounter;d=AdfDhtmlShadowDecorator._shadowDecorators;d||(d=AdfDhtmlShadowDecorator._shadowDecorators=
{});d[b]=e;a.setAttribute(AdfDhtmlShadowDecorator._SHADOW_DECORATOR_ATTRIBUTE,b)}return e};
AdfDhtmlShadowDecorator._usesNativeShadows=function(a){var b=AdfAgent.AGENT,d=b.getPlatform()==AdfAgent.WEBKIT_PLATFORM||b.atLeast(AdfAgent.IE_PLATFORM,9)||b.atLeast(AdfAgent.GECKO_PLATFORM,"1.9.1");if(!d)return d;for(d=!1;a&&!d;){if(1==a.nodeType){if(AdfDomUtils.containsCSSClassName(a,AdfDhtmlZOrderManager.LAYER_STYLECLASS))break;for(var e=b.getComputedStyle(a),f=0;f<AdfDhtmlShadowDecorator._CSS_NATIVE_BOX_SHADOWS.length;f++){var g=e[AdfDhtmlShadowDecorator._CSS_NATIVE_BOX_SHADOWS[f]];if(g&&0<g.length&&
"none"!=g){d=!0;break}}}a=a.parentNode}return d};AdfDhtmlShadowDecorator.moveShadowDecorator=function(a){var b=AdfDhtmlShadowDecorator._getShadowDecorator(a);b&&b._move(a)};AdfDhtmlShadowDecorator.removeShadowDecorator=function(a){var b=AdfDhtmlShadowDecorator._getShadowDecorator(a);b&&(b._remove(a),b=a.getAttribute(AdfDhtmlShadowDecorator._SHADOW_DECORATOR_ATTRIBUTE))&&(a.removeAttribute(AdfDhtmlShadowDecorator._SHADOW_DECORATOR_ATTRIBUTE),(a=AdfDhtmlShadowDecorator._shadowDecorators)&&delete a[b])};
AdfDhtmlShadowDecorator.showShadowDecorator=function(a,b){var d=AdfDhtmlShadowDecorator._getShadowDecorator(a);d&&d._show(a,b)};AdfDhtmlShadowDecorator.hasShadowDecorator=function(a){return void 0!=AdfDhtmlShadowDecorator._getShadowDecorator(a)};AdfDhtmlShadowDecorator._getShadowDecorator=function(a){a=a.getAttribute(AdfDhtmlShadowDecorator._SHADOW_DECORATOR_ATTRIBUTE);var b,d=AdfDhtmlShadowDecorator._shadowDecorators;d&&a&&(b=d[a]);return b};
AdfDhtmlShadowDecorator._getShadowOffset=function(){var a=AdfDhtmlShadowDecorator._SHADOW_OFFSET;null==a&&(a=AdfPage.PAGE.getLookAndFeel(),a=parseInt(a.getSkinProperty("af|popup-tr-shadow-offset")),a=isNaN(a)?3:a,AdfDhtmlShadowDecorator._SHADOW_OFFSET=a);return a};
AdfDhtmlShadowDecorator._getShadowStartingBlackPercent=function(){var a=AdfDhtmlShadowDecorator._SHADOW_STARTING_BLACK_PERCENT;null==a&&(a=AdfPage.PAGE.getLookAndFeel(),a=parseInt(a.getSkinProperty("af|popup-tr-shadow-starting-black-percent")),a=isNaN(a)?3:a,AdfDhtmlShadowDecorator._SHADOW_STARTING_BLACK_PERCENT=a);return a};AdfDhtmlShadowDecorator.setRelative=function(a,b){var d=AdfDhtmlShadowDecorator._getShadowDecorator(a);d&&b&&(d._isRelative=!0)};
AdfDhtmlShadowDecorator._SHADOW_DECORATOR_ATTRIBUTE="data-afr-shaddec";AdfDhtmlShadowDecorator._CSS_NATIVE_BOX_SHADOWS=["box-shadow","-webkit-box-shadow","-moz-box-shadow"];