|
|
|
|
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.BoxSide=function(){};AjaxControlToolkit.BoxSide.prototype={Top:0,Right:1,Bottom:2,Left:3};AjaxControlToolkit.BoxSide.registerEnum("AjaxControlToolkit.BoxSide",false);AjaxControlToolkit._CommonToolkitScripts=function(){};AjaxControlToolkit._CommonToolkitScripts.prototype={_borderStyleNames:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],_borderWidthNames:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],_paddingWidthNames:["paddingTop","paddingRight","paddingBottom","paddingLeft"],_marginWidthNames:["marginTop","marginRight","marginBottom","marginLeft"],getCurrentStyle:function(b,c,e){var d="undefined",a=null;if(b){if(b.currentStyle)a=b.currentStyle[c];else if(document.defaultView&&document.defaultView.getComputedStyle){var f=document.defaultView.getComputedStyle(b,null);if(f)a=f[c]}if(!a&&b.style.getPropertyValue)a=b.style.getPropertyValue(c);else if(!a&&b.style.getAttribute)a=b.style.getAttribute(c)}if(!a||a==""||typeof a===d)if(typeof e!=d)a=e;else a=null;return a},getInheritedBackgroundColor:function(b){var d="backgroundColor",c="#FFFFFF";if(!b)return c;var a=this.getCurrentStyle(b,d);try{while(!a||a==""||a=="transparent"||a=="rgba(0, 0, 0, 0)"){b=b.parentNode;if(!b)a=c;else a=this.getCurrentStyle(b,d)}}catch(e){a=c}return a},getLocation:function(a){return Sys.UI.DomElement.getLocation(a)},setLocation:function(b,a){Sys.UI.DomElement.setLocation(b,a.x,a.y)},getContentSize:function(a){if(!a)throw Error.argumentNull("element");var d=this.getSize(a),c=this.getBorderBox(a),b=this.getPaddingBox(a);return {width:d.width-c.horizontal-b.horizontal,height:d.height-c.vertical-b.vertical}},getSize:function(a){if(!a)throw Error.argumentNull("element");return {width:a.offsetWidth,height:a.offsetHeight}},setContentSize:function(a,b){var d="border-box",c=this;if(!a)throw Error.argumentNull("element");if(!b)throw Error.argumentNull("size");if(c.getCurrentStyle(a,"MozBoxSizing")==d||c.getCurrentStyle(a,"BoxSizing")==d){var f=c.getBorderBox(a),e=c.getPaddingBox(a);b={width:b.width+f.horizontal+e.horizontal,height:b.height+f.vertical+e.vertical}}a.style.width=b.width.toString()+"px";a.style.height=b.height.toString()+"px"},setSize:function(a,b){if(!a)throw Error.argumentNull("element");if(!b)throw Error.argumentNull("size");var d=this.getBorderBox(a),c=this.getPaddingBox(a),e={width:b.width-d.horizontal-c.horizontal,height:b.height-d.vertical-c.vertical};this.setContentSize(a,e)},getBounds:function(a){return Sys.UI.DomElement.getBounds(a)},setBounds:function(a,b){if(!a)throw Error.argumentNull("element");if(!b)throw Error.argumentNull("bounds");this.setSize(a,b);$common.setLocation(a,b)},getClientBounds:function(){var b,a;if(document.compatMode=="CSS1Compat"){b=document.documentElement.clientWidth;a=document.documentElement.clientHeight}else{b=document.body.clientWidth;a=document.body.clientHeight}return new Sys.UI.Bounds(0,0,b,a)},getMarginBox:function(b){var c=this;if(!b)throw Error.argumentNull("element");var a={top:c.getMargin(b,AjaxControlToolkit.BoxSide.Top),right:c.getMargin(b,AjaxControlToolkit.BoxSide.Right),bottom:c.getMargin(b,AjaxControlToolkit.BoxSide.Bottom),left:c.getMargin(b,AjaxControlToolkit.BoxSide.Left)};a.horizontal=a.left+a.right;a.vertical=a.top+a.bottom;return a},getBorderBox:function(b){var c=this;if(!b)throw Error.argumentNull("element");var a={top:c.getBorderWidth(b,AjaxControlToolkit.BoxSide.Top),right:c.getBorderWidth(b,AjaxControlToolkit.BoxSide.Right),bottom:c.getBorderWidth(b,AjaxControlToolkit.BoxSide.Bottom),left:c.getBorderWidth(b,AjaxControlToolkit.BoxSide.Left)};a.horizontal=a.left+a.right;a.vertical=a.top+a.bottom;return a},getPaddingBox:function(b){var c=this;if(!b)throw Error.argumentNull("element");var a={top:c.getPadding(b,AjaxControlToolkit.BoxSide.Top),right:c.getPadding(b,AjaxControlToolkit.BoxSide.Right),bottom:c.getPadding(b,AjaxControlToolkit.BoxSide.Bottom),left:c.getPadding(b,AjaxControlToolkit.BoxSide.Left)};a.horizontal=a.left+a.right;a.vertical=a.top+a.bottom;return
|