var FCKeditor=function(B,D,A,C,E){this.InstanceName=B;this.Width=D||"100%";this.Height=A||"200";this.ToolbarSet=C||"Default";this.Value=E||"";this.BasePath="/fckeditor/";this.CheckBrowser=true;this.DisplayErrors=true;this.EnableSafari=false;this.EnableOpera=false;this.Config=new Object();this.OnError=null;this.FCK=null};FCKeditor.prototype.Version="2.3.1";FCKeditor.prototype.VersionBuild="1062";FCKeditor.prototype.Create=function(){if(!this.InstanceName||this.InstanceName.length==0){this._ThrowError(701,"You must specify an instance name.");return }document.write("<div>");if(!this.CheckBrowser||this._IsCompatibleBrowser()){document.write('<input type="hidden" id="'+this.InstanceName+'" name="'+this.InstanceName+'" value="'+this._HTMLEncode(this.Value)+'" style="display:none" />');document.write(this._GetConfigHtml());document.write(this._GetIFrameHtml())}else{var B=this.Width.toString().indexOf("%")>0?this.Width:this.Width+"px";var A=this.Height.toString().indexOf("%")>0?this.Height:this.Height+"px";document.write('<textarea name="'+this.InstanceName+'" rows="4" cols="40" style="WIDTH: '+B+"; HEIGHT: "+A+'">'+this._HTMLEncode(this.Value)+"</textarea>")}document.write("</div>")};FCKeditor.prototype.ReplaceTextarea=function(){if(!this.CheckBrowser||this._IsCompatibleBrowser()){var C=document.getElementById(this.InstanceName);var B=document.getElementsByName(this.InstanceName);var A=0;while(C||A==0){if(C&&C.tagName=="TEXTAREA"){break}C=B[A++]}if(!C){alert('Error: The TEXTAREA with id or name set to "'+this.InstanceName+'" was not found');return }C.style.display="none";this._InsertHtmlBefore(this._GetConfigHtml(),C);this._InsertHtmlBefore(this._GetIFrameHtml(),C)}};FCKeditor.prototype._InsertHtmlBefore=function(C,B){if(B.insertAdjacentHTML){B.insertAdjacentHTML("beforeBegin",C)}else{var D=document.createRange();D.setStartBefore(B);var A=D.createContextualFragment(C);B.parentNode.insertBefore(A,B)}};FCKeditor.prototype._GetConfigHtml=function(){var A="";for(var B in this.Config){if(A.length>0){A+="&amp;"}A+=escape(B)+"="+escape(this.Config[B])}return'<input type="hidden" id="'+this.InstanceName+'___Config" value="'+A+'" style="display:none" />'};FCKeditor.prototype._GetIFrameHtml=function(){var B="fckeditor.html";var A=this.BasePath+"editor/"+B+"?InstanceName="+this.InstanceName;if(this.ToolbarSet){A+="&Toolbar="+this.ToolbarSet}return'<iframe id="'+this.InstanceName+'___Frame" src="'+A+'" width="'+this.Width+'" height="'+this.Height+'" frameborder="0" scrolling="no"></iframe>'};FCKeditor.prototype._IsCompatibleBrowser=function(){var B=navigator.userAgent.toLowerCase();if(B.indexOf("msie")!=-1&&B.indexOf("mac")==-1&&B.indexOf("opera")==-1){var A=navigator.appVersion.match(/MSIE (.\..)/)[1];return(A>=5.5)}if(navigator.product=="Gecko"&&navigator.productSub>=20030210&&!(typeof (opera)=="object"&&opera.postError)){return true}if(this.EnableOpera&&navigator.appName=="Opera"&&parseInt(navigator.appVersion)>=9){return true}if(this.EnableSafari&&B.indexOf("safari")!=-1){return(B.match(/safari\/(\d+)/)[1]>=312)}return false};FCKeditor.prototype._ThrowError=function(B,A){this.ErrorNumber=B;this.ErrorDescription=A;if(this.DisplayErrors){document.write('<div style="COLOR: #ff0000">');document.write("[ FCKeditor Error "+this.ErrorNumber+": "+this.ErrorDescription+" ]");document.write("</div>")}if(typeof (this.OnError)=="function"){this.OnError(this,B,A)}};FCKeditor.prototype._HTMLEncode=function(A){if(typeof (A)!="string"){A=A.toString()}A=A.replace(/&/g,"&amp;");A=A.replace(/"/g,"&quot;");A=A.replace(/</g,"&lt;");A=A.replace(/>/g,"&gt;");A=A.replace(/'/g,"&#39;");return A};FCKeditor.prototype.getTextareaValue=function(){if(this.FCK!=null){return this.FCK.GetHTML()}var C=null;for(var B=0;B<window.frames.length;B++){C=window.frames[B];try{if(C.FCK!=null&&C.FCK.Name==this.InstanceName){break}}catch(A){}}if(C!=null){this.FCK=C.FCK;return C.FCK.GetHTML()}return""};FCKeditor.prototype.setTextareaValue=function(C){if(this.FCK!=null){this.FCK.SetHTML(C)}else{var D=null;for(var B=0;B<window.frames.length;B++){D=window.frames[B];try{if(D.FCK!=null&&D.FCK.Name==this.InstanceName){break}}catch(A){}}if(D!=null){this.FCK=D.FCK;this.FCK.SetHTML(C)}}};FCKeditor.prototype.checkValue=function(){try{if(this.checkObject()){return true}if(this.checkScript()){return true}if(this.checkIframe()){return true}var F=/onerror.*?=.*?".*?"/ig;var E=/onerror.*?=.*?'.*?'/ig;var D=/onload.*?=.*?".*?"/ig;var B=/onload.*?=.*?'.*?'/ig;var A=this.getTextareaValue();if(F.test(A)||E.test(A)||D.test(A)||B.test(A)){if(confirm("\u5185\u5bb9\u4e2d\u4e0d\u5141\u8bb8\u51fa\u73b0onload onerror\u6807\u7b7e\uff0c\u7cfb\u7edf\u5c06\u81ea\u52a8\u53bb\u9664\u6240\u6709onload onerror\u6807\u7b7e\n'\u786e\u5b9a'\u7cfb\u7edf\u81ea\u52a8\u53bb\u9664,'\u53d6\u6d88'\u7ee7\u7eed\u7f16\u8f91\u5185\u5bb9")){A=A.replace(F,"");A=A.replace(E,"");A=A.replace(D,"");A=A.replace(B,"");this.FCK.SetHTML(A);return false}return true}else{return false}}catch(C){}return true};FCKeditor.prototype.checkObject=function(){var A=this.getTextareaValue();var D=/<.*?object.*?<.*?\/.*?object.*?>/ig;var C=/<.*?object.*?>/ig;try{if(D.test(A)||C.test(A)){if(confirm("\u5185\u5bb9\u4e2d\u4e0d\u5141\u8bb8\u51fa\u73b0object\u6807\u7b7e\uff0c\u7cfb\u7edf\u5c06\u81ea\u52a8\u53bb\u9664\u6240\u6709object\u6807\u7b7e\n'\u786e\u5b9a'\u7cfb\u7edf\u81ea\u52a8\u53bb\u9664,'\u53d6\u6d88'\u7ee7\u7eed\u7f16\u8f91\u5185\u5bb9")){A=A.replace(D,"");A=A.replace(C,"");this.FCK.SetHTML(A);return false}return true}else{return false}}catch(B){}return true};FCKeditor.prototype.checkScript=function(){var A=this.getTextareaValue();var C=/<.*?SCRIPT.*?>/ig;var D=/<.*?SCRIPT.*?<.*?\/.*?SCRIPT.*?>/ig;try{if(D.test(A)||C.test(A)){if(confirm("\u5185\u5bb9\u4e2d\u4e0d\u5141\u8bb8\u51fa\u73b0script\u6807\u7b7e\uff0c\u7cfb\u7edf\u5c06\u81ea\u52a8\u53bb\u9664\u6240\u6709script\u6807\u7b7e\n'\u786e\u5b9a'\u7cfb\u7edf\u81ea\u52a8\u53bb\u9664,'\u53d6\u6d88'\u7ee7\u7eed\u7f16\u8f91\u5185\u5bb9")){A=A.replace(D,"");A=A.replace(C,"");this.FCK.SetHTML(A);return false}return true}else{return false}}catch(B){}return true};FCKeditor.prototype.checkIframe=function(){var A=this.getTextareaValue();var C=/<.*?iframe.*?>/ig;var D=/<.*?iframe.*?<.*?\/.*?iframe.*?>/ig;try{if(D.test(A)||C.test(A)){if(confirm("\u5185\u5bb9\u4e2d\u4e0d\u5141\u8bb8\u51fa\u73b0iframe\u6807\u7b7e\uff0c\u7cfb\u7edf\u5c06\u81ea\u52a8\u53bb\u9664\u6240\u6709iframe\u6807\u7b7e\n'\u786e\u5b9a'\u7cfb\u7edf\u81ea\u52a8\u53bb\u9664,'\u53d6\u6d88'\u7ee7\u7eed\u7f16\u8f91\u5185\u5bb9")){A=A.replace(D,"");A=A.replace(C,"");this.FCK.SetHTML(A);return false}return true}else{return false}}catch(B){}return true};