﻿Type.registerNamespace("AjaxControlToolkit.HTMLEditor");AjaxControlToolkit.HTMLEditor.ModePanel=function(b){var a=this;AjaxControlToolkit.HTMLEditor.ModePanel.initializeBase(a,[b]);a._activated=false;a._isActivating=false;a._editPanel=null;a._cachedContent=null;a._onbeforeunload$delegate=Function.createDelegate(a,a._onbeforeunload)};AjaxControlToolkit.HTMLEditor.ModePanel.prototype={set_editPanel:function(a){this._editPanel=a},get_content:function(){var a=this;if(a._activated)return a._getContent();else if(a._cachedContent!=null)return a._cachedContent;else return ""},set_content:function(b){var a=this;a._cachedContent=b;if(!a._activated&&!a._isActivating)a._activate(b);else if(!a._isActivating)a._setContent(b);else{var c=a;setTimeout(function(){c.set_content(b)},10);return false}return true},_activate:function(){this.get_element().style.display="";this._isActivating=true},_activateFinished:function(){var a=this;a._activated=true;a._isActivating=false;a._editPanel._setActive();if(a._editPanel.get_autofocus())a._focus()},_deactivate:function(){this.get_element().style.display="none";this._activated=false;this._isActivating=false},initialize:function(){AjaxControlToolkit.HTMLEditor.ModePanel.callBaseMethod(this,"initialize");if(AjaxControlToolkit.HTMLEditor.isIE)$addHandlers(window,{beforeunload:this._onbeforeunload$delegate})},dispose:function(){var a=this;if(AjaxControlToolkit.HTMLEditor.isIE)$common.removeHandlers(window,{beforeunload:a._onbeforeunload$delegate});if(a._activated&&!AjaxControlToolkit.HTMLEditor.isIE){a._onbeforeunload();a._deactivate()}AjaxControlToolkit.HTMLEditor.ModePanel.callBaseMethod(a,"dispose")},_onbeforeunload:function(){var a=this;if(a._activated)if(!a._editPanel._contentPrepared){a._editPanel._prepareContentForPostback(a.get_content());a._editPanel._contentPrepared=true}},_getContent:function(){if(this._cachedContent!=null)return this._cachedContent;else return ""},_setContent:function(){},_focus:function(){this._focused()},_focused:function(a){this._editPanel._focused(a);this._editPanel.set_autofocus(true)},_really_focused:function(){this._editPanel._really_focused();this._editPanel.set_autofocus(true)}};AjaxControlToolkit.HTMLEditor.ModePanel.registerClass("AjaxControlToolkit.HTMLEditor.ModePanel",Sys.UI.Control);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();