+// #1645: Alert the user if opening FCKeditor in FF3 from local filesystem\r
+// without security.fileuri.strict_origin_policy disabled.\r
+if ( document.location.protocol == 'file:' )\r
+{\r
+ try\r
+ {\r
+ window.parent.document.domain ;\r
+ }\r
+ catch ( e )\r
+ {\r
+ window.addEventListener( 'load', function()\r
+ {\r
+ document.body.innerHTML = '\\r
+ <div style="border: 1px red solid; font-family: arial; font-size: 12px; color: red; padding:10px;">\\r
+ <p>\\r
+ <b>Your browser security settings don\'t allow FCKeditor to be opened from\\r
+ the local filesystem.<\/b>\\r
+ <\/p>\\r
+ <p>\\r
+ Please open the <b>about:config<\/b> page and disable the\\r
+ "security.fileuri.strict_origin_policy" option; then load this page again.\\r
+ <\/p>\\r
+ <p>\\r
+ Check our <a href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/FAQ#ff3perms">FAQ<\/a>\\r
+ for more information.\\r
+ <\/p>\\r
+ <\/div>' ;\r
+ }, false ) ;\r
+ }\r
+}\r
+\r
+// Save a reference to the default domain.\r
+var FCK_ORIGINAL_DOMAIN ;\r
+\r
+// Automatically detect the correct document.domain (#123).\r
+(function()\r
+{\r
+ var d = FCK_ORIGINAL_DOMAIN = document.domain ;\r
+\r
+ while ( true )\r
+ {\r
+ // Test if we can access a parent property.\r
+ try\r
+ {\r
+ var test = window.parent.document.domain ;\r
+ break ;\r
+ }\r
+ catch( e ) {}\r
+\r
+ // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...\r
+ d = d.replace( /.*?(?:\.|$)/, '' ) ;\r
+\r
+ if ( d.length == 0 )\r
+ break ; // It was not able to detect the domain.\r
+\r
+ try\r
+ {\r
+ document.domain = d ;\r
+ }\r
+ catch (e)\r
+ {\r
+ break ;\r
+ }\r
+ }\r
+})() ;\r
+\r
+// Save a reference to the detected runtime domain.\r
+var FCK_RUNTIME_DOMAIN = document.domain ;\r
+\r
+var FCK_IS_CUSTOM_DOMAIN = ( FCK_ORIGINAL_DOMAIN != FCK_RUNTIME_DOMAIN ) ;\r
+\r