Type.registerNamespace("Telerik.Web.UI");
(function(){$telerik.toWindow=function(c){return c;
};
$telerik.findWindow=$find;
var a=$telerik.$;
var b=Telerik.Web.UI;
b.RadWindowControllerClass=function(){this._activeWindow=null;
this._historyStack=[];
};
b.RadWindowControllerClass.prototype={getInstance:function(){return this;
},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(c){if(c==this._activeWindow){return;
}this.inactivateCurrentWindow();
this._activeWindow=c;
Array.remove(this._historyStack,c);
Array.add(this._historyStack,c);
},notifyWindowClosed:function(c){if(this._activeWindow==c){this._activeWindow=null;
}Array.remove(this._historyStack,c);
this._activatePreviousWindow();
},_activatePreviousWindow:function(){var c=this._historyStack;
var d=c.length-1;
for(;
d>=0;
d--){var e=c[d];
if(!e){return;
}if(e.isCreated()&&!e.isClosed()&&!e.isMinimized()){e.setActive(true);
break;
}else{Array.removeAt(c,d);
}}},get_activeWindow:function(){return this._activeWindow;
}};
b.RadWindowControllerClass.registerClass("Telerik.Web.UI.RadWindowControllerClass",null);
if(!b.RadWindowController){b.RadWindowController=new b.RadWindowControllerClass();
}Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.RadWindowUtils");
b.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"};
a.registerEnum(b,"WindowBehaviors",{None:0,Resize:1,Minimize:2,Close:4,Pin:8,Maximize:16,Move:32,Reload:64,Default:(1+2+4+8+16+32+64)});
a.registerEnum(b,"WindowAutoSizeBehaviors",{Width:1,WidthProportional:2,Height:4,HeightProportional:8,Default:(2+8)});
a.registerEnum(b,"WindowAnimation",{None:0,Resize:1,Fade:2,Slide:4,FlyIn:8});
a.registerEnum(b,"WindowMinimizeMode",{SameLocation:1,MinimizeZone:2,Default:1});
b.RadWindow=function(c){b.RadWindow.initializeBase(this,[c]);
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._shortCutManager=null;
this.isIE=($telerik.isIE);
this._openerElementID=null;
this._offsetElementID=null;
this._behaviors=b.WindowBehaviors.Default;
this._left=null;
this._top=null;
this._title="";
this._width="300px";
this._minWidth=null;
this._minHeight=null;
this._defaultMinWidth=null;
this._defaultMinHeight=null;
this._handlesWidth=null;
this._resizeOverlayElement=null;
this._height="300px";
this._opacity=100;
this._visibleTitlebar=true;
this._visibleStatusbar=true;
this._modal=false;
this._overlay=false;
this._keepInScreenBounds=false;
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._onKeyDownDelegate=null;
this._onModalShowHandler=null;
this._onModalCloseHandler=null;
this._loaded=false;
this._isCloned=false;
this._restoreRect=null;
this._popupBehavior=null;
this._popupVisible=false;
this._dropDownTouchScroll=null;
this._browserWindow=window;
this._stylezindex=null;
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;
};
b.RadWindow.prototype={_getLocalization:function(){return b.RadWindowUtils.Localization;
},_getLocalizationString:function(d){var e=this.get_localization();
if(typeof(e)=="string"){e=Sys.Serialization.JavaScriptSerializer.deserialize(e);
this.set_localization(e);
}var c=this._getLocalization();
if(!e){return c[d];
}return e[d];
},_registerGlobalBodyEventHandlers:function(c){var d=this.get_shortcuts();
if(!d){return;
}if(!this._shortCutManager){this._shortCutManager=new b.WindowShortCutManager(d);
}if(c){this._onKeyDownDelegate=Function.createDelegate(this,this._onKeyDown);
$addHandler(document.documentElement,"keydown",this._onKeyDownDelegate);
}else{if(this._onKeyDownDelegate){$removeHandler(document.documentElement,"keydown",this._onKeyDownDelegate);
this._onKeyDownDelegate=null;
}}},_registerIframeLoadHandler:function(c){if(!this._iframe){return;
}if(c){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(c){if(c){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(d,e){if(!d){return;
}if(Sys.UI.DomElement.containsCssClass(d,"RadButton")){d.setAttribute("rwOpener",true);
}else{d.removeAttribute("rwOpener");
}if(true==e){this._onClickDelegate=Function.createDelegate(this,this._onClick);
$addHandler(d,"click",this._onClickDelegate);
}else{var c=$removeHandler(d,"click",this._onClickDelegate);
this._onClickDelegate=null;
}},_registerTitlebarHandlers:function(c){var d=this._titleCell;
if(c){this._onTitlebarDblclickDelegate=Function.createDelegate(this,function(){if(this.isMinimized()){this.restore();
}else{if(this.isBehaviorEnabled(b.WindowBehaviors.Maximize)){if(this.isMaximized()){this.restore();
}else{this.maximize();
}}}});
this._onTitlebarClickDelegate=Function.createDelegate(this,function(){this.setActive(true);
});
$addHandler(d,"dblclick",this._onTitlebarDblclickDelegate);
$addHandler(d,"click",this._onTitlebarClickDelegate);
}else{if(d){if(this._onTitlebarDblclickDelegate){$removeHandler(d,"dblclick",this._onTitlebarDblclickDelegate);
this._onTitlebarDblclickDelegate=null;
}if(this._onTitlebarClickDelegate){$removeHandler(d,"click",this._onTitlebarClickDelegate);
this._onTitlebarClickDelegate=null;
}$clearHandlers(d);
}}},_makeModal:function(c){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(!c){return;
}if(typeof(b.RadWindowManager)!="undefined"&&b.RadWindowManager.isInstanceOfType(this)){return;
}this._onModalShowHandler=function(d){if(!d._modalExtender){d._modalExtender=new b.ModalExtender(d._popupElement);
}d._modalExtender.show();
var f=document.activeElement;
if(f&&f.tagName.toLowerCase()!="body"){var e=(!$telerik.isDescendant(this._contentElement,f)&&this._dockMode);
if(!(d._isPredefined)||e){d._focusedPageElement=f;
f.blur();
}}d.center();
};
this.add_show(this._onModalShowHandler);
this._onModalCloseHandler=function(d){window.setTimeout(function(){if(d._modalExtender){d._modalExtender.hide();
}var f=d._focusedPageElement;
if(f){try{f.focus();
}catch(e){}d._focusedPageElement=null;
}},10);
};
this.add_close(this._onModalCloseHandler);
},_enableMoveResize:function(e){if(this._resizeExtender){this._resizeExtender.dispose();
this._resizeExtender=null;
}if(!e){return;
}if(!this._popupElement){return;
}var f=this._tableElement.rows;
var c={};
var g=this._isWindowRightToLeft();
if(this.isBehaviorEnabled(b.WindowBehaviors.Resize)){if(g){c={nw:f[0].cells[2],n:this._topResizer,ne:f[0].cells[0],w:[f[1].cells[2],f[2].cells[2]],e:[f[1].cells[0],f[2].cells[0]],sw:f[3].cells[2],s:f[3].cells[1],se:[f[3].cells[0],this._bottomResizer]};
}else{c={nw:f[0].cells[0],n:this._topResizer,ne:f[0].cells[2],w:[f[1].cells[0],f[2].cells[0]],e:[f[1].cells[2],f[2].cells[2]],sw:f[3].cells[0],s:f[3].cells[1],se:[f[3].cells[2],this._bottomResizer]};
}}if(this.isBehaviorEnabled(b.WindowBehaviors.Move)){c.move=this._titleCell;
}this._resizeExtender=new b.ResizeExtender(this,this._popupElement,c,this._tableElement);
var d=this._dockMode?null:this._iframe;
this._resizeExtender.set_iframeToSkip(d);
},_setResizeOverlayVisible:function(f){if(this._dockMode){return;
}var c=this._resizeOverlayElement;
if(!c){var e=this._getHandlesWidth();
var d=this._visibleTitlebar?this._tableElement.rows[0].offsetHeight:e;
c=document.createElement("div");
c.style.position="absolute";
c.style.zIndex="1";
c.style.top=d+"px";
c.style.left=Math.round(e/2)+"px";
c.style.backgroundColor="White";
c.style.filter="alpha(opacity=0)";
c.style.opacity=0;
this._contentCell.appendChild(c);
this._resizeOverlayElement=c;
}this._setResizeOverlaySize();
c.style.display=f?"":"none";
},_setResizeOverlaySize:function(){var d=this._resizeOverlayElement;
if(d){var c=this._contentCell;
d.style.width=c.offsetWidth+"px";
d.style.height=c.offsetHeight+"px";
}},onResizeStart:function(){if(this.isMaximized()){return false;
}this.setActive(true);
this._setResizeOverlayVisible(true);
this._cachedDragZoneBounds=this._getRestrictionZoneBounds();
var c=new Sys.CancelEventArgs();
this.raiseEvent("resizeStart",c);
if(c.get_cancel()){return false;
}},onResizing:function(e){if(!this._cachedDragZoneBounds||this._checkRestrictionZoneBounds(this._cachedDragZoneBounds,e)){this._manageVisibilityFirefox(false);
if(this._dockMode){this.setWidthDockMode(e.width-1);
this.setHeightDockMode(e.height-1);
}else{this._setResizeOverlaySize();
}var i=this._getCurrentBounds();
var f=this.get_minWidth();
var h=parseInt(this.get_maxWidth());
var j=this.get_minHeight();
var g=parseInt(this.get_maxHeight());
var c=false;
if(e.widthh){var d=f;
if(e.widthg){e.height=(e.height';";
c.name="";
c.removeAttribute("name");
c.removeAttribute("NAME");
}this._createTouchScrollExtender(false);
if(this._contentElement&&this._isPredefined){this._contentElement.innerHTML="";
}var f=this.get_contentElement();
if(this._dockMode&&f){if(Sys&&Sys.WebForms){var d=Sys.WebForms.PageRequestManager.getInstance();
if(d&&d.get_isInAsyncPostBack()){$telerik.disposeElement(f);
}}}if($telerik.isChrome||$telerik.isSafari||!this.get_destroyOnClose()){var h=this._popupElement;
if(h&&h.parentNode){h.parentNode.removeChild(h);
}}var g=this._popupBehavior;
if(this.get_destroyOnClose()&&g){g.dispose();
this._popupBehavior=null;
}b.RadWindow.callBaseMethod(this,"dispose");
},hide:function(){this._hide();
this._registerGlobalBodyEventHandlers(false);
return true;
},clone:function(d){var c=document.createElement("span");
if(d){c.setAttribute("id",d);
}return $telerik.cloneControl(this,b.RadWindow,c);
},_createTouchScrollExtender:function(e){var c=$get(this.get_id()+"_C");
if(c){var d=this._dropDownTouchScroll;
if(d){if(!e){d.dispose();
this._dropDownTouchScroll=null;
}}else{if(e){this._dropDownTouchScroll=new b.TouchScrollExtender(c);
this._dropDownTouchScroll.initialize();
}}}},set_contentElement:function(d){if(!this._isPredefined){this._dockMode=true;
}var c=$get(this.get_id()+"_C");
if(c&&d!=c){$telerik.disposeElement(c);
c.innerHTML="";
c.appendChild(d);
d=c;
}this._createUI();
if(this._iframe){this._iframe.style.display="none";
}else{if(!this._dropDownTouchScroll&&b.TouchScrollExtender._getNeedsScrollExtender()){this._createTouchScrollExtender(true);
}}if(d.parentNode&&d.parentNode.removeChild){d.parentNode.removeChild(d);
}this._contentCell.appendChild(d);
d.style.display="";
this._contentElement=d;
},_setShadowCSSClass:function(c){var d=this._tableElement;
var e=this.get_popupElement();
if(!d||!e){return;
}if(c){Sys.UI.DomElement.addCssClass(d,"rwShadow");
Sys.UI.DomElement.addCssClass(e,"rwShadow");
}else{Sys.UI.DomElement.removeCssClass(d,"rwShadow");
Sys.UI.DomElement.removeCssClass(e,"rwShadow");
}},get_contentElement:function(){return this._contentElement;
},isCreated:function(){return this._popupElement!=null;
},show:function(){var d=this.isCreated();
this._createUI();
var c=new Sys.CancelEventArgs();
this.raiseEvent("beforeShow",c);
if(c.get_cancel()){return;
}if(this.get_navigateUrl()&&(!d||this.get_reloadOnShow())){this.setUrl(this.get_navigateUrl());
}if(!d&&(this.get_initialBehaviors()!=b.WindowBehaviors.None)){this._show();
this._afterShow();
if(this.isInitialBehaviorEnabled(b.WindowBehaviors.Minimize)){this.minimize();
}if(this.isInitialBehaviorEnabled(b.WindowBehaviors.Maximize)){this.maximize();
}if(this.isInitialBehaviorEnabled(b.WindowBehaviors.Pin)){this.togglePin();
}return;
}if(this.isModal()){this.center();
}if(this.get_animation()==b.WindowAnimation.None){this._show();
this._afterShow();
}else{this._playAnimation();
}},_show:function(){if(this.get_offsetElementID()&&!this._offsetElement){var e=$get(this.get_offsetElementID());
if(e){this._offsetElement=e;
}}var c=this._popupBehavior.get_parentElement();
if(this._offsetElement&&!this._offsetSet){this._popupBehavior.set_parentElement(this._offsetElement);
this._offsetSet=true;
}this.set_visibleTitlebar(this._visibleTitlebar);
this.set_visibleStatusbar(this._visibleStatusbar);
this._reSetWindowPosition();
if(this._firstShow){this.set_width(this.get_width());
this.set_height(this.get_height());
}if(c!=this._popupBehavior.get_parentElement()){this._popupBehavior.set_parentElement(c);
}this._popupVisible=true;
var d=this.get_contentElement();
if(!this._isPredefned&&d){$telerik.repaintChildren(d);
}},_hide:function(){if(!this.get_animation()||this.get_animation()==0){this._afterHide();
}else{if(this._enableShadow&&$telerik.isIE){this._setShadowCSSClass(false);
}var d=Function.createDelegate(this,this._afterHide);
var c=this.isMaximized();
$telerik.$(this._popupElement).stop().fadeOut(this.get_animationDuration(),function(){d(c);
});
}},_afterHide:function(c){if(!this._popupBehavior){return;
}this._manageVisibilityFirefox(true);
if(c==null){c=this.isMaximized();
}var d=this.isMinimized();
if(c||d){this.restore();
}if($telerik.isFirefox){this.setOverflowVisible(false);
}this._popupBehavior.hide(true);
this._popupVisible=false;
this._getWindowController().notifyWindowClosed(this);
if(this.get_enableAriaSupport()&&this._popupElement&&!this.isVisible()){this._popupElement.setAttribute("aria-hidden","true");
}},_afterShow:function(){this.setActive(true);
if($telerik.isFirefox){this.setOverflowVisible(true);
}this._registerGlobalBodyEventHandlers(true);
this._storeBounds();
this.raiseEvent("show",new Sys.EventArgs());
var c=!this.get_animation()==b.WindowAnimation.None;
if(this.get_autoSize()&&(this._dockMode||c)){this.autoSize(c);
}if(this.get_enableAriaSupport()&&this._popupElement&&this.isVisible()){this._popupElement.setAttribute("aria-hidden","false");
}},_playAnimation:function(){var f=Function.createDelegate(this,function(){var p=this._getCalculatedPopupBounds();
this._setPopupVisible(p.x,p.y);
var l=$telerik.getBounds(this._popupElement);
var o=this.get_offsetElementID();
if(o){var n=$get(o);
if(n){var m=$telerik.getBounds(n);
l.x=m.x;
l.y=m.y;
}}$telerik.$(this._popupElement).hide();
return l;
});
var g=this._popupElement;
if(this._enableShadow&&$telerik.isIE){this._setShadowCSSClass(false);
}var d=this.get_animation();
var k=this._openerElement?$telerik.getBounds(this._openerElement):null;
var c=f();
var i=this.get_animationDuration();
var h=""+this._position;
var e=null;
var j=Function.createDelegate(this,function(){var l=this.get_popupElement();
l.style.filter="";
if($telerik.isIE7){l.style.removeAttribute("filter");
}l.style.opacity="";
if(this._enableShadow&&$telerik.isIE&&!$telerik.isIE6){this._setShadowCSSClass(true);
}this._show();
this._afterShow();
});
b.Animations.playJQueryAnimation(g,d,k,c,h,e,j,i);
},_onClick:function(c){this.show();
return this._cancelEvent(c);
},_onKeyDown:function(c){var d=this._shortCutManager.isShortCutHit(c);
if(!d){return;
}if(this.isActive()){this.fire(d.get_name());
}},_cancelEvent:function(c){if(c){c.returnValue=false;
c.cancelBubble=true;
c.preventDefault();
c.stopPropagation();
}return false;
},_getWindowController:function(){return b.RadWindowController.getInstance();
},_getReloadOnShowUrl:function(d){var c="rwndrnd="+Math.random();
if(d.indexOf("?")>-1){c="&"+c;
}else{c="?"+c;
}var e=d.indexOf("#");
d=(e>-1)?d.substr(0,e)+c+d.substr(e):d+c;
return d;
},getWindowBounds:function(){return this._getCalculatedPopupBounds();
},toString:function(){return"[RadWindow id="+this.get_id()+"]";
},center:function(){var c=this._getCentralBounds();
this.moveTo(c.x,c.y);
},moveTo:function(h,f){var e=this._popupElement;
if(this.isVisible()){this._manageVisibilityFirefox(false);
}if(e){var c=$telerik.getBounds(e);
var g=this._getRestrictionZoneBounds();
if(g){var d=this._checkRestrictionZoneBounds(null,new Sys.UI.Bounds(h+g.x,f+g.y,c.width,c.height));
if(!d){return false;
}}}h=parseInt(h);
f=parseInt(f);
this._createUI();
this._setPopupVisible(h,f);
this._storeBounds();
if(this.isVisible()){this._manageVisibilityFirefox(true);
}return true;
},setSize:function(c,d){this._firstShow=false;
this.set_width(c);
this.set_height(d);
this._storeBounds();
},_calculateBoundsToFit:function(n,q){var e=this.get_minWidth();
var j=this._getTitleElement();
if(j){j.style.width="1px";
}var f;
var l;
n.style.height="1px";
n.style.width="1px";
if(this._dockMode){var r=n.scrollWidth;
l=r>e?r:e;
f=n.scrollHeight;
Sys.UI.DomElement.addCssClass(this._contentCell,"rwLoading");
}else{l=q.scrollWidth;
if(l0){c-=o;
}}var d=Math.min(m,t.width);
var k=Math.min(c,t.height);
var s=this.get_minWidth();
var p=this.get_minHeight();
var g=parseInt(this.get_maxHeight());
var h=parseInt(this.get_maxWidth());
if(s>d){d=s;
}if(p>k){k=p;
}if(g&&g0){this._contentElement.style.width=widthToSet+"px";
}},setHeightDockMode:function(c){if(!this._dockMode||!this.get_contentElement()){return;
}var g=this._substractWrappersBorder(c);
var f=this.isVisible();
var d=this._tableElement.rows[3].cells[1];
var e=this._tableElement.rows[0].cells[1];
var h=this._tableElement.rows[2].cells[1];
g-=f?parseInt($telerik.getBounds(d).height):parseInt($telerik.getCurrentStyle(d,"height"));
if(this._visibleTitlebar){g-=f?parseInt($telerik.getBounds(this._titlebarElement).height):parseInt($telerik.getCurrentStyle(this._titlebarElement,"height"));
g-=f?parseInt($telerik.getBounds(this._topResizer).height):parseInt($telerik.getCurrentStyle(this._topResizer,"height"));
}else{g-=f?parseInt($telerik.getBounds(e).height):parseInt($telerik.getCurrentStyle(e,"height"));
}if(this._visibleStatusbar){g-=f?parseInt($telerik.getBounds(h).height):parseInt($telerik.getCurrentStyle(h,"height"));
}if(g>0){this._contentElement.style.height=g+"px";
}},calcPosition:function(d,c,g,h,e){var i=d+Math.round((c-g)/2);
if(i<0||i+c>h){i=Math.round(Math.abs((h-g)/2));
if(this.isAutoSizeBehaviorEnabled(b.WindowAutoSizeBehaviors.Default)){var f=this._dockMode?window:this.BrowserWindow;
i+=e?Math.max(f.document.documentElement.scrollTop,f.document.body.scrollTop):Math.max(f.document.documentElement.scrollLeft,f.document.body.scrollLeft);
}}return i;
},_maintainMaximizedSize:function(){if(!this.isMaximized()){return;
}var j=this._popupElement;
if(!j){return;
}var d=this._getViewportBounds();
j.style.top=(d.scrollTop+d.y)+"px";
j.style.left=(d.scrollLeft+d.x)+"px";
var i=parseInt(this.get_maxWidth());
var g=parseInt(this.get_maxHeight());
if(i){d.width=i;
}if(g){d.height=g;
}$telerik.setSize(j,{width:d.width,height:d.height});
var k=this._getRestrictionZoneBounds();
if(!k){this._enablePageScrolling(false);
}var h=this._tableElement;
d=$telerik.getContentSize(j);
var c=$telerik.getBorderBox(h);
var f=$telerik.getPaddingBox(h);
var e=d.height-c.vertical-f.vertical;
h.style.height=e+"px";
this._fixIeHeight(h,e);
if(this._dockMode){this.setWidthDockMode(d.width);
this.setHeightDockMode(d.height);
}this._updateTitleWidth();
},_enablePageScrolling:function(e){var d=document.body;
var c=document.documentElement;
if(e){if(null!=this._documentOverflow){c.style.overflow=this._documentOverflow;
}if(null!=this._bodyOverflow){d.style.overflow=this._bodyOverflow;
}this._documentOverflow=null;
this._bodyOverflow=null;
}else{if(null==this._documentOverflow){this._documentOverflow=c.style.overflow;
}if(null==this._bodyOverflow){this._bodyOverflow=d.style.overflow;
}d.style.overflow="hidden";
c.style.overflow="hidden";
}},_getRestrictionZoneBounds:function(){var c=null;
if(this.get_restrictionZoneID()){var d=$get(this.get_restrictionZoneID());
if(d){c=$telerik.getBounds(d);
c.scrollLeft=0;
c.scrollTop=0;
}}return c;
},_storeBounds:function(){if(!this.isCreated()){return;
}var c=this._getCurrentBounds();
if(this.isMaximized()){return false;
}if(this.isMinimized()){if(this._restoreRect){c.width=this._restoreRect.width;
c.height=this._restoreRect.height;
}else{c.width=this.get_width();
c.height=this.get_height();
}}this._restoreRect=c;
},_restoreBounds:function(){if(!this._restoreRect){return;
}var c=this._restoreRect;
this.setSize(c.width,c.height);
this.moveTo(c.x,c.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 e=$telerik.getBounds(this._popupElement);
if(c){this._popupElement.style.display="none";
}var d=this._getRestrictionZoneBounds();
if(d){e.x-=d.x;
e.y-=d.y;
}return e;
},_getCentralBounds:function(){var e=this._getCurrentBounds();
var f=this._getViewportBounds();
var c=parseInt((f.width-e.width)/2);
var d=parseInt((f.height-e.height)/2);
e.x=c+f.scrollLeft;
e.y=d+f.scrollTop;
return e;
},_getViewportBounds:function(){var c=this._getRestrictionZoneBounds();
if(c){return c;
}var e=$telerik.getClientBounds();
var d=$telerik.getCorrectScrollLeft(document.documentElement)||$telerik.getCorrectScrollLeft(document.body);
var f=document.documentElement.scrollTop||document.body.scrollTop;
e.scrollLeft=d;
e.scrollTop=f;
if(this.isIE){if(e.width==0){e.width=document.body.clientWidth;
}if(e.height==0){e.height=document.body.clientHeight;
}}return e;
},_getCalculatedPopupBounds:function(){var f=this._getStoredBounds();
if(f){return f;
}var d=this._getCurrentBounds();
var e=this._offsetElement;
if(this._top==null&&this._left==null&&!e){d=this._getCentralBounds();
}else{if(e){d.y=0;
d.x=0;
}else{var h=this._getViewportBounds();
d.x=h.scrollLeft;
d.y=h.scrollTop;
}var c=this._left?this._left:0;
d.x+=c;
var g=this._top?this._top:0;
d.y+=g;
}return d;
},_checkRestrictionZoneBounds:function(c,d){var e=c;
if(!e){e=this._getRestrictionZoneBounds();
if(!e){return true;
}}return b.ResizeExtender.containsBounds(e,d);
},_reSetWindowPosition:function(){var c=this._getCalculatedPopupBounds();
this._setPopupVisible(c.x,c.y);
},_fixIeHeight:function(e,c){if("CSS1Compat"==document.compatMode){var f=(e.offsetHeight-parseInt(c));
if(f>0){var d=(parseInt(e.style.height)-f);
if(d>0){e.style.height=d+"px";
}}}},_setPopupVisible:function(c,d){var e=this._getRestrictionZoneBounds();
if(e){c+=e.x;
d+=e.y;
}this._popupBehavior._setCoordinates(c,d);
this._popupBehavior.show();
if(!this.get_width()){this._popupElement.style.width="";
}this._updateTitleWidth();
},_createDefaultTable:function(){var c=document.createElement("table");
c.align="left";
c.cellSpacing=0;
c.cellPadding=0;
c.insertRow(-1);
return c;
},_isWindowRightToLeft:function(){var e=this._isRightToLeft;
if(e==null){var c=this.get_element();
var d=c.parentNode?c:this._getDefaultParent();
e=this._isRightToLeft=$telerik.isRightToLeft(d);
}return e;
},_createStatusbarResizer:function(c){var d=c.rows[0].insertCell(-1);
d.style.width="15px";
var e=document.createElement("div");
d.appendChild(e);
this._bottomResizer=e;
},_createStatusbarMessageCell:function(c){var f=c.rows[0].insertCell(-1);
f.style.width="100%";
var d=this._getStatusMessageElement();
f.appendChild(d);
var e=document.createElement("label");
e.setAttribute("for",d.id);
e.innerHTML="status label";
e.style.display="none";
f.appendChild(e);
},_createUI:function(){if(!this._popupElement){var z=this.get_id();
var l="RadWindowWrapper_"+z;
var A=this._isWindowRightToLeft();
var t=document.createElement("div");
t.id=l;
t.className=this._getFullSkinName();
var v=this.get_cssClass();
if(v){Sys.UI.DomElement.addCssClass(t,v);
}if(A){Sys.UI.DomElement.addCssClass(t,"RadWindow_rtl");
}if(!this._visibleTitlebar){Sys.UI.DomElement.addCssClass(t,"rwNoTitleBar");
}t.style.width=this._width;
t.style.height=this._height;
t.setAttribute("unselectable","on");
this._popupElement=t;
var e=document.createElement("table");
e.cellSpacing=0;
e.cellPadding=0;
Sys.UI.DomElement.addCssClass(e,"rwTable");
this._tableElement=e;
var q=[];
if(A){q=["rwCorner rwTopRight","rwTitlebar","rwCorner rwTopLeft","rwCorner rwBodyRight","rwWindowContent","rwCorner rwBodyLeft","rwCorner rwBodyRight","rwStatusbar","rwCorner rwBodyLeft","rwCorner rwFooterRight","rwFooterCenter","rwCorner rwFooterLeft"];
}else{q=["rwCorner rwTopLeft","rwTitlebar","rwCorner rwTopRight","rwCorner rwBodyLeft","rwWindowContent","rwCorner rwBodyRight","rwCorner rwBodyLeft","rwStatusbar","rwCorner rwBodyRight","rwCorner rwFooterLeft","rwFooterCenter","rwCorner rwFooterRight"];
}var d=["rwTitleRow","rwContentRow","rwStatusbarRow","rwFooterRow"];
var u=0;
for(var B=0;
B<4;
B++){var s=e.insertRow(-1);
s.className=d[B];
for(var y=1;
y<=3;
y++){var m=s.insertCell(-1);
m.innerHTML=" ";
m.className=q[u];
u++;
}}var k=e.rows[0].cells[1];
k.innerHTML="";
this._titleCell=k;
var o=document.createElement("div");
o.className="rwTopResize";
o.innerHTML="";
this._topResizer=o;
this._titleCell.appendChild(this._topResizer);
var g=this._createDefaultTable();
g.className="rwTitlebarControls";
this._titlebarElement=g;
this._titleCell.appendChild(this._titlebarElement);
var f=this._getTitleIcon();
var p=this._titlebarElement.rows[0].insertCell(-1);
p.appendChild(f);
var h=this._getTitleElement();
var k=this._titlebarElement.rows[0].insertCell(-1);
k.appendChild(h);
k.id=this.get_id()+"_title";
this.set_title(this._title);
var x=this._titlebarElement.rows[0].insertCell(-1);
x.noWrap=true;
x.style.whiteSpace="nowrap";
x.appendChild(this._getTitleCommandButtonsHolder());
var C=e.rows[1].cells[1];
C.vAlign="top";
C.innerHTML="";
this._contentCell=C;
if(!(this._dockMode||this._isPredefined)){Sys.UI.DomElement.addCssClass(this._contentCell,"rwExternalContent");
}if(this._enableShadow&&!$telerik.isIE6){this._setShadowCSSClass(true);
}var w=this.get_name();
var c=this._createDefaultTable();
c.style.width="100%";
this._statusCell=e.rows[2].cells[1];
this._statusCell.innerHTML="";
this._statusCell.appendChild(c);
if(A){this._createStatusbarResizer(c);
this._createStatusbarMessageCell(c);
}else{this._createStatusbarMessageCell(c);
this._createStatusbarResizer(c);
}this._popupElement.appendChild(this._tableElement);
this._popupElement.style.display="none";
this._popupElement.style.position="absolute";
this._addWindowToDocument();
this._registerTitlebarHandlers(true);
this.set_visibleTitlebar(this._visibleTitlebar);
this.set_visibleStatusbar(this._visibleStatusbar);
if(this._dockMode){var n=$get(this.get_id()+"_C");
if(n&&n.innerHTML){n.style.overflow="auto";
n.style.border="0px";
this.set_contentElement(n);
this.setWidthDockMode(this.get_width());
this.setHeightDockMode(this.get_height());
}}else{var r=($telerik.isIE&&!$telerik.isIE9)?document.createElement("