+;(function()\r
+{\r
+ var textareaToEditor = function( textarea )\r
+ {\r
+ var editor = new FCKeditor( textarea.name ) ;\r
+\r
+ editor.Width = Math.max( textarea.offsetWidth, FCKeditor.MinWidth ) ;\r
+ editor.Height = Math.max( textarea.offsetHeight, FCKeditor.MinHeight ) ;\r
+\r
+ return editor ;\r
+ }\r
+\r
+ /**\r
+ * Replace all <textarea> elements available in the document with FCKeditor\r
+ * instances.\r
+ *\r
+ * // Replace all <textarea> elements in the page.\r
+ * FCKeditor.ReplaceAllTextareas() ;\r
+ *\r
+ * // Replace all <textarea class="myClassName"> elements in the page.\r
+ * FCKeditor.ReplaceAllTextareas( 'myClassName' ) ;\r
+ *\r
+ * // Selectively replace <textarea> elements, based on custom assertions.\r
+ * FCKeditor.ReplaceAllTextareas( function( textarea, editor )\r
+ * {\r
+ * // Custom code to evaluate the replace, returning false if it\r
+ * // must not be done.\r
+ * // It also passes the "editor" parameter, so the developer can\r
+ * // customize the instance.\r
+ * } ) ;\r
+ */\r
+ FCKeditor.ReplaceAllTextareas = function()\r
+ {\r
+ var textareas = document.getElementsByTagName( 'textarea' ) ;\r
+\r
+ for ( var i = 0 ; i < textareas.length ; i++ )\r
+ {\r
+ var editor = null ;\r
+ var textarea = textareas[i] ;\r
+ var name = textarea.name ;\r
+\r
+ // The "name" attribute must exist.\r
+ if ( !name || name.length == 0 )\r
+ continue ;\r
+\r
+ if ( typeof arguments[0] == 'string' )\r
+ {\r
+ // The textarea class name could be passed as the function\r
+ // parameter.\r
+\r
+ var classRegex = new RegExp( '(?:^| )' + arguments[0] + '(?:$| )' ) ;\r
+\r
+ if ( !classRegex.test( textarea.className ) )\r
+ continue ;\r
+ }\r
+ else if ( typeof arguments[0] == 'function' )\r
+ {\r
+ // An assertion function could be passed as the function parameter.\r
+ // It must explicitly return "false" to ignore a specific <textarea>.\r
+ editor = textareaToEditor( textarea ) ;\r
+ if ( arguments[0]( textarea, editor ) === false )\r
+ continue ;\r
+ }\r
+\r
+ if ( !editor )\r
+ editor = textareaToEditor( textarea ) ;\r
+\r
+ editor.ReplaceTextarea() ;\r
+ }\r
+ }\r
+})() ;\r
+\r
+function FCKeditor_IsCompatibleBrowser()\r