Type.registerNamespace("Sys.Extended.UI.HtmlEditor");Sys.Extended.UI.HtmlEditor.PreviewPanel=function(n){Sys.Extended.UI.HtmlEditor.PreviewPanel.initializeBase(this,[n]);this._focus$delegate=Function.createDelegate(this,this._focus_event);this._blur$delegate=Function.createDelegate(this,this._blur_event);this._doc=null;this._content="";this._panel_timer=null};Sys.Extended.UI.HtmlEditor.PreviewPanel.prototype={_focus:function(){try{this.get_element().contentWindow.focus()}catch(n){}this._focused()},_focus_event:function(){if(this._panel_timer==null){var t=this.get_element().contentWindow,n=this;this._really_focused();this._panel_timer=setTimeout(function(){t.focus();n._really_focused();n._panel_timer=null},0)}return!0},_blur_event:function(){return this._panel_timer!=null&&(clearTimeout(this._panel_timer),this._panel_timer=null),!0},_activate:function(n){Sys.Extended.UI.HtmlEditor.PreviewPanel.callBaseMethod(this,"_activate");this._content=n;this._wasFocused=!1;this._initIframe(n);Sys.Extended.UI.HtmlEditor._addEvents(this.get_element().contentWindow,["focus"],this._focus$delegate);Sys.Extended.UI.HtmlEditor._addEvents(this.get_element().contentWindow,["blur"],this._blur$delegate);this._activateFinished()},_deactivate:function(){if(Sys.Extended.UI.HtmlEditor._removeEvents(this.get_element().contentWindow,["blur"],this._blur$delegate),Sys.Extended.UI.HtmlEditor._removeEvents(this.get_element().contentWindow,["focus"],this._focus$delegate),Sys.Extended.UI.HtmlEditor.isIE)try{this._doc.open();this._doc.write("");this._doc.close();this.get_element().src="javascript:false;"}catch(n){}this._doc=null;this._content="";Sys.Extended.UI.HtmlEditor.PreviewPanel.callBaseMethod(this,"_deactivate")},_initIframe:function(n){var t=Sys.Extended.UI.HtmlEditor.Trim(n);this._doc=this.get_element().contentWindow.document;Sys.Extended.UI.HtmlEditor.isIE&&(t=t.replace(/&/ig,"&"));this._doc.open();this._doc.write('
<\/head>'+t+"<\/body><\/html>");this._doc.close()},_getContent:function(){return this._content},_setContent:function(n){this._content=n;this._initIframe(n)}};Sys.Extended.UI.HtmlEditor.PreviewPanel.registerClass("Sys.Extended.UI.HtmlEditor.PreviewPanel",Sys.Extended.UI.HtmlEditor.ModePanel);