FCK.Description="FCKeditor for Internet Explorer 5.5+";FCK._GetBehaviorsStyle=function(){if(!FCK._BehaviorsStyle){varA=FCKConfig.FullBasePath;varB='';varC;C='<style type="text/css" _fcktemp="true">';if(FCKConfig.ShowBorders)B='url('+A+'css/behaviors/showtableborders.htc)';C+='INPUT,TEXTAREA,SELECT,.FCK__Anchor,.FCK__PageBreak,.FCK__InputHidden';if(FCKConfig.DisableObjectResizing){C+=',IMG';B+=' url('+A+'css/behaviors/disablehandles.htc)';};C+=' { behavior: url('+A+'css/behaviors/disablehandles.htc) ; }';if(B.length>0)C+='TABLE { behavior: '+B+' ; }';C+='</style>';FCK._BehaviorsStyle=C;};returnFCK._BehaviorsStyle;};functionDoc_OnMouseUp(){if(FCK.EditorWindow.event.srcElement.tagName=='HTML'){FCK.Focus();FCK.EditorWindow.event.cancelBubble=true;FCK.EditorWindow.event.returnValue=false;}};functionDoc_OnPaste(){return(FCK.Status==2&&FCK.Events.FireEvent("OnPaste"));};functionDoc_OnKeyDown(){if(FCK.EditorWindow){vare=FCK.EditorWindow.event;if(!(e.keyCode>=16&&e.keyCode<=18))Doc_OnKeyDownUndo();};returntrue;};functionDoc_OnKeyDownUndo(){if(!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;if(FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}};functionDoc_OnDblClick(){FCK.OnDoubleClick(FCK.EditorWindow.event.srcElement);FCK.EditorWindow.event.cancelBubble=true;};functionDoc_OnSelectionChange(){FCK.Events.FireEvent("OnSelectionChange");};FCK.InitializeBehaviors=function(A){this.EditorDocument.attachEvent('onmouseup',Doc_OnMouseUp);this.EditorDocument.body.attachEvent('onpaste',Doc_OnPaste);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument.body);if(FCKConfig.TabSpaces>0){window.FCKTabHTML='';for(i=0;i<FCKConfig.TabSpaces;i++)window.FCKTabHTML+=" ";};this.EditorDocument.attachEvent("onkeydown",Doc_OnKeyDown);this.EditorDocument.attachEvent("ondblclick",Doc_OnDblClick);this.EditorDocument.attachEvent("onselectionchange",Doc_OnSelectionChange);};FCK.InsertHtml=function(A){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCK.EditorWindow.focus();FCKUndo.SaveUndoStep();varB=FCK.EditorDocument.selection;if(B.type.toLowerCase()=='control')B.clear();B.createRange().pasteHTML(A);FCKDocumentProcessor.Process(FCK.EditorDocument);};FCK.SetInnerHtml=function(A){varB=FCK.EditorDocument;B.body.innerHTML='<div id="__fakeFCKRemove__"> </div>'+A;B.getElementById('__fakeFCKRemove__').removeNode(true);};functionFCK_PreloadImages(){varA=newFCKImagePreloader();A.AddImages(FCKConfig.PreloadImages);A.AddImages(FCKConfig.SkinPath+'fck_strip.gif');A.OnComplete=LoadToolbarSetup;A.Start();};functionDocument_OnContextMenu(){return(event.srcElement._FCKShowContextMenu==true);};document.oncontextmenu=Document_OnContextMenu;functionFCK_Cleanup(){this.EditorWindow=null;this.EditorDocument=null;};FCK.Paste=function(){if(FCK._PasteIsRunning)returntrue;if(FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();returnfalse;};varA=FCK._CheckIsPastingEnabled(true);if(A===false)FCKTools.RunFunction(FCKDialog.OpenDialog,FCKDialog,['FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security']);else{if(FCKConfig.AutoDetectPasteFromWord&&A.length>0){varB=/<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi;if(B.test(A)){if(confirm(FCKLang.PasteWordConfirm)){FCK.PasteFromWord();returnfalse;}}};FCK._PasteIsRunning=true;FCK.ExecuteNamedCommand('Paste');deleteFCK._PasteIsRunning;};returnfalse;};FCK.PasteAsPlainText=function(){if(!FCK._CheckIsPastingEnabled()){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText');return;};varA=clipboardData.getData("Text");if(A&&A.length>0){A=FCKTools.HTMLEncode(A).replace(/\n/g,'<BR>');this.InsertHtml(A);}};FCK._CheckIsPastingEnabled=function(A){FCK._PasteIsEnabled=false;document.body.attachEvent('onpaste',FCK_CheckPasting_Listener);varB=FCK.GetClipboardHTML();document.body.detachEvent('onpaste',FCK_CheckPasting_Listener);if(FCK._PasteIsEnabled){if(!A)B=true;}elseB=false;deleteFCK._PasteIsEnabled;returnB;};functionFCK_CheckPasting_Listener(){FCK._PasteIsEnabled=true;};FCK.InsertElement=function(A){FCK.InsertHtml(A.outerHTML);};FCK.GetClipboardHTML=function(){varA=document.getElementById('___FCKHiddenDiv');if(!A){A=document.createElement('DIV');A.id='___FCKHiddenDiv';varB=A.style;B.position='absolute';B.visibility=B.overflow='hidden';B.width=B.height=1;document.body.appendChild(A);};A.innerHTML='';varC=document.body.createTextRange();C.moveToElementText(A);C.execCommand('Paste');varD=A.innerHTML;A.innerHTML='';returnD;};FCK.AttachToOnSelectionChange=function(A){this.Events.AttachEvent('OnSelectionChange',A);};FCK.CreateLink=function(A){FCK.ExecuteNamedCommand('Unlink');if(A.length>0){varB='javascript:void(0);/*'+(newDate().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',B);varC=this.EditorDocument.links;for(i=0;i<C.length;i++){varD=C[i];if(D.href==B){varE=D.innerHTML;D.href=A;D.innerHTML=E;returnD;}}};returnnull;};
varFCKConfig=FCK.Config={};if(document.location.protocol=='file:'){FCKConfig.BasePath=decodeURIComponent(document.location.pathname.substr(1));FCKConfig.BasePath=FCKConfig.BasePath.replace(/\\/gi,'/');FCKConfig.BasePath='file://'+FCKConfig.BasePath.substring(0,FCKConfig.BasePath.lastIndexOf('/')+1);FCKConfig.FullBasePath=FCKConfig.BasePath;}else{FCKConfig.BasePath=document.location.pathname.substring(0,document.location.pathname.lastIndexOf('/')+1);FCKConfig.FullBasePath=document.location.protocol+'//'+document.location.host+FCKConfig.BasePath;};FCKConfig.EditorPath=FCKConfig.BasePath.replace(/editor\/$/,'');try{FCKConfig.ScreenWidth=screen.width;FCKConfig.ScreenHeight=screen.height;}catch(e){FCKConfig.ScreenWidth=800;FCKConfig.ScreenHeight=600;};FCKConfig.ProcessHiddenField=function(){this.PageConfig={};varA=window.parent.document.getElementById(FCK.Name+'___Config');if(!A)return;varB=A.value.split('&');for(vari=0;i<B.length;i++){if(B[i].length==0)continue;varC=B[i].split('=');varD=decodeURIComponent(C[0]);varE=decodeURIComponent(C[1]);if(D=='CustomConfigurationsPath')FCKConfig[D]=E;elseif(E.toLowerCase()=="true")this.PageConfig[D]=true;elseif(E.toLowerCase()=="false")this.PageConfig[D]=false;elseif(E.length>0&&!isNaN(E))this.PageConfig[D]=parseInt(E,10);elsethis.PageConfig[D]=E;}};functionFCKConfig_LoadPageConfig(){varA=FCKConfig.PageConfig;for(varBinA)FCKConfig[B]=A[B];};functionFCKConfig_PreProcess(){varA=FCKConfig;if(A.AllowQueryStringDebug){try{if((/fckdebug=true/i).test(window.top.location.search))A.Debug=true;}catch(e){/*Ignore it. Much probably we are inside a FRAME where the "top" is in another domain (security error).*/}};if(!A.PluginsPath.EndsWith('/'))A.PluginsPath+='/';if(typeof(A.EditorAreaCSS)=='string')A.EditorAreaCSS=[A.EditorAreaCSS];varB=A.ToolbarComboPreviewCSS;if(!B||B.length==0)A.ToolbarComboPreviewCSS=A.EditorAreaCSS;elseif(typeof(B)=='string')A.ToolbarComboPreviewCSS=[B];};FCKConfig.ToolbarSets={};FCKConfig.Plugins={};FCKConfig.Plugins.Items=[];FCKConfig.Plugins.Add=function(A,B,C){FCKConfig.Plugins.Items.AddItem([A,B,C]);};FCKConfig.ProtectedSource={};FCKConfig.ProtectedSource.RegexEntries=[/<!--[\s\S]*?-->/g,/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi];FCKConfig.ProtectedSource.Add=function(A){this.RegexEntries.AddItem(A);};FCKConfig.ProtectedSource.Protect=function(A){function_Replace(protectedSource){varB=FCKTempBin.AddElement(protectedSource);return'<!--{PS..'+B+'}-->';};for(vari=0;i<this.RegexEntries.length;i++){A=A.replace(this.RegexEntries[i],_Replace);};returnA;};FCKConfig.ProtectedSource.Revert=function(A,B){function_Replace(m,opener,index){varC=B?FCKTempBin.RemoveElement(index):FCKTempBin.Elements[index];returnFCKConfig.ProtectedSource.Revert(C,B);};returnA.replace(/(<|<)!--\{PS..(\d+)\}--(>|>)/g,_Replace);}
varFCKXHtml={};FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKXHtmlEntities.Initialize();this._NbspEntity=(FCKConfig.ProcessHTMLEntities?'nbsp':'#160');varD=FCK.IsDirty();this._CreateNode=FCKConfig.ForceStrongEm?FCKXHtml_CreateNode_StrongEm:FCKXHtml_CreateNode_Normal;FCKXHtml.SpecialBlocks=[];this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if(B)this._AppendNode(this.MainNode,A);elsethis._AppendChildNodes(this.MainNode,A,false);varE=this._GetMainXmlString();this.XML=null;E=E.substr(7,E.length-15).Trim();if(FCKBrowserInfo.IsGecko)E=E.replace(/<br\/>$/,'');E=E.replace(FCKRegexLib.SpaceNoClose,' />');if(FCKConfig.ForceSimpleAmpersand)E=E.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if(C)E=FCKCodeFormatter.Format(E);for(vari=0;i<FCKXHtml.SpecialBlocks.length;i++){varF=newRegExp('___FCKsi___'+i);E=E.replace(F,FCKXHtml.SpecialBlocks[i]);};E=E.replace(FCKRegexLib.GeckoEntitiesMarker,'&');if(!D)FCK.ResetIsDirty();returnE;};FCKXHtml._AppendAttribute=function(A,B,C){try{if(C==undefined||C==null)C='';elseif(C.replace){if(FCKConfig.ForceSimpleAmpersand)C=C.replace(/&/g,'___FCKAmp___');C=C.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity);};varD=this.XML.createAttribute(B);D.value=C;A.attributes.setNamedItem(D);}catch(e){}};FCKXHtml._AppendChildNodes=function(A,B,C){if(C)FCKDomTools.TrimNode(B,true);varD=0;varE=B.firstChild;while(E){if(this._AppendNode(A,E))D++;E=E.nextSibling;};if(D==0){if(C&&FCKConfig.FillEmptyBlocks){this._AppendEntity(A,this._NbspEntity);returnA;};varF=A.nodeName;if(FCKListsLib.InlineChildReqElements[F])returnnull;if(!FCKListsLib.EmptyElements[F])A.appendChild(this.XML.createTextNode(''));};returnA;};FCKXHtml._AppendNode=function(A,B){if(!B)returnfalse;switch(B.nodeType){case1:if(B.getAttribute('_fckfakelement'))returnFCKXHtml._AppendNode(A,FCK.GetRealElement(B));if(FCKBrowserInfo.IsGecko&&B.hasAttribute('_moz_editor_bogus_node'))returnfalse;if(B.getAttribute('_fcktemp'))returnfalse;varC=B.tagName.toLowerCase();if(FCKBrowserInfo.IsIE){if(B.scopeName&&B.scopeName!='HTML'&&B.scopeName!='FCK')C=B.scopeName.toLowerCase()+':'+C;}else{if(C.StartsWith('fck:'))C=C.Remove(0,4);};if(!FCKRegexLib.ElementName.test(C))returnfalse;if(C=='br'&&B.getAttribute('type',2)=='_moz')returnfalse;if(B._fckxhtmljob&&B._fckxhtmljob==FCKXHtml.CurrentJobNum)returnfalse;varD=this._CreateNode(C);FCKXHtml._AppendAttributes(A,B,D,C);B._fckxhtmljob=FCKXHtml.CurrentJobNum;varE=FCKXHtml.TagProcessors[C];if(E)D=E(D,B,A);elseD=this._AppendChildNodes(D,B,Boolean(FCKListsLib.NonEmptyBlockElements[C]));if(!D)returnfalse;A.appendChild(D);break;case3:returnthis._AppendTextNode(A,B.nodeValue.ReplaceNewLineChars(' '));case8:if(FCKBrowserInfo.IsIE&&!B.innerHTML)break;try{A.appendChild(this.XML.createComment(B.nodeValue));}catch(e){/*Do nothing... probably this is a wrong format comment.*/};break;default:A.appendChild(this.XML.createComment("Element not supported - Type: "+B.nodeType+" Name: "+B.nodeName));break;};returntrue;};functionFCKXHtml_CreateNode_StrongEm(A){switch(A){case'b':A='strong';break;case'i':A='em';break;};returnthis.XML.createElement(A);};functionFCKXHtml_CreateNode_Normal(A){returnthis.XML.createElement(A);};FCKXHtml._AppendSpecialItem=function(A){return'___FCKsi___'+FCKXHtml.SpecialBlocks.AddItem(A);};FCKXHtml._AppendEntity=function(A,B){A.appendChild(this.XML.createTextNode('#?-:'+B+';'));};FCKXHtml._AppendTextNode=function(A,B){varC=B.length>0;if(C)A.appendChild(this.XML.createTextNode(B.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity)));returnC;};functionFCKXHtml_GetEntity(A){varB=FCKXHtmlEntities.Entities[A]||('#'+A.charCodeAt(0));return'#?-:'+B+';';};FCKXHtml._RemoveAttribute=function(A,B,C){varD=A.attributes.getNamedItem(C);if(D&&B.test(D.nodeValue)){varE=D.nodeValue.replace(B,'');if(E.length==0)A.attributes.removeNamedItem(C);elseD.nodeValue=E;}};FCKXHtml.TagProcessors={img:function(A,B){if(!A.attributes.getNamedItem('alt'))FCKXHtml._AppendAttribute(A,'alt','');varC=B.getAttribute('_fcksavedurl');if(C!=null)FCKXHtml._AppendAttribute(A,'src',C);returnA;},a:function(A,B){if(B.innerHTML.Trim().length==0&&!B.name)returnfalse;varC=B.getAttribute('_fcksavedurl');if(C!=null)FCKXHtml._AppendAttribute(A,'href',C);if(FCKBrowserInfo.IsIE){FCKXHtml._RemoveAttribute(A,FCKRegexLib.FCK_Class,'class');if(B.name)FCKXHtml._AppendAttribute(A,'name',B.name);};A=FCKXHtml._AppendChildNodes(A,B,false);returnA;},script:function(A,B){if(!A.attributes.getNamedItem('type'))FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));returnA;},style:function(A,B){if(!A.attributes.getNamedItem('type'))FCKXHtml._AppendAttribute(A,'type','text/css');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.innerHTML)));returnA;},title:function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));returnA;},table:function(A,B){if(FCKBrowserInfo.IsIE)FCKXHtml._RemoveAttribute(A,FCKRegexLib.FCK_Class,'class');A=FCKXHtml._AppendChildNodes(A,B,false);returnA;},ol:function(A,B,C){if(B.innerHTML.Trim().length==0)returnfalse;varD=C.lastChild;if(D&&D.nodeType==3)D=D.previousSibling;if(D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);returnfalse;};A=FCKXHtml._AppendChildNodes(A,B);returnA;},span:function(A,B){if(B.innerHTML.length==0)returnfalse;A=FCKXHtml._AppendChildNodes(A,B,false);returnA;},iframe:function(A,B){varC=B.innerHTML;if(FCKBrowserInfo.IsGecko)C=FCKTools.HTMLDecode(C);C=C.replace(/\s_fcksavedurl="[^"]*"/g,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));returnA;}};FCKXHtml.TagProcessors.ul=FCKXHtml.TagProcessors.ol;
varFCKXml=function(){this.Error=false;};FCKXml.prototype.LoadUrl=function(A){this.Error=false;varB=FCKTools.CreateXmlObject('XmlHttp');if(!B){this.Error=true;return;};B.open("GET",A,false);B.send(null);if(B.status==200||B.status==304)this.DOMDocument=B.responseXML;elseif(B.status==0&&B.readyState==4){this.DOMDocument=FCKTools.CreateXmlObject('DOMDocument');this.DOMDocument.async=false;this.DOMDocument.resolveExternals=false;this.DOMDocument.loadXML(B.responseText);}else{this.DOMDocument=null;};if(this.DOMDocument==null||this.DOMDocument.firstChild==null){this.Error=true;if(window.confirm('Error loading "'+A+'"\r\nDo you want to see more info?'))alert('URL requested: "'+A+'"\r\nServer response:\r\nStatus: '+B.status+'\r\nResponse text:\r\n'+B.responseText);}};FCKXml.prototype.SelectNodes=function(A,B){if(this.Error)return[];if(B)returnB.selectNodes(A);elsereturnthis.DOMDocument.selectNodes(A);};FCKXml.prototype.SelectSingleNode=function(A,B){if(this.Error)returnnull;if(B)returnB.selectSingleNode(A);elsereturnthis.DOMDocument.selectSingleNode(A);}