Type.registerNamespace("Telerik.Web.UI"); Telerik.Web.UI.RadWindowControllerClass=function(){this._activeWindow=null; this._historyStack=[]; this._registerGlobalBodyEventHandlers(); }; Telerik.Web.UI.RadWindowControllerClass.prototype={getInstance:function(){return this; },_registerGlobalBodyEventHandlers:function(){var a=Function.createDelegate(null,function(b){if(b.keyCode==27){Telerik.Web.UI.RadWindowController.hideCurrentWindowIfNonModal(); }}); $addHandler(document.documentElement,"keydown",a); Sys.Application.add_unload(function(){$removeHandler(document.documentElement,"keydown",a); }); },hideCurrentWindowIfNonModal:function(){if(this._activeWindow!=null&&this._activeWindow.isModal&&!this._activeWindow.isModal()){this._activeWindow.close(); }this._activeWindow=null; },inactivateCurrentWindow:function(){if(this._activeWindow!=null){this._activeWindow.setActive(false); }this._activeWindow=null; },set_activeWindow:function(a){if(a==this._activeWindow){return; }this.inactivateCurrentWindow(); this._activeWindow=a; Array.remove(this._historyStack,a); Array.add(this._historyStack,a); },notifyWindowClosed:function(a){if(this._activeWindow==a){this._activeWindow=null; }Array.remove(this._historyStack,a); this._activatePreviousWindow(); },_activatePreviousWindow:function(){var c=this._historyStack; var b=c.length-1; for(; b>=0; b--){var a=c[b]; if(!a){return; }if(a.isCreated()&&!a.isClosed()&&!a.isMinimized()){a.setActive(true); break; }else{Array.removeAt(c,b); }}},get_activeWindow:function(){return this._activeWindow; }}; Telerik.Web.UI.RadWindowControllerClass.registerClass("Telerik.Web.UI.RadWindowControllerClass",null); if(!Telerik.Web.UI.RadWindowController){Telerik.Web.UI.RadWindowController=new Telerik.Web.UI.RadWindowControllerClass(); }Type.registerNamespace("Telerik.Web.UI"); Type.registerNamespace("Telerik.Web.UI.RadWindowUtils"); Telerik.Web.UI.RadWindowUtils.Localization={Close:"Close",Minimize:"Minimize",Maximize:"Maximize",Reload:"Reload",PinOn:"Pin on",PinOff:"Pin off",Restore:"Restore",OK:"OK",Cancel:"Cancel",Yes:"Yes",No:"No"}; Telerik.Web.UI.RadWindow=function(a){Telerik.Web.UI.RadWindow.initializeBase(this,[a]); this._openerElement=null; this._offsetElement=null; this._popupElement=null; this._tableElement=null; this._contentElement=null; this._contentCell=null; this._titleElement=null; this._titleCell=null; this._titlebarElement=null; this._statusCell=null; this._statusMessageElement=null; this._iframe=null; this._dockMode=false; this._buttonsElement=null; this._buttonsArray=[]; this.isIE=($telerik.isIE); this._openerElementID=null; this._offsetElementID=null; this._behaviors=Telerik.Web.UI.WindowBehaviors.Default; this._initialBehaviors=Telerik.Web.UI.WindowBehaviors.None; this._navigateUrl=null; this._left=""; this._top=""; this._formID=null; this._skin="Default"; this._title=""; this._width="300px"; this._minWidth=null; this._minHeight=null; this._handlesWidth=null; this._height="300px"; this._opacity=100; this._minimizeZoneID=null; this._restrictionZoneID=""; this._clientCallBackFunction=null; this._reloadOnShow=false; this._visibleOnPageLoad=false; this._destroyOnClose=false; this._visibleTitlebar=true; this._visibleStatusbar=true; this._showContentDuringLoad=true; this._modal=false; this._overlay=false; this._keepInScreenBounds=false; this._autoSize=false; this._iconUrl=null; this._minimizeIconUrl=null; this._animation=Telerik.Web.UI.WindowAnimation.None; this._animationDuration=500; this._windowAnimation=null; this._onMouseDownDelegate=null; this._onClickDelegate=null; this._onTitlebarDblclickDelegate=null; this._onTitlebarClickDelegate=null; this._onWindowResizeDelegate=null; this._onIframeLoadDelegate=null; this._onChildPageUnloadDelegate=null; this._onChildPageClickDelegate=null; this._onModalShowHandler=null; this._onModalCloseHandler=null; this._loaded=false; this._isCloned=false; this._restoreRect=null; this._popupBehavior=null; this._popupVisible=false; this._windowManager; this._browserWindow=window; this._stylezindex=null; this._cssClass=""; this.GetWindowManager=this.get_windowManager; this.BrowserWindow=window; this.GetContentFrame=this.get_contentFrame; this.GetLeftPosition=function(){this.getWindowBounds().x; }; this.GetTopPosition=function(){this.getWindowBounds().y; }; this.GetTitlebar=function(){return this._titleCell; }; this.GetStatusbar=function(){return this._statusCell; }; this.SetOpenerElementId=this.set_openerElementID; this.SetStatus=this.set_status; this.GetStatus=this.get_status; this.SetModal=this.set_modal; this.SetWidth=this.set_width; this.SetHeight=this.set_height; this.GetWidth=this.get_width; this.GetHeight=this.get_height; this.SetOffsetElementId=this.set_offsetElementID; this.SetTitle=this.set_title; this.MoveTo=this.moveTo; this.Center=this.center; this.SetVisible=this.setVisible; this.SetSize=this.setSize; this.Show=this.show; this.Hide=this.hide; this.GetUrl=this.get_navigateUrl; this.SetUrl=this.setUrl; this.Reload=this.reload; this.SetActive=this.setActive; this.Minimize=this.minimize; this.Restore=this.restore; this.Maximize=this.maximize; this.Close=this.close; this.TogglePin=this.togglePin; this.IsMaximized=this.isMaximized; this.IsMinimized=this.isMinimized; this.IsModal=this.isModal; this.IsClosed=this.isClosed; this.IsPinned=this.isPinned; this.IsVisible=this.isVisible; this.IsActive=this.isActive; this.IsBehaviorEnabled=this.isBehaviorEnabled; }; Telerik.Web.UI.RadWindow.prototype={_getLocalization:function(){return Telerik.Web.UI.RadWindowUtils.Localization; },get_stylezindex:function(){return this._stylezindex; },set_stylezindex:function(a){this._stylezindex=a; },_registerIframeLoadHandler:function(a){if(!this._iframe){return; }if(a){this._onIframeLoadDelegate=Function.createDelegate(this,this._onIframeLoad); $addHandler(this._iframe,"load",this._onIframeLoadDelegate); }else{if(this._onIframeLoadDelegate){$removeHandler(this._iframe,"load",this._onIframeLoadDelegate); this._onIframeLoadDelegate=null; $clearHandlers(this._iframe); }}},_registerWindowResizeHandler:function(a){if(a){this._onWindowResizeDelegate=Function.createDelegate(this,this._maintainMaximizedSize); $addHandler(window,"resize",this._onWindowResizeDelegate); }else{if(this._onWindowResizeDelegate){$removeHandler(window,"resize",this._onWindowResizeDelegate); this._onWindowResizeDelegate=null; }}},_registerOpenerElementHandler:function(b,c){if(!b){return; }if(true==c){this._onClickDelegate=Function.createDelegate(this,this._onClick); $addHandler(b,"click",this._onClickDelegate); }else{var a=$removeHandler(b,"click",this._onClickDelegate); this._onClickDelegate=null; }},_registerTitlebarHandlers:function(b){var a=this._titleCell; if(b){this._onTitlebarDblclickDelegate=Function.createDelegate(this,function(){if(this.isMinimized()){this.restore(); }else{if(this.isBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Maximize)){if(this.isMaximized()){this.restore(); }else{this.maximize(); }}}}); this._onTitlebarClickDelegate=Function.createDelegate(this,function(){this.setActive(true); }); $addHandler(a,"dblclick",this._onTitlebarDblclickDelegate); $addHandler(a,"click",this._onTitlebarClickDelegate); }else{if(a){if(this._onTitlebarDblclickDelegate){$removeHandler(a,"dblclick",this._onTitlebarDblclickDelegate); this._onTitlebarDblclickDelegate=null; }if(this._onTitlebarClickDelegate){$removeHandler(a,"click",this._onTitlebarClickDelegate); this._onTitlebarClickDelegate=null; }$clearHandlers(a); }}},_makeModal:function(a){if(this._onModalShowHandler){this.remove_show(this._onModalShowHandler); this._onModalShowHandler=null; }if(this._onModalCloseHandler){this.remove_close(this._onModalCloseHandler); this._onModalCloseHandler=null; }if(this._modalExtender){this._modalExtender.dispose(); this._modalExtender=null; }if(!a){return; }if(typeof(Telerik.Web.UI.RadWindowManager)!="undefined"&&Telerik.Web.UI.RadWindowManager.isInstanceOfType(this)){return; }this._onModalShowHandler=function(b){if(!b._modalExtender){b._modalExtender=new Telerik.Web.UI.ModalExtender(b._popupElement); }b._modalExtender.show(); b.center(); }; this.add_show(this._onModalShowHandler); this._onModalCloseHandler=function(b){window.setTimeout(function(){if(b._modalExtender){b._modalExtender.hide(); }},10); }; this.add_close(this._onModalCloseHandler); },_enableMoveResize:function(c){if(this._resizeExtender){this._resizeExtender.dispose(); this._resizeExtender=null; }if(!c){return; }if(!this._popupElement){return; }var d=this._tableElement.rows; var a={}; var b=this._isWindowRightToLeft(); if(this.isBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Resize)){if(b){a={nw:d[0].cells[2],n:this._topResizer,ne:d[0].cells[0],w:[d[1].cells[2],d[2].cells[2]],e:[d[1].cells[0],d[2].cells[0]],sw:d[3].cells[2],s:d[3].cells[1],se:[d[3].cells[0],this._bottomResizer]}; }else{a={nw:d[0].cells[0],n:this._topResizer,ne:d[0].cells[2],w:[d[1].cells[0],d[2].cells[0]],e:[d[1].cells[2],d[2].cells[2]],sw:d[3].cells[0],s:d[3].cells[1],se:[d[3].cells[2],this._bottomResizer]}; }}if(this.isBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Move)){a.move=this._titleCell; }this._resizeExtender=new Telerik.Web.UI.ResizeExtender(this,this._popupElement,a,this._tableElement); },onResizeStart:function(){if(this.isMaximized()){return false; }this.setActive(true); this._cachedDragZoneBounds=this._getRestrictionZoneBounds(); },onResizing:function(a){if(!this._cachedDragZoneBounds||this._checkRestrictionZoneBounds(this._cachedDragZoneBounds,a)){if(this._dockMode){this.setWidthDockMode(a.width-1); this.setHeightDockMode(a.height-1); }var c=this.get_minWidth(); if(a.width-1){a="&"+a; }else{a="?"+a; }b+=a; return b; },getWindowBounds:function(){return this._getCalculatedPopupBounds(); },toString:function(){return"[RadWindow id="+this.get_id()+"]"; },center:function(){var a=this._getCentralBounds(); this.moveTo(a.x,a.y); },moveTo:function(a,b){var d=this._popupElement; if(d){var c=$telerik.getBounds(d); var e=this._getRestrictionZoneBounds(); if(e){var f=this._checkRestrictionZoneBounds(null,new Sys.UI.Bounds(a+e.x,b+e.y,c.width,c.height)); if(!f){return false; }}}a=parseInt(a); b=parseInt(b); this._createUI(); this._setPopupVisible(a,b); this._storeBounds(); return true; },setSize:function(b,a){this._firstShow=false; this.set_width(b); this.set_height(a); this._storeBounds(); },autoSize:function(z){if(this.isClosed()){return; }var d=this.get_contentFrame(); var i=this.get_popupElement(); var c=$telerik.getBounds(i); var w=$telerik.getBorderBox(i); c.width-=w.horizontal; c.height-=w.vertical; var q=null; var l; var x; var j=this.get_contentElement(); var a=this.get_minWidth(); var g=this._getTitleElement(); if(g){g.style.width="1px"; }if(this._dockMode&&j){j.style.height="1px"; j.style.width="1px"; l=j.scrollHeight; var y=j.scrollWidth; x=y>a?y:a; }else{try{q=d.contentWindow.document.documentElement; if(!q){return; }}catch(e){return false; }var n=d.contentWindow.document.body; var j=q; if($telerik.isIE||$telerik.isFirefox){j=d; }j.style.width="1px"; l=q.scrollHeight; x=q.scrollWidth; if(x0){this._contentElement.style.width=widthToSet+"px"; }},setHeightDockMode:function(a){if(!this._dockMode||!this.get_contentElement()){return; }var b=a; b-=parseInt($telerik.getCurrentStyle(this._tableElement.rows[3].cells[1],"height")); if(this._visibleTitlebar){b-=parseInt($telerik.getCurrentStyle(this._titlebarElement,"height")); b-=parseInt($telerik.getCurrentStyle(this._topResizer,"height")); }else{b-=parseInt($telerik.getCurrentStyle(this._tableElement.rows[0].cells[1],"height")); }if(this._visibleStatusbar){b-=parseInt($telerik.getCurrentStyle(this._tableElement.rows[2].cells[1],"height")); }if(b>0){this._contentElement.style.height=b+"px"; }},calcPosition:function(d,c,a,b){var e=d+Math.round((c-a)/2); if(e<0||e+c>b){e=Math.round(Math.abs((b-a)/2)); }return e; },_maintainMaximizedSize:function(){if(!this.isMaximized()){return; }var g=this._popupElement; if(!g){return; }var a=this._getViewportBounds(); g.style.top=(a.scrollTop+a.y)+"px"; g.style.left=(a.scrollLeft+a.x)+"px"; $telerik.setSize(g,{width:a.width,height:a.height}); var b=this._getRestrictionZoneBounds(); if(!b){this._enablePageScrolling(false); }var c=this._tableElement; a=$telerik.getContentSize(g); var d=$telerik.getBorderBox(c); var e=$telerik.getPaddingBox(c); var f=a.height-d.vertical-e.vertical; c.style.height=f+"px"; this._fixIeHeight(c,f); if(this._dockMode){this.setWidthDockMode(a.width); this.setHeightDockMode(a.height); }},_enablePageScrolling:function(c){var a=document.body; var b=document.documentElement; if(c){if(null!=this._documentOverflow){b.style.overflow=this._documentOverflow; }if(null!=this._bodyOverflow){a.style.overflow=this._bodyOverflow; }this._documentOverflow=null; this._bodyOverflow=null; }else{if(null==this._documentOverflow){this._documentOverflow=b.style.overflow; }if(null==this._bodyOverflow){this._bodyOverflow=a.style.overflow; }a.style.overflow="hidden"; b.style.overflow="hidden"; }},_getRestrictionZoneBounds:function(){var b=null; if(this.get_restrictionZoneID()){var a=$get(this.get_restrictionZoneID()); if(a){b=$telerik.getBounds(a); b.scrollLeft=0; b.scrollTop=0; }}return b; },_storeBounds:function(){if(!this.isCreated()){return; }var a=this._getCurrentBounds(); if(this.isMaximized()){return false; }if(this.isMinimized()){if(this._restoreRect){a.width=this._restoreRect.width; a.height=this._restoreRect.height; }else{a.width=this.get_width(); a.height=this.get_height(); }}this._restoreRect=a; },_restoreBounds:function(){if(!this._restoreRect){return; }var a=this._restoreRect; this.setSize(a.width,a.height); this.moveTo(a.x,a.y); },_getStoredBounds:function(){if(this._restoreRect){return this._restoreRect; }},_deleteStoredBounds:function(){this._restoreRect=null; },_getCurrentBounds:function(){var c=(this._popupElement.style.display=="none")?true:false; this._popupElement.style.display=""; if(this._firstShow!=true){this._updateWindowSize(this._height); this._firstShow=true; }var a=$telerik.getBounds(this._popupElement); if(c){this._popupElement.style.display="none"; }var b=this._getRestrictionZoneBounds(); if(b){a.x-=b.x; a.y-=b.y; }return a; },_getCentralBounds:function(){var a=this._getCurrentBounds(); var c=this._getViewportBounds(); var d=parseInt((c.width-a.width)/2); var b=parseInt((c.height-a.height)/2); a.x=d+c.scrollLeft; a.y=b+c.scrollTop; return a; },_getViewportBounds:function(){var d=this._getRestrictionZoneBounds(); if(d){return d; }var a=$telerik.getClientBounds(); var b=$telerik.getCorrectScrollLeft(document.documentElement)||$telerik.getCorrectScrollLeft(document.body); var c=document.documentElement.scrollTop||document.body.scrollTop; a.scrollLeft=b; a.scrollTop=c; if(this.isIE){if(a.width==0){a.width=document.body.clientWidth; }if(a.height==0){a.height=document.body.clientHeight; }}return a; },_getCalculatedPopupBounds:function(){var c=this._getStoredBounds(); if(c){return c; }var d=this._getCurrentBounds(); var e=this._offsetElement; if(!this._top&&!this._left&&!e){d=this._getCentralBounds(); }else{if(e){d.y=0; d.x=0; }else{var b=this._getViewportBounds(); d.x=b.scrollLeft; d.y=b.scrollTop; }var f=this._left?this._left:0; d.x+=f; var a=this._top?this._top:0; d.y+=a; }return d; },_checkRestrictionZoneBounds:function(c,a){var b=c; if(!b){b=this._getRestrictionZoneBounds(); if(!b){return true; }}return Telerik.Web.UI.ResizeExtender.containsBounds(b,a); },_reSetWindowPosition:function(){var a=this._getCalculatedPopupBounds(); this._setPopupVisible(a.x,a.y); },_fixIeHeight:function(a,b){if("CSS1Compat"==document.compatMode){var d=(a.offsetHeight-parseInt(b)); if(d>0){var c=(parseInt(a.style.height)-d); if(c>0){a.style.height=c+"px"; }}}},_setPopupVisible:function(a,b){var c=this._getRestrictionZoneBounds(); if(c){a+=c.x; b+=c.y; }this._popupBehavior._setCoordinates(a,b); this._popupBehavior.show(); if(!this.get_width()){this._popupElement.style.width=""; }this._updateTitleWidth(); },_createDefaultTable:function(){var a=document.createElement("TABLE"); a.align="left"; a.cellSpacing=0; a.cellPadding=0; a.insertRow(-1); return a; },_isWindowRightToLeft:function(){var b=this._isRightToLeft; if(b==null){var a=this.get_element(); var c=a.parentNode?a:this._getDefaultParent(); b=this._isRightToLeft=$telerik.isRightToLeft(c); }return b; },_createStatusbarResizer:function(a){var b=a.rows[0].insertCell(-1); b.style.width="15px"; var c=document.createElement("DIV"); b.appendChild(c); this._bottomResizer=c; },_createStatusbarMessageCell:function(a){var b=a.rows[0].insertCell(-1); b.style.width="100%"; var c=this._getStatusMessageElement(); b.appendChild(c); },_createUI:function(){if(!this._popupElement){var c=this.get_id(); var b="RadWindowWrapper_"+c; var o=this._isWindowRightToLeft(); var e=document.createElement("DIV"); e.id=b; e.className=this._getFullSkinName(); var a=this.get_cssClass(); if(a){Sys.UI.DomElement.addCssClass(e,a); }if(o){Sys.UI.DomElement.addCssClass(e,"RadWindow_rtl"); }if(!this._visibleTitlebar){Sys.UI.DomElement.addCssClass(e,"rwNoTitleBar"); }e.style.width=this._width; e.style.height=this._height; e.setAttribute("unselectable","on"); this._popupElement=e; var d=document.createElement("TABLE"); d.cellSpacing=0; d.cellPadding=0; this._tableElement=d; var v=[]; if(o){classNames=["rwCorner rwTopRight","rwTitlebar","rwCorner rwTopLeft","rwCorner rwBodyRight","rwWindowContent","rwCorner rwBodyLeft","rwCorner rwBodyRight","rwStatusbar","rwCorner rwBodyLeft","rwCorner rwFooterRight","rwFooterCenter","rwCorner rwFooterLeft"]; }else{classNames=["rwCorner rwTopLeft","rwTitlebar","rwCorner rwTopRight","rwCorner rwBodyLeft","rwWindowContent","rwCorner rwBodyRight","rwCorner rwBodyLeft","rwStatusbar","rwCorner rwBodyRight","rwCorner rwFooterLeft","rwFooterCenter","rwCorner rwFooterRight"]; }var n=["rwTitleRow","rwContentRow","rwStatusbarRow","rwFooterRow"]; var m=0; for(var k=0; k<4; k++){var u=d.insertRow(-1); u.className=n[k]; for(var l=1; l<=3; l++){var g=u.insertCell(-1); g.innerHTML=" "; g.className=classNames[m]; m++; }}var t=d.rows[0].cells[1]; t.innerHTML=""; this._titleCell=t; var s=document.createElement("DIV"); s.className="rwTopResize"; s.innerHTML=""; this._topResizer=s; this._titleCell.appendChild(this._topResizer); var h=this._createDefaultTable(); h.className="rwTitlebarControls"; this._titlebarElement=h; this._titleCell.appendChild(this._titlebarElement); var p=this._getTitleIcon(); var z=this._titlebarElement.rows[0].insertCell(-1); z.appendChild(p); var A=this._getTitleElement(); var t=this._titlebarElement.rows[0].insertCell(-1); t.appendChild(A); this.set_title(this._title); var f=this._titlebarElement.rows[0].insertCell(-1); f.noWrap=true; f.style.whiteSpace="nowrap"; f.appendChild(this._getTitleCommandButtonsHolder()); var q=d.rows[1].cells[1]; q.vAlign="top"; q.innerHTML=""; this._contentCell=q; var w=this.get_name(); var y=this._createDefaultTable(); y.style.width="100%"; this._statusCell=d.rows[2].cells[1]; this._statusCell.innerHTML=""; this._statusCell.appendChild(y); if(o){this._createStatusbarResizer(y); this._createStatusbarMessageCell(y); }else{this._createStatusbarMessageCell(y); this._createStatusbarResizer(y); }this._popupElement.appendChild(this._tableElement); this._popupElement.style.display="none"; this._popupElement.style.position="absolute"; this._addWindowToDocument(); this.set_behaviors(this._behaviors); this._registerTitlebarHandlers(true); this.set_visibleTitlebar(this._visibleTitlebar); this.set_visibleStatusbar(this._visibleStatusbar); if(this._dockMode){var x=$get(this.get_id()+"_C"); if(x&&x.innerHTML){x.style.overflow="auto"; x.style.border="0px"; this.set_contentElement(x); this.setWidthDockMode(this.get_width()); this.setHeightDockMode(this.get_height()); }}else{var r=($telerik.isIE)?document.createElement("