﻿Type.registerNamespace("AjaxControlToolkit.HTMLEditor");AjaxControlToolkit.HTMLEditor.PreviewPanel=function(b){var a=this;AjaxControlToolkit.HTMLEditor.PreviewPanel.initializeBase(a,[b]);a._focus$delegate=Function.createDelegate(a,a._focus_event);a._blur$delegate=Function.createDelegate(a,a._blur_event);a._doc=null;a._content="";a._panel_timer=null};AjaxControlToolkit.HTMLEditor.PreviewPanel.prototype={_focus:function(){try{this.get_element().contentWindow.focus()}catch(a){}this._focused()},_focus_event:function(){var a=this;if(a._panel_timer==null){var c=a.get_element().contentWindow,b=a;a._really_focused();a._panel_timer=setTimeout(function(){c.focus();b._really_focused();b._panel_timer=null},0)}return true},_blur_event:function(){if(this._panel_timer!=null){clearTimeout(this._panel_timer);this._panel_timer=null}return true},_activate:function(b){var a=this;AjaxControlToolkit.HTMLEditor.PreviewPanel.callBaseMethod(a,"_activate");a._content=b;a._wasFocused=false;a._initIframe(b);AjaxControlToolkit.HTMLEditor._addEvents(a.get_element().contentWindow,["focus"],a._focus$delegate);AjaxControlToolkit.HTMLEditor._addEvents(a.get_element().contentWindow,["blur"],a._blur$delegate);a._activateFinished()},_deactivate:function(){var a=this;AjaxControlToolkit.HTMLEditor._removeEvents(a.get_element().contentWindow,["blur"],a._blur$delegate);AjaxControlToolkit.HTMLEditor._removeEvents(a.get_element().contentWindow,["focus"],a._focus$delegate);if(AjaxControlToolkit.HTMLEditor.isIE)try{a._doc.open();a._doc.write("");a._doc.close();a.get_element().src="javascript:false;"}catch(b){}a._doc=null;a._content="";AjaxControlToolkit.HTMLEditor.PreviewPanel.callBaseMethod(a,"_deactivate")},_initIframe:function(c){var a=this,b=AjaxControlToolkit.HTMLEditor.Trim(c);a._doc=a.get_element().contentWindow.document;if(AjaxControlToolkit.HTMLEditor.isIE)b=b.replace(/&amp;/ig,"&");a._doc.open();a._doc.write('<html><head><link rel="stylesheet" href="'+a._editPanel.get_documentCssPath()+'" media="all" /></head><body>'+b+"</body></html>");a._doc.close()},_getContent:function(){return this._content},_setContent:function(a){this._content=a;this._initIframe(a)}};AjaxControlToolkit.HTMLEditor.PreviewPanel.registerClass("AjaxControlToolkit.HTMLEditor.PreviewPanel",AjaxControlToolkit.HTMLEditor.ModePanel);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();