rem: var FCKXHtml=new Object();FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKXHtmlEntities.Initialize();this._CreateNode=FCKConfig.ForceStrongEm?FCKXHtml_CreateNode_StrongEm:FCKXHtml_CreateNode_Normal;FCKXHtml.SpecialBlocks=new Array();this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);var D=this._GetMainXmlString();D=D.substr(7,D.length-15).trim();if (FCKBrowserInfo.IsGecko) D=D.replace(/<br\/>$/,'');D=D.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) D=D.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) D=FCKCodeFormatter.Format(D);for (var i=0;i<FCKXHtml.SpecialBlocks.length;i++){var E=new RegExp('___FCKsi___'+i);D=D.replace(E,FCKXHtml.SpecialBlocks[i]);};this.XML=null;return D};FCKXHtml._AppendAttribute=function(A,B,C){try{var D=this.XML.createAttribute(B);D.value=C?C:'';A.attributes.setNamedItem(D);}catch (e){}};FCKXHtml._AppendChildNodes=function(A,B,C){var D=0;var E=B.firstChild;while (E){if (this._AppendNode(A,E)) D++;E=E.nextSibling;};if (D==0){if (C&&FCKConfig.FillEmptyBlocks){this._AppendEntity(A,'nbsp');return;};if (!FCKRegexLib.EmptyElements.test(B.nodeName)) A.appendChild(this.XML.createTextNode(''));}};FCKXHtml._AppendNode=function(A,B){if (!B) return;switch (B.nodeType){case 1:if (B.getAttribute('_fckfakelement')) return FCKXHtml._AppendNode(A,FCK.GetRealElement(B));if (FCKBrowserInfo.IsGecko&&B.hasAttribute('_moz_editor_bogus_node')) return false;if (B.getAttribute('_fckdelete')) return false;var C=B.nodeName;if (FCKBrowserInfo.IsIE&&B.scopeName&&B.scopeName!='HTML') C=B.scopeName+':'+C;if (!FCKRegexLib.ElementName.test(C)) return false;C=C.toLowerCase();if (FCKBrowserInfo.IsGecko&&C=='br'&&B.hasAttribute('type')&&B.getAttribute('type',2)=='_moz') return false;if (B._fckxhtmljob&&B._fckxhtmljob==FCKXHtml.CurrentJobNum) return false;var D=this._CreateNode(C);FCKXHtml._AppendAttributes(A,B,D,C);B._fckxhtmljob=FCKXHtml.CurrentJobNum;var E=FCKXHtml.TagProcessors[C];if (E){D=E(D,B,A);if (!D) break;}else this._AppendChildNodes(D,B,FCKRegexLib.BlockElements.test(C));A.appendChild(D);break;case 3:this._AppendTextNode(A,B.nodeValue.replaceNewLineChars(' '));break;case 8: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;};return true;};function FCKXHtml_CreateNode_StrongEm(nodeName){switch (nodeName){case 'b':nodeName='strong';break;case 'i':nodeName='em';break;};return this.XML.createElement(nodeName);};function FCKXHtml_CreateNode_Normal(nodeName){return this.XML.createElement(nodeName);};FCKXHtml._AppendSpecialItem=function(A){return '___FCKsi___'+FCKXHtml.SpecialBlocks.AddItem(A);};FCKXHtml._AppendTextNode=function(A,B){var C=B.match(FCKXHtmlEntities.EntitiesRegex);if (C){for (var i=0;i<C.length;i++){if (C[i].length==1){var D=FCKXHtmlEntities.Entities[C[i]];if (D!=null){this._AppendEntity(A,D);continue;}};A.appendChild(this.XML.createTextNode(C[i]));}}};FCKXHtml.TagProcessors=new Object();FCKXHtml.TagProcessors['img']=function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C&&C.length>0) FCKXHtml._AppendAttribute(A,'src',C);return A;};FCKXHtml.TagProcessors['a']=function(A,B){var C=B.getAttribute('_fcksavedurl');if (C&&C.length>0) FCKXHtml._AppendAttribute(A,'href',C);FCKXHtml._AppendChildNodes(A,B,false);return A;};FCKXHtml.TagProcessors['script']=function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;};FCKXHtml.TagProcessors['style']=function(A,B){if (B.getAttribute('_fcktemp')) return null;if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.innerHTML)));return A;};FCKXHtml.TagProcessors['title']=function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;};FCKXHtml.TagProcessors['base']=function(A,B){if (B.getAttribute('_fcktemp')) return null;return A;};FCKXHtml.TagProcessors['link']=function(A,B){if (B.getAttribute('_fcktemp')) return null;return A;};FCKXHtml.TagProcessors['table']=function(A,B){var C=A.attributes.getNamedItem('class');if (C&&FCKRegexLib.TableBorderClass.test(C.nodeValue)){var D=C.nodeValue.replace(FCKRegexLib.TableBorderClass,'');if (D.length==0) A.attributes.removeNamedItem('class');else FCKXHtml._AppendAttribute(A,'class',D);};FCKXHtml._AppendChildNodes(A,B,false);return A;};FCKXHtml.TagProcessors['ol']=FCKXHtml.TagProcessors['ul']=function(A,B,C){if (B.innerHTML.trim().length==0) return;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return;};FCKXHtml._AppendChildNodes(A,B);return A;} 
add: var FCKTools=new Object();FCKTools.GetLinkedFieldValue=function(){return FCK.LinkedField.value;};FCKTools.AttachToLinkedFieldFormSubmit=function(A){var B=FCK.LinkedField.form;if (!B) return;if (FCKBrowserInfo.IsIE) B.attachEvent("onsubmit",A);else B.addEventListener('submit',A,false);if (!B.updateFCKeditor) B.updateFCKeditor=new Array();B.updateFCKeditor[B.updateFCKeditor.length]=A;if (!B.originalSubmit&&(typeof(B.submit)=='function'||(!B.submit.tagName&&!B.submit.length))){B.originalSubmit=B.submit;B.submit=FCKTools_SubmitReplacer;}};function FCKTools_SubmitReplacer(){if (this.updateFCKeditor){for (var i=0;i<this.updateFCKeditor.length;i++) this.updateFCKeditor[i]();};this.originalSubmit();};FCKTools.GetElementWindow=function(A){return this.GetDocumentWindow(this.GetElementDocument(A));};FCKTools.GetDocumentWindow=function(A){if (FCKBrowserInfo.IsSafari&&!A.parentWindow) this.FixDocumentParentWindow(window.top);return A.parentWindow||A.defaultView;};FCKTools.GetElementPosition=function(A,B){var c={ X:0,Y:0 };var C=B||window;while (A){c.X+=A.offsetLeft-A.scrollLeft;c.Y+=A.offsetTop-A.scrollTop;if (A.offsetParent==null){var D=FCKTools.GetElementWindow(A);if (D!=C) A=D.frameElement;else{c.X+=A.scrollLeft;c.Y+=A.scrollTop;break;}}else A=A.offsetParent;};return c;};FCKTools.FixDocumentParentWindow=function(A){A.document.parentWindow=A;for (var i=0;i<A.frames.length;i++) FCKTools.FixDocumentParentWindow(A.frames[i]);};FCKTools.GetParentWindow=function(A){return A.contentWindow?A.contentWindow:A.parentWindow;};FCKTools.HTMLEncode=function(A){if (!A) return '';A=A.replace(/&/g,'&amp;');A=A.replace(/</g,'&lt;');A=A.replace(/>/g,'&gt;');return A;};FCKTools.AddSelectOption=function(A,B,C){var D=FCKTools.GetElementDocument(A).createElement("OPTION");D.text=B;D.value=C;A.options.add(D);return D;};FCKTools.RunFunction=function(A,B,C,D){if (A) this.SetTimeout(A,0,B,C,D);};FCKTools.SetTimeout=function(A,B,C,D,E){return (E||window).setTimeout(function(){if (D) A.apply(C,[].concat(D));else A.apply(C);},B);};FCKTools.SetInterval=function(A,B,C,D,E){return (E||window).setInterval(function(){A.apply(C,D||[]);},B);};FCKTools.ConvertStyleSizeToHtml=function(A){return A.endsWith('%')?A:parseInt(A);};FCKTools.ConvertHtmlSizeToStyle=function(A){return A.endsWith('%')?A:(A+'px');};FCKTools.GetElementAscensor=function(A,B){var e=A;var C=","+B.toUpperCase()+",";while (e){if (C.indexOf(","+e.nodeName.toUpperCase()+",")!=-1) return e;e=e.parentNode;};return null;};FCKTools.CreateEventListener=function(A,B){var f=function(){var C=[];for (var i=0;i<arguments.length;i++) C.push(arguments[i]);A.apply(this,C.concat(B));};return f;};FCKTools.GetElementDocument=function (A){return A.ownerDocument||A.document;} 
context: var FCKXHtml=new Object();FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKXHtmlEntities.Initialize();this._CreateNode=FCKConfig.ForceStrongEm?FCKXHtml_CreateNode_StrongEm:FCKXHtml_CreateNode_Normal;FCKXHtml.SpecialBlocks=new Array();this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);var D=this._GetMainXmlString();D=D.substr(7,D.length-15).trim();if (FCKBrowserInfo.IsGecko) D=D.replace(/<br\/>$/,'');D=D.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) D=D.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) D=FCKCodeFormatter.Format(D);for (var i=0;i<FCKXHtml.SpecialBlocks.length;i++){var E=new RegExp('___FCKsi___'+i);D=D.replace(E,FCKXHtml.SpecialBlocks[i]);};this.XML=null;return D};FCKXHtml._AppendAttribute=function(A,B,C){try{var D=this.XML.createAttribute(B);D.value=C?C:'';A.attributes.setNamedItem(D);}catch (e){}};FCKXHtml._AppendChildNodes=function(A,B,C){var D=0;var E=B.firstChild;while (E){if (this._AppendNode(A,E)) D++;E=E.nextSibling;};if (D==0){if (C&&FCKConfig.FillEmptyBlocks){this._AppendEntity(A,'nbsp');return;};if (!FCKRegexLib.EmptyElements.test(B.nodeName)) A.appendChild(this.XML.createTextNode(''));}};FCKXHtml._AppendNode=function(A,B){if (!B) return;switch (B.nodeType){case 1:if (B.getAttribute('_fckfakelement')) return FCKXHtml._AppendNode(A,FCK.GetRealElement(B));if (FCKBrowserInfo.IsGecko&&B.hasAttribute('_moz_editor_bogus_node')) return false;if (B.getAttribute('_fckdelete')) return false;var C=B.nodeName;if (FCKBrowserInfo.IsIE&&B.scopeName&&B.scopeName!='HTML') C=B.scopeName+':'+C;if (!FCKRegexLib.ElementName.test(C)) return false;C=C.toLowerCase();if (FCKBrowserInfo.IsGecko&&C=='br'&&B.hasAttribute('type')&&B.getAttribute('type',2)=='_moz') return false;if (B._fckxhtmljob&&B._fckxhtmljob==FCKXHtml.CurrentJobNum) return false;var D=this._CreateNode(C);FCKXHtml._AppendAttributes(A,B,D,C);B._fckxhtmljob=FCKXHtml.CurrentJobNum;var E=FCKXHtml.TagProcessors[C];if (E){D=E(D,B,A);if (!D) break;}else this._AppendChildNodes(D,B,FCKRegexLib.BlockElements.test(C));A.appendChild(D);break;case 3:this._AppendTextNode(A,B.nodeValue.replaceNewLineChars(' '));break;case 8: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;};return true;};function FCKXHtml_CreateNode_StrongEm(nodeName){switch (nodeName){case 'b':nodeName='strong';break;case 'i':nodeName='em';break;};return this.XML.createElement(nodeName);};function FCKXHtml_CreateNode_Normal(nodeName){return this.XML.createElement(nodeName);};FCKXHtml._AppendSpecialItem=function(A){return '___FCKsi___'+FCKXHtml.SpecialBlocks.AddItem(A);};FCKXHtml._AppendTextNode=function(A,B){var C=B.match(FCKXHtmlEntities.EntitiesRegex);if (C){for (var i=0;i<C.length;i++){if (C[i].length==1){var D=FCKXHtmlEntities.Entities[C[i]];if (D!=null){this._AppendEntity(A,D);continue;}};A.appendChild(this.XML.createTextNode(C[i]));}}};FCKXHtml.TagProcessors=new Object();FCKXHtml.TagProcessors['img']=function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C&&C.length>0) FCKXHtml._AppendAttribute(A,'src',C);return A;};FCKXHtml.TagProcessors['a']=function(A,B){var C=B.getAttribute('_fcksavedurl');if (C&&C.length>0) FCKXHtml._AppendAttribute(A,'href',C);FCKXHtml._AppendChildNodes(A,B,false);return A;};FCKXHtml.TagProcessors['script']=function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;};FCKXHtml.TagProcessors['style']=function(A,B){if (B.getAttribute('_fcktemp')) return null;if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.innerHTML)));return A;};FCKXHtml.TagProcessors['title']=function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;};FCKXHtml.TagProcessors['base']=function(A,B){if (B.getAttribute('_fcktemp')) return null;return A;};FCKXHtml.TagProcessors['link']=function(A,B){if (B.getAttribute('_fcktemp')) return null;return A;};FCKXHtml.TagProcessors['table']=function(A,B){var C=A.attributes.getNamedItem('class');if (C&&FCKRegexLib.TableBorderClass.test(C.nodeValue)){var D=C.nodeValue.replace(FCKRegexLib.TableBorderClass,'');if (D.length==0) A.attributes.removeNamedItem('class');else FCKXHtml._AppendAttribute(A,'class',D);};FCKXHtml._AppendChildNodes(A,B,false);return A;};FCKXHtml.TagProcessors['ol']=FCKXHtml.TagProcessors['ul']=function(A,B,C){if (B.innerHTML.trim().length==0) return;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return;};FCKXHtml._AppendChildNodes(A,B);return A;}
meta: 4958	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4958/6b9d6c2501f7b42b27415777c9ca21fcad5d776a/fckeditorcode_gecko.js/buggy/ext_scripts/FCKeditor/editor/js/fckeditorcode_gecko.js