Type.registerNamespace("Telerik.Web"); Type.registerNamespace("Telerik.Web.UI"); Telerik.Web.UI.ModalExtender=function(a){this._windowResizeDelegate=null; this._windowScrollDelegate=null; this._xCoordinate=-1; this._yCoordinate=-1; this._backgroundElement=null; this._foregroundElement=a; this._saveTabIndexes=new Array(); this._saveDesableSelect=new Array(); this._tagWithTabIndex=new Array("A","AREA","BUTTON","INPUT","OBJECT","SELECT","TEXTAREA","IFRAME"); }; Telerik.Web.UI.ModalExtender.prototype={dispose:function(){this.hide(); this._backgroundElement=null; this._foregroundElement=null; },show:function(){var c=this._getModalOverlay(); if($telerik.getVisible(c)){return; }this._attachWindowHandlers(true); var b=this._foregroundElement; b.parentNode.appendChild(c); var a=$telerik.getCurrentStyle(b,"zIndex"); if(!isNaN(parseInt(a))){c.style.zIndex=a-1; }c.style.display=""; this._disableTab(); this._updatePageLayout(); this._updatePageLayout(); },_storeBrowserPosition:function(){var a=document.body; var b=document.documentElement; this._browserTop=a.scrollTop>b.scrollTop?a.scrollTop:b.scrollTop; this._browserLeft=a.scrollLeft>b.scrollLeft?a.scrollTop:b.scrollLeft; },_restoreBrowserPosition:function(b,d){try{if(null==b){b=this._browserLeft; }if(null==d){d=this._browserTop; }var e=document.body; var c=document.documentElement; e.scrollTop=d; e.scrollLeft=b; c.scrollTop=d; c.scrollLeft=b; }catch(a){}},hide:function(){this._restoreTab(); this._attachWindowHandlers(false); var a=this._backgroundElement; if(a){if(a.parentNode){a.parentNode.removeChild(a); }this._backgroundElement=null; }},_enableScroll:function(a){if(a){document.body.style.overflow=null!=this._overflow?this._overflow:""; document.documentElement.style.overflow=null!=this._documentOverflow?this._documentOverflow:""; document.body.style.marginRight=""; }else{this._overflow=document.body.style.overflow; document.body.style.overflow="hidden"; this._documentOverflow=document.documentElement.style.overflow; document.documentElement.style.overflow="hidden"; document.body.style.marginRight="18px"; }},_getModalOverlay:function(){if(!this._backgroundElement){var a=document.createElement("div"); a.style.display="none"; a.style.position="absolute"; if($telerik.isRightToLeft(this._foregroundElement)){a.style.right="0px"; }else{a.style.left="0px"; }a.style.top="0px"; a.style.zIndex=10000; a.style.backgroundColor="#aaaaaa"; a.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=50)"; a.style.opacity=".5"; a.style.MozOpacity=".5"; a.setAttribute("unselectable","on"); a.className="TelerikModalOverlay"; this._backgroundElement=a; }return this._backgroundElement; },_attachWindowHandlers:function(b){var a=window; if(true==b){this._windowResizeDelegate=Function.createDelegate(this,this._updatePageLayout); $addHandler(a,"resize",this._windowResizeDelegate); this._windowScrollDelegate=Function.createDelegate(this,this._updatePageLayout); $addHandler(a,"scroll",this._windowScrollDelegate); }else{if(this._windowResizeDelegate){$removeHandler(a,"resize",this._windowResizeDelegate); }this._windowResizeDelegate=null; if(this._windowScrollDelegate){$removeHandler(a,"scroll",this._windowScrollDelegate); }this._windowScrollDelegate=null; }},_updatePageLayout:function(){var f=(document.documentElement.scrollLeft?$telerik.getCorrectScrollLeft(document.documentElement):$telerik.getCorrectScrollLeft(document.body)); var d=(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop); var e=$telerik.getClientBounds(); var a=e.width; var c=e.height; var b=this._getModalOverlay(); b.style.width=Math.max(Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),a)+"px"; b.style.height=Math.max(Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c)+"px"; },_disableTab:function(){var g=0; var a; var e=new Array(); Array.clear(this._saveTabIndexes); for(var b=0; bl.width); var m=(k.height>l.height); var d=k.scrollTop; var i=k.height+d; var b=k.scrollLeft; var e=k.width+b; if(($telerik.isIE8||$telerik.isOpera||$telerik.isSafari)&&$telerik.isRightToLeft(document.body)){var g=c.style.display; if($telerik.isOpera){c.style.display="none"; }var f=document.documentElement.scrollWidth; e=f?f:document.body.scrollWidth; if($telerik.isOpera){c.style.display=g; }}if(l.xe)){l.x=e-l.width; a=true; }if(m&&(i0){f.style.left=d.x+"px"; }if(j||d.y>0){f.style.top=d.y+"px"; }if(d.width>0){f.style.width=d.width+"px"; }if(d.height>0){f.style.height=d.height+"px"; }if(!j){this._updateInnerTableSize(); }return true; },_updateInnerTableSize:function(){var d=this._resizeDir; if(d.south||d.north){var e=this._element.style.height; var c=this._tableElement; if(c){c.style.height=e; this._fixIeHeight(c,e); }}},_getMoveConstraints:function(d){var c=this._getSizeConstraints(); if(c){c.width-=d.width; c.height-=d.height; }return c; },_getSizeConstraints:function(f){var d=this._constraints; if(!d){return null; }var e=d.x+this._offsetLocation.x; var c=d.y+this._offsetLocation.y; return new Sys.UI.Bounds(e,c,e+d.width,c+d.height); },_constrainPosition:function(c,d,e){return Math.max(d,Math.min(e,c)); },_constrainDimension:function(d,c){return this._constrainPosition(d,0,c); },_fixIeHeight:function(d,c){if("CSS1Compat"==document.compatMode){var e=(d.offsetHeight-parseInt(c)); if(e>0){var f=(parseInt(d.style.height)-e); if(f>0){d.style.height=f+"px"; }}}},_setIframesVisible:function(e){if(!this.get_hideIframes()){return; }var g=this._document.getElementsByTagName("iframe"); var h=this.get_iframeToSkip(); for(var c=0,j=g.length; c1){return true; }this._storeStartCoords(c); if(!$telerik.isMobileSafari&&!$telerik.isAndroid){return $telerik.cancelRawEvent(c); }},_onDocumentMouseMove:function(d){var c=this._resize(d); if(this._autoScrollEnabled){this._autoScroll(d); }if(c){return $telerik.cancelRawEvent(d); }},_onDocumentMouseUp:function(d){var c=!this._cancelResize; this._cancelResize=true; this._startCursorLocation=null; if(c){this._clearSelection(); this._setIframesVisible(true); if(this._resizeDir&&this._resizeDir.move){this._raiseDragEvent("DragEnd",null,d); }else{this._raiseEvent("ResizeEnd"); }this._attachDocumentHandlers(false); if(this._scroller){this._scroller.set_enabled(false); }}},_clearSelection:function(){if(this._document.selection&&this._document.selection.empty){try{this._document.selection.empty(); }catch(c){}}},_initializeAutoScroll:function(){if(this._autoScrollInitialized){return; }this._scrollEdgeConst=40; this._scrollByConst=10; this._scroller=null; this._scrollDeltaX=0; this._scrollDeltaY=0; this._scrollerTickHandler=Function.createDelegate(this,this._onScrollerTick); this._scroller=new Telerik.Web.Timer(); this._scroller.set_interval(10); this._scroller.add_tick(this._scrollerTickHandler); this._autoScrollInitialized=true; },_autoScroll:function(e){this._initializeAutoScroll(); var d=$telerik.getClientBounds(); if(d.width>0){this._scrollDeltaX=this._scrollDeltaY=0; if(e.clientXd.width-this._scrollEdgeConst){this._scrollDeltaX=this._scrollByConst; }}if(e.clientYd.height-this._scrollEdgeConst){this._scrollDeltaY=this._scrollByConst; }}var c=this._scroller; if(this._scrollDeltaX!=0||this._scrollDeltaY!=0){this._originalStartX=this._startX; this._originalStartY=this._startY; c.set_enabled(true); }else{if(c.get_enabled()){this._startX=this._originalStartX; this._startY=this._originalStartY; }c.set_enabled(false); }}},_onScrollerTick:function(){var e=document.documentElement.scrollLeft||document.body.scrollLeft; var i=document.documentElement.scrollTop||document.body.scrollTop; window.scrollBy(this._scrollDeltaX,this._scrollDeltaY); var k=document.documentElement.scrollLeft||document.body.scrollLeft; var j=document.documentElement.scrollTop||document.body.scrollTop; var h=k-e; var d=j-i; var g=this._element; var f={x:parseInt(g.style.left)+h,y:parseInt(g.style.top)+d}; this._startX-=h; this._startY-=d; try{$telerik.setLocation(g,f); }catch(c){}}}; a.ResizeExtender.registerClass("Telerik.Web.UI.ResizeExtender",null,Sys.IDisposable); })();