Index: /FCKeditor/branches/versions/2.6.x/_dev/build_release.bat
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_dev/build_release.bat	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/_dev/build_release.bat	(revision 1825)
@@ -26,5 +26,5 @@
 
 :: Update this variable for each new release.
-SET RELEASER_VERSION=2.6 Beta 1
+SET RELEASER_VERSION=2.6 RC
 
 CLS
Index: /FCKeditor/branches/versions/2.6.x/_dev/domain_fix_template.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_dev/domain_fix_template.js	(revision 1825)
+++ /FCKeditor/branches/versions/2.6.x/_dev/domain_fix_template.js	(revision 1825)
@@ -0,0 +1,61 @@
+﻿/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2008 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ *
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ *
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ *
+ * The minified version of this script is used by all connectors to inject the
+ * document.domain fix in the upload responses. Any change in this script logic
+ * must then be re-introduced in the connectors code.
+ */
+
+// ### Minified Script (must be updated on changes in the original below).
+
+(function(){var d=document.domain;while (true){try{var A=window.top.opener.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();
+
+// ### Original Script.
+
+(function()
+{
+	var d = document.domain ;
+
+	while ( true )
+	{
+		// Test if we can access a parent property.
+		try
+		{
+			var test = window.top.opener.document.domain ;
+			break ;
+		}
+		catch( e ) {}
+
+		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+		d = d.replace( /.*?(?:\.|$)/, '' ) ;
+
+		if ( d.length == 0 )
+			break ;		// It was not able to detect the domain.
+
+		try
+		{
+			document.domain = d ;
+		}
+		catch (e)
+		{
+			break ;
+		}
+	}
+})() ;
Index: /FCKeditor/branches/versions/2.6.x/_documentation.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_documentation.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/_documentation.html	(revision 1825)
@@ -33,6 +33,6 @@
 		FCKeditor Documentation</h1>
 	<p>
-		You can find the official documentation for FCKeditor online, at <a href="http://wiki.fckeditor.net/">
-			http://wiki.fckeditor.net/</a>.</p>
+		You can find the official documentation for FCKeditor online, at <a href="http://docs.fckeditor.net/">
+			http://docs.fckeditor.net/</a>.</p>
 </body>
 </html>
Index: /FCKeditor/branches/versions/2.6.x/_samples/html/sample06.config.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/html/sample06.config.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/_samples/html/sample06.config.js	(revision 1825)
@@ -40,10 +40,10 @@
 //			pluginName: The plugin name. The plugin directory must match this name.
 //			availableLanguages: a list of available language files for the plugin (separated by a comma).
-FCKConfig.Plugins.Add( 'findreplace', 'en,it,fr' ) ;
+FCKConfig.Plugins.Add( 'findreplace', 'en,fr,it' ) ;
 FCKConfig.Plugins.Add( 'samples' ) ;
 
 // If you want to use plugins found on other directories, just use the third parameter.
 var sOtherPluginPath = FCKConfig.BasePath.substr(0, FCKConfig.BasePath.length - 7) + 'editor/plugins/' ;
-FCKConfig.Plugins.Add( 'placeholder', 'en,it,de,fr', sOtherPluginPath ) ;
+FCKConfig.Plugins.Add( 'placeholder', 'de,en,es,fr,it,pl', sOtherPluginPath ) ;
 FCKConfig.Plugins.Add( 'tablecommands', null, sOtherPluginPath ) ;
 FCKConfig.Plugins.Add( 'simplecommands', null, sOtherPluginPath ) ;
Index: /FCKeditor/branches/versions/2.6.x/_samples/perl/sample01.cgi
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/perl/sample01.cgi	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/_samples/perl/sample01.cgi	(revision 1825)
@@ -110,4 +110,6 @@
 		} elsif($ENV{'FILEPATH_INFO'}) {
 			$dir  = $ENV{'FILEPATH_INFO'};
+		} elsif($ENV{'REQUEST_URI'}) {
+			$dir  = $ENV{'REQUEST_URI'};
 		}
 	}
Index: /FCKeditor/branches/versions/2.6.x/_samples/perl/sample02.cgi
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/perl/sample02.cgi	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/_samples/perl/sample02.cgi	(revision 1825)
@@ -175,4 +175,6 @@
 		} elsif($ENV{'FILEPATH_INFO'}) {
 			$dir  = $ENV{'FILEPATH_INFO'};
+		} elsif($ENV{'REQUEST_URI'}) {
+			$dir  = $ENV{'REQUEST_URI'};
 		}
 	}
Index: /FCKeditor/branches/versions/2.6.x/_samples/perl/sample03.cgi
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/perl/sample03.cgi	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/_samples/perl/sample03.cgi	(revision 1825)
@@ -160,4 +160,6 @@
 		} elsif($ENV{'FILEPATH_INFO'}) {
 			$dir  = $ENV{'FILEPATH_INFO'};
+		} elsif($ENV{'REQUEST_URI'}) {
+			$dir  = $ENV{'REQUEST_URI'};
 		}
 	}
Index: /FCKeditor/branches/versions/2.6.x/_samples/perl/sample04.cgi
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_samples/perl/sample04.cgi	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/_samples/perl/sample04.cgi	(revision 1825)
@@ -167,4 +167,6 @@
 		} elsif($ENV{'FILEPATH_INFO'}) {
 			$dir  = $ENV{'FILEPATH_INFO'};
+		} elsif($ENV{'REQUEST_URI'}) {
+			$dir  = $ENV{'REQUEST_URI'};
 		}
 	}
Index: /FCKeditor/branches/versions/2.6.x/_test/automated/_jsunit/app/jsUnitCore.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_test/automated/_jsunit/app/jsUnitCore.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/_test/automated/_jsunit/app/jsUnitCore.js	(revision 1825)
@@ -76,9 +76,9 @@
 
 function _displayStringForValue(aVar) {
-    var result = '<' + aVar + '>';
+    var result = '[' + aVar + ']';
     if (!(aVar === null || aVar === top.JSUNIT_UNDEFINED_VALUE)) {
         result += ' (' + _trueTypeOf(aVar) + ')';
     }
-    return result;
+    return '\n' + result + '\n';
 }
 
Index: /FCKeditor/branches/versions/2.6.x/_test/automated/tests/fckdomtools.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_test/automated/tests/fckdomtools.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/_test/automated/tests/fckdomtools.html	(revision 1825)
@@ -29,4 +29,29 @@
 
 FCKScriptLoader.Load( 'FCKDomTools' ) ;
+
+	</script>
+	<script type="text/javascript">
+
+var _BodyHtml ;
+
+function setUpPage()
+{
+	_BodyHtml = document.body.innerHTML ;
+	setUpPageStatus = 'complete' ;
+}
+
+// JsUnit special function called before every test start.
+function setUp()
+{
+	// Reset the body (because of changes by test functions).
+	document.body.innerHTML = _BodyHtml ;
+}
+
+// Use window.onload to call a test outside JsUnit (for debugging).
+// The "tests.js" script must be commented.
+//window.onload = function()
+//{
+//	test_GetNextSourceNode() ;
+//}
 
 	</script>
@@ -89,4 +114,49 @@
 }
 
+function test_BreakParent_1()
+{
+	var p = document.getElementById( 'xBreakParent_P1' ) ;
+
+	FCKDomTools.BreakParent( p.getElementsByTagName('span')[0], p.getElementsByTagName('i')[0] ) ;
+
+	assertEquals( 'SPAN breaks I', '<b>this <i>is some</i><span></span><i> sample</i> test text</b>', GetTestInnerHtml( p ) ) ;
+}
+
+function test_BreakParent_2()
+{
+	var p = document.getElementById( 'xBreakParent_P1' ) ;
+
+	FCKDomTools.BreakParent( p.getElementsByTagName('span')[0], p.getElementsByTagName('b')[0] ) ;
+
+	assertEquals( 'SPAN breaks B', '<b>this <i>is some</i></b><span></span><b><i> sample</i> test text</b>', GetTestInnerHtml( p ) ) ;
+}
+
+function test_BreakParent_3()
+{
+	var p = document.getElementById( 'xBreakParent_P2' ) ;
+
+	FCKDomTools.BreakParent( p.getElementsByTagName('span')[0], p.getElementsByTagName('i')[0] ) ;
+
+	assertEquals( 'SPAN breaks I', '<b><i></i><span>test</span><i></i></b>', GetTestInnerHtml( p ) ) ;
+}
+
+function test_BreakParent_4()
+{
+	var p = document.getElementById( 'xBreakParent_P2' ) ;
+
+	FCKDomTools.BreakParent( p.getElementsByTagName('span')[0], p.getElementsByTagName('b')[0] ) ;
+
+	assertEquals( 'SPAN breaks B', '<b><i></i></b><span>test</span><b><i></i></b>', GetTestInnerHtml( p ) ) ;
+}
+
+function test_BreakParent_5()
+{
+	var p = document.getElementById( 'xBreakParent_P2' ) ;
+
+	FCKDomTools.BreakParent( p.getElementsByTagName('i')[0], p.getElementsByTagName('b')[0] ) ;
+
+	assertEquals( 'I breaks B', '<b></b><i><span>test</span></i><b></b>', GetTestInnerHtml( p ) ) ;
+}
+
 	</script>
 </head>
@@ -116,4 +186,6 @@
 			alt="" />
 	</p>
+	<p id="xBreakParent_P1"><b>This <i>is some<span></span> sample</i> test text</b></p>
+	<p id="xBreakParent_P2"><b><i><span>test</span></i></b></p>
 </body>
 </html>
Index: /FCKeditor/branches/versions/2.6.x/_test/automated/tests/fckw3crange.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_test/automated/tests/fckw3crange.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/_test/automated/tests/fckw3crange.html	(revision 1825)
@@ -629,4 +629,52 @@
 }
 
+function test_extractContents_Other_5()
+{
+	document.body.innerHTML = '<p><b><i>test</i></b></p>' ;
+
+	var range = FCKW3CRange.CreateRange( document ) ;
+
+	range.setStartAfter( document.getElementsByTagName('i')[0] ) ;
+	range.setEndAfter( document.getElementsByTagName('b')[0] ) ;
+
+	var docFrag = range.extractContents() ;
+
+	var tmpDiv = document.createElement( 'div' ) ;
+	if ( docFrag.AppendTo ) docFrag.AppendTo( tmpDiv ) ; else tmpDiv.appendChild( docFrag ) ;
+
+	assertEquals( 'Extracted HTML', '<b></b>', GetTestInnerHtml( tmpDiv ) ) ;
+	assertEquals( 'HTML after extraction', '<p><b><i>test</i></b></p>', GetTestInnerHtml( document.body ) ) ;
+
+	assertEquals( 'range.startContainer', document.body.firstChild, range.startContainer ) ;
+	assertEquals( 'range.startOffset', 1, range.startOffset ) ;
+	assertEquals( 'range.endContainer', document.body.firstChild, range.endContainer ) ;
+	assertEquals( 'range.endOffset', 1, range.endOffset ) ;
+	assertTrue( 'range.collapsed', range.collapsed ) ;
+}
+
+function test_extractContents_Other_6()
+{
+	document.body.innerHTML = '<p><b><i>test</i></b></p>' ;
+
+	var range = FCKW3CRange.CreateRange( document ) ;
+
+	range.setStartBefore( document.getElementsByTagName('b')[0] ) ;
+	range.setEndBefore( document.getElementsByTagName('i')[0] ) ;
+
+	var docFrag = range.extractContents() ;
+
+	var tmpDiv = document.createElement( 'div' ) ;
+	if ( docFrag.AppendTo ) docFrag.AppendTo( tmpDiv ) ; else tmpDiv.appendChild( docFrag ) ;
+
+	assertEquals( 'Extracted HTML', '<b></b>', GetTestInnerHtml( tmpDiv ) ) ;
+	assertEquals( 'HTML after extraction', '<p><b><i>test</i></b></p>', GetTestInnerHtml( document.body ) ) ;
+
+	assertEquals( 'range.startContainer', document.body.firstChild, range.startContainer ) ;
+	assertEquals( 'range.startOffset', 0, range.startOffset ) ;
+	assertEquals( 'range.endContainer', document.body.firstChild, range.endContainer ) ;
+	assertEquals( 'range.endOffset', 0, range.endOffset ) ;
+	assertTrue( 'range.collapsed', range.collapsed ) ;
+}
+
 // W3C DOM Range Specs - Section 2.7 - Example 1
 function test_cloneContents_W3C_1()
@@ -848,9 +896,18 @@
 <script type="text/javascript">
 
+var _BodyHtml ;
+
+function setUpPage()
+{
+	// Get the trimmed innerHTML.
+	_BodyHtml = document.body.innerHTML.replace( /^\s+|\s+$/g, '' ) ;
+	setUpPageStatus = 'complete' ;
+}
+
 // JsUnit special function called before every test start.
 function setUp()
 {
 	// Reset the body (because of changes by test functions).
-	document.body.innerHTML = '<h1 id="_H1">FCKW3CRange Test</h1><p id="_P">This is <b id="_B">some</b> text.</p><p>Another paragraph.</p>' ;
+	document.body.innerHTML = _BodyHtml ;
 }
 
Index: /FCKeditor/branches/versions/2.6.x/_test/manual/fckeditorapi/test1.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_test/manual/fckeditorapi/test1.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/_test/manual/fckeditorapi/test1.html	(revision 1825)
@@ -47,5 +47,5 @@
 		var sInstances = '' ;
 
-		for ( var s in FCKeditorAPI.__Instances )
+		for ( var s in FCKeditorAPI.Instances )
 		{
 			iCount++ ;
Index: /FCKeditor/branches/versions/2.6.x/_upgrade.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_upgrade.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/_upgrade.html	(revision 1825)
@@ -33,6 +33,7 @@
 		FCKeditor Upgrade</h1>
 	<p>
-		Please check the following URL for notes regarding upgrade: <a href="http://wiki.fckeditor.net/Developer%27s_Guide/Upgrade">
-			http://wiki.fckeditor.net/Developer%27s_Guide/Upgrade</a></p>
+		Please check the following URL for notes regarding upgrade:<br />
+		<a href="http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Installation/Upgrading">
+			http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Installation/Upgrading</a></p>
 </body>
 </html>
Index: /FCKeditor/branches/versions/2.6.x/_whatsnew.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/_whatsnew.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/_whatsnew.html	(revision 1825)
@@ -34,5 +34,116 @@
 		FCKeditor ChangeLog - What's New?</h1>
 	<h3>
-		Version 2.6 (SVN)</h3>
+		Version 2.6 RC</h3>
+	<p>
+		New Features and Improvements:</p>
+	<ul>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2017">#2017</a>] The FCKeditorAPI.Instances
+			object can now be used to access all FCKeditor instances available in the page.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1980">#1980</a>] <span
+			style="color: #ff0000">Attention:</span> By default, the editor now produces &lt;strong&gt;
+			and &lt;em&gt; instead of &lt;b&gt; and &lt;i&gt;.</li>
+	</ul>
+	<p>
+		Fixed Bugs:</p>
+	<ul>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1924">#1924</a>] The dialog
+			close button is now correctly positioned in IE in RTL languages.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1933">#1933</a>] Placeholder
+			dialog will now display the placeholder value correctly in IE.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/957">#957</a>] Pressing
+			Enter or typing after a placeholder with the placeholder plugin will no longer generate
+			colored text.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1952">#1952</a>] Fixed
+			an issue in FCKTools.FixCssUrls that, other than wrong, was breaking Opera.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1695">#1695</a>] Removed
+			Ctrl-Tab hotkey for Source mode and allowed Ctrl-T to work in Firefox.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1666">#1666</a>] Fixed
+			permission denied errors during opening popup menus in IE6 under domain relaxation
+			mode.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1934">#1934</a>] Fixed
+			JavaScript errors when calling Selection.EnsureSelection() in dialogs.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1920">#1920</a>] Fixed
+			SSL warning message when opening image and flash dialogs under HTTPS in IE6.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1955">#1955</a>] [<a
+			target="_blank" href="http://dev.fckeditor.net/ticket/1981">#1981</a>] [<a target="_blank"
+				href="http://dev.fckeditor.net/ticket/1985">#1985</a>] [<a target="_blank" href="http://dev.fckeditor.net/ticket/1989">#1989</a>]
+			Fixed XHTML source formatting errors in non-IE browsers.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2000">#2000</a>] The #
+			character is now properly encoded in file names returned by the File Browser.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1945">#1945</a>] New folders
+			and file names are now properly sanitized against control characters. </li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1944">#1944</a>] Backslash
+			character is now disallowed in current folder path.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1055">#1055</a>] Added
+			logic to override JavaScript errors occurring inside the editing frame due to user
+			added JavaScript code.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1647">#1647</a>] Hitting
+			ENTER on list items containing block elements will now create new list item elements,
+			instead of adding further blocks to the same list item.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1411">#1411</a>] Label
+			only combos now get properly grayed out when moving to source view.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2009">#2009</a>] Fixed
+			an important bug regarding styles removal on styled text boundaries, introduced
+			with the 2.6 Beta 1. </li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2011">#2011</a>] Internal
+			CSS &lt;style&gt; tags where being outputted when FullPage=true.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2016">#2016</a>] The Link
+			dialog now properly selects the first field when opening it to modify mailto or
+			anchor links. This problem was also throwing an error in IE.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2021">#2021</a>] The caret
+			will no longer remain behind in the editing area when the placeholder dialog is
+			opened.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2024">#2024</a>] Fixed
+			JavaScript error in IE when the user tries to open dialogs in Source mode.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1853">#1853</a>] Setting
+			ShiftEnterMode to p or div now works correctly when EnterMode is br.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1838">#1838</a>] Fixed
+			the issue where context menus sometimes don't disappear after selecting an option.
+		</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2028">#2028</a>] Fixed
+			JavaScript error when EnterMode=br and user tries to insert a page break.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2002">#2002</a>] Fixed
+			the issue where the maximize editor button does not vertically expand the editing
+			area in Firefox.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1842">#1842</a>] PHP integration:
+			fixed filename encoding problems in file browser.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1832">#1832</a>] Calling
+			FCK.InsertHtml() in non-IE browsers would now activate the document processor as
+			expected.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1998">#1998</a>] The native
+			XMLHttpRequest class is now used in IE, whenever it is available.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1792">#1792</a>] In IE,
+			the browser was able to enter in an infinite loop when working with multiple editors
+			in the same page. </li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1948">#1948</a>] Some
+			CSS rules are reset to dialog elements to avoid conflict with the page CSS.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1965">#1965</a>] IE was
+			having problems with SpellerPages, causing some errors to be thrown when completing
+			the spell checking in some situations.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2042">#2042</a>] The FitWindow
+			command was throwing an error if executed in an editor where its relative button
+			is not present in the toolbar.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/922">#922</a>] Implemented
+			a generic document processor for &lt;OBJECT&gt; and &lt;EMBED&gt; tags.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1831">#1831</a>] Fixed
+			the issue where the placeholder icon for &lt;EMBED&gt; tags does not always show
+			up in IE7.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2049">#2049</a>] Fixed
+			a deleted cursor CSS attribute in the minified CSS inside fck_dialog_common.js.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1806">#1806</a>] In IE,
+			the caret will not any more move to the previous line when selecting a Format style
+			inside an empty paragraph.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1990">#1990</a>] In IE,
+			dialogs using API calls which deals with the selection, like InsertHtml now can
+			be sure the selection will be placed in the correct position.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1997">#1997</a>] With
+			IE, the first character of table captions where being lost on table creation.</li>
+		<li>The selection and cursor position was not being properly handled when creating some
+			elements like forms and tables.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/662">#662</a>] In the
+			Perl sample files, the GetServerPath function will now calculate the path properly.</li>
+	</ul>
+	<h3>
+		Version 2.6 Beta 1</h3>
 	<p>
 		New Features and Improvements:</p>
@@ -88,5 +199,5 @@
 		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/805">#805</a>] The FCKConfig.Keystrokes
 			commands where executed even if the command itself was disabled.</li>
-		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/902">#902</a>] The button
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/982">#982</a>] The button
 			to empty the box in the "Paste from Word" has been removed as it leads to confusion
 			for some users.</li>
@@ -134,5 +245,5 @@
 			of depreciated "var").</li>
 		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1815">#1815</a>] PHP integration:
-			removed closing tag: "?>", so no additional whitespace added when files are included.</li>
+			removed closing tag: "?&gt;", so no additional whitespace added when files are included.</li>
 		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1906">#1906</a>] PHP file
 			browser: fixed problems with DetectHtml() function when open_basedir was set.</li>
@@ -166,4 +277,9 @@
 		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1868">#1868</a>] Links
 			to file browser has been changed to avoid requests containing double dots.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1229">#1229</a>] Converting
+			multiple contiguous paragraphs to Formatted will now be merged into a single &lt;PRE&gt;
+			block.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1627">#1627</a>] Samples
+			failed to load from local filesystem in IE7.</li>
 	</ul>
 	<p>
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckdomrange.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckdomrange.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckdomrange.js	(revision 1825)
@@ -150,10 +150,18 @@
 	MoveToElementEditStart : function( targetElement )
 	{
-		var child ;
-
-		while ( ( child = targetElement.firstChild ) && child.nodeType == 1 && FCKListsLib.InlineNonEmptyElements[ child.nodeName.toLowerCase() ] )
-			targetElement = child ;
-
-		this.MoveToElementStart( targetElement ) ;
+		var editableElement ;
+
+		while ( targetElement && targetElement.nodeType == 1 )
+		{
+			if ( FCKDomTools.CheckIsEditable( targetElement ) )
+				editableElement = targetElement ;
+			else if ( editableElement )
+				break ;		// If we already found an editable element, stop the loop.
+
+			targetElement = targetElement.firstChild ;
+		}
+
+		if ( editableElement )
+			this.MoveToElementStart( editableElement ) ;
 	},
 
@@ -745,5 +753,5 @@
 	 *		- PreviousBlock	: a reference to the block element that preceeds
 	 *		  the range after the split.
-	 *		- NextBlock : a reference to the block element that preceeds the
+	 *		- NextBlock : a reference to the block element that follows the
 	 *		  range after the split.
 	 *		- WasStartOfBlock : a boolean indicating that the range was
@@ -756,6 +764,8 @@
 	 * NextBlock value if the range was at the end of the block.
 	 */
-	SplitBlock : function()
-	{
+	SplitBlock : function( forceBlockTag )
+	{
+		var blockTag = forceBlockTag || FCKConfig.EnterMode ;
+
 		if ( !this._Range )
 			this.MoveToSelection() ;
@@ -769,14 +779,14 @@
 			var oElementPath	= null ;
 
-			if ( FCKConfig.EnterMode != 'br' )
+			if ( blockTag != 'br' )
 			{
 				if ( !eStartBlock )
 				{
-					eStartBlock = this.FixBlock( true ) ;
+					eStartBlock = this.FixBlock( true, blockTag ) ;
 					eEndBlock	= this.EndBlock ;	// FixBlock may have fixed the EndBlock too.
 				}
 
 				if ( !eEndBlock )
-					eEndBlock = this.FixBlock( false ) ;
+					eEndBlock = this.FixBlock( false, blockTag ) ;
 			}
 
@@ -841,5 +851,5 @@
 
 	// Transform a block without a block tag in a valid block (orphan text in the body or td, usually).
-	FixBlock : function( isStart )
+	FixBlock : function( isStart, blockTag )
 	{
 		// Bookmark the range so we can restore it later.
@@ -853,5 +863,5 @@
 
 		// Create the fixed block.
-		var oFixedBlock = this.Window.document.createElement( FCKConfig.EnterMode ) ;
+		var oFixedBlock = this.Window.document.createElement( blockTag ) ;
 
 		// Move the contents of the temporary range to the fixed block.
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckeditingarea.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckeditingarea.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckeditingarea.js	(revision 1825)
@@ -93,4 +93,8 @@
 		var oIFrame = this.IFrame = oTargetDocument.createElement( 'iframe' ) ;
 
+		// IE: Avoid JavaScript errors thrown by the editing are source (like tags events).
+		// See #1055.
+		var sOverrideError = '<script type="text/javascript" _fcktemp="true">window.onerror=function(){return true;};</script>' ;
+
 		oIFrame.frameBorder = 0 ;
 		oIFrame.width = oIFrame.height = '100%' ;
@@ -98,5 +102,5 @@
 		if ( FCK_IS_CUSTOM_DOMAIN && FCKBrowserInfo.IsIE )
 		{
-			window._FCKHtmlToLoad = html ;
+			window._FCKHtmlToLoad = sOverrideError + html ;
 			oIFrame.src = 'javascript:void( (function(){' +
 				'document.open() ;' +
@@ -130,5 +134,5 @@
 
 			oDoc.open() ;
-			oDoc.write( html ) ;
+			oDoc.write( sOverrideError + html ) ;
 			oDoc.close() ;
 		}
@@ -297,14 +301,8 @@
 		if ( this.Mode == FCK_EDITMODE_WYSIWYG )
 		{
-			// The following check is important to avoid IE entering in a focus loop. Ref:
-			// http://sourceforge.net/tracker/index.php?func=detail&aid=1567060&group_id=75348&atid=543653
-			if ( FCKBrowserInfo.IsIE && this.Document.hasFocus() )
-				this._EnsureFocusIE() ;
-
-			this.Window.focus() ;
-
-			// In IE it can happen that the document is in theory focused but the active element is outside it
 			if ( FCKBrowserInfo.IsIE )
-				this._EnsureFocusIE() ;
+				this._FocusIE() ;
+			else
+				this.Window.focus() ;
 		}
 		else
@@ -320,8 +318,11 @@
 }
 
-FCKEditingArea.prototype._EnsureFocusIE = function()
-{
-	// In IE it can happen that the document is in theory focused but the active element is outside it
+FCKEditingArea.prototype._FocusIE = function()
+{
+	// In IE it can happen that the document is in theory focused but the
+	// active element is outside of it.
 	this.Document.body.setActive() ;
+
+	this.Window.focus() ;
 
 	// Kludge for #141... yet more code to workaround IE bugs
@@ -339,12 +340,9 @@
 	}
 
-	range.moveEnd( "character", 1 ) ;
-	range.select() ;
-
-	if ( range.boundingWidth > 0 )
-	{
-		range.moveEnd( "character", -1 ) ;
-		range.select() ;
-	}
+	// Force the selection to happen, in this way we guarantee the focus will
+	// be there.
+	range = new FCKDomRange( this.Window ) ;
+	range.MoveToElementEditStart( parentNode ) ;
+	range.Select() ;
 }
 
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckenterkey.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckenterkey.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckenterkey.js	(revision 1825)
@@ -399,7 +399,5 @@
 	var oRange = range || new FCKDomRange( this.Window ) ;
 
-	var oSplitInfo = oRange.SplitBlock() ;
-
-	// FCKDebug.OutputObject( oSplitInfo ) ;
+	var oSplitInfo = oRange.SplitBlock( blockTag ) ;
 
 	if ( oSplitInfo )
@@ -411,4 +409,20 @@
 		var bIsStartOfBlock	= oSplitInfo.WasStartOfBlock ;
 		var bIsEndOfBlock	= oSplitInfo.WasEndOfBlock ;
+
+		// If there is one block under a list item, modify the split so that the list item gets split as well. (Bug #1647)
+		if ( eNextBlock )
+		{
+			if ( eNextBlock.parentNode.nodeName.IEquals( 'li' ) )
+			{
+				FCKDomTools.BreakParent( eNextBlock, eNextBlock.parentNode ) ;
+				FCKDomTools.MoveNode( eNextBlock, eNextBlock.nextSibling, true ) ;
+			}
+		}
+		else if ( ePreviousBlock && ePreviousBlock.parentNode.nodeName.IEquals( 'li' ) )
+		{
+			FCKDomTools.BreakParent( ePreviousBlock, ePreviousBlock.parentNode ) ;
+			oRange.MoveToElementEditStart( ePreviousBlock.nextSibling );
+			FCKDomTools.MoveNode( ePreviousBlock, ePreviousBlock.previousSibling ) ;
+		}
 
 		// If we have both the previous and next blocks, it means that the
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckpanel.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckpanel.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckpanel.js	(revision 1825)
@@ -35,17 +35,30 @@
 	if ( FCKBrowserInfo.IsIE )
 	{
+		// Create the Popup that will hold the panel.
+		// The popup has to be created before playing with domain hacks, see #1666.
+		this._Popup	= this._Window.createPopup() ;
+
+		// this._Window cannot be accessed while playing with domain hacks, but local variable is ok.
+		// See #1666.
+		var pDoc = this._Window.document ;
+
 		// This is a trick to IE6 (not IE7). The original domain must be set
 		// before creating the popup, so we are able to take a refence to the
 		// document inside of it, and the set the proper domain for it. (#123)
-		if ( FCK_IS_CUSTOM_DOMAIN )
+		if ( FCK_IS_CUSTOM_DOMAIN && !FCKBrowserInfo.IsIE7 )
+		{
+			pDoc.domain = FCK_ORIGINAL_DOMAIN ;
 			document.domain = FCK_ORIGINAL_DOMAIN ;
-
-		// Create the Popup that will hold the panel.
-		this._Popup	= this._Window.createPopup() ;
+		}
+
 		oDocument = this.Document = this._Popup.document ;
 
 		// Set the proper domain inside the popup.
 		if ( FCK_IS_CUSTOM_DOMAIN )
-			document.domain = oDocument.domain = FCK_RUNTIME_DOMAIN ;
+		{
+			oDocument.domain = FCK_RUNTIME_DOMAIN ;
+			pDoc.domain = FCK_RUNTIME_DOMAIN ;
+			document.domain = FCK_RUNTIME_DOMAIN ;
+		}
 
 		FCK.IECleanup.AddItem( this, FCKPanel_Cleanup ) ;
@@ -258,17 +271,17 @@
 			} ) ;
 
+		// Move the focus to the IFRAME so we catch the "onblur".
+		this._IFrame.contentWindow.focus() ;
+		this._IsOpened = true ;
+
 		var me = this ;
-		var resizeFunc = function()
-		{
-			var iWidth = eMainNode.offsetWidth || eMainNode.firstChild.offsetWidth ;
-			var iHeight = eMainNode.offsetHeight ;
-			me._IFrame.width = iWidth ;
-			me._IFrame.height = iHeight ;
-
-			// Move the focus to the IFRAME so we catch the "onblur".
-			me._IFrame.contentWindow.focus() ;
-			me._IsOpened = true ;
-		}
-		setTimeout( resizeFunc, 1 ) ;
+		this._resizeTimer = setTimeout( function()
+			{
+				var iWidth = eMainNode.offsetWidth || eMainNode.firstChild.offsetWidth ;
+				var iHeight = eMainNode.offsetHeight ;
+				me._IFrame.width = iWidth ;
+				me._IFrame.height = iHeight ;
+
+			}, 0 ) ;
 
 		FCK.ToolbarSet.CurrentInstance.GetInstanceObject( 'FCKPanel' )._OpenedPanel = this ;
@@ -296,4 +309,10 @@
 
 		this._IsOpened = false ;
+
+		if ( this._resizeTimer )
+		{
+			clearTimeout( this._resizeTimer ) ;
+			this._resizeTimer = null ;
+		}
 
 		if ( this.ParentPanel )
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckstyle.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckstyle.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckstyle.js	(revision 1825)
@@ -279,4 +279,6 @@
 			if ( updateRange )
 				range.MoveToBookmark( bookmark ) ;
+
+			return ;
 		}
 
@@ -285,5 +287,5 @@
 
 		// Bookmark the range so we can re-select it after processing.
-		var bookmark = range.CreateBookmark( true ) ;
+		bookmark = range.CreateBookmark( true ) ;
 
 		// The style will be applied within the bookmark boundaries.
@@ -856,4 +858,7 @@
 		var doc = range.Window.document ;
 
+		var preBlocks = [] ;
+		var convertedPreBlocks = [] ;
+
 		while( ( block = iterator.GetNextParagraph() ) )		// Only one =
 		{
@@ -865,7 +870,13 @@
 			var blockIsPre = block.nodeName.IEquals( 'pre' ) ;
 			if ( newBlockIsPre && !blockIsPre )
+			{
 				newBlock = this._ToPre( doc, block, newBlock ) ;
+				preBlocks.push( newBlock ) ;
+			}
 			else if ( !newBlockIsPre && blockIsPre )
+			{
 				newBlock = this._FromPre( doc, block, newBlock ) ;
+				convertedPreBlocks.push( newBlock ) ;
+			}
 			else	// Convering from a regular block to another regular block.
 				FCKDomTools.MoveChildren( block, newBlock ) ;
@@ -874,4 +885,46 @@
 			block.parentNode.insertBefore( newBlock, block ) ;
 			FCKDomTools.RemoveNode( block ) ;
+		}
+
+		// Merge adjacent <PRE> blocks for #1229.
+		for ( var i = 0 ; i < preBlocks.length - 1 ; i++ )
+		{
+			// Check if the next block in HTML equals the next <PRE> block generated.
+			if ( FCKDomTools.GetNextSourceElement( preBlocks[i], true, [], [], true ) != preBlocks[i+1] )
+				continue ;
+
+			// Merge the upper <PRE> block's content into the lower <PRE> block.
+			// Remove the upper <PRE> block.
+			preBlocks[i+1].innerHTML = preBlocks[i].innerHTML + '\n\n' + preBlocks[i+1].innerHTML ;
+			FCKDomTools.RemoveNode( preBlocks[i] ) ;
+		}
+
+		// Split converted <PRE> blocks for #1229.
+		for ( var i = 0 ; i < convertedPreBlocks.length ; i++ )
+		{
+			var currentBlock = convertedPreBlocks[i] ;
+			var lastNewBlock = null ;
+			for ( var j = 0 ; j < currentBlock.childNodes.length ; j++ )
+			{
+				var cursor = currentBlock.childNodes[j] ;
+
+				// If we have two <BR>s, and they're not at the beginning or the end,
+				// then we'll split up the contents following them into another block.
+				if ( cursor.nodeName.IEquals( 'br' ) && j != 0 && j != currentBlock.childNodes.length - 2
+						&& cursor.nextSibling && cursor.nextSibling.nodeName.IEquals( 'br' ) )
+				{
+					FCKDomTools.RemoveNode( cursor.nextSibling ) ;
+					FCKDomTools.RemoveNode( cursor ) ;
+					j-- ;	// restart at current index at next iteration
+					lastNewBlock = FCKDomTools.InsertAfterNode( lastNewBlock || currentBlock, doc.createElement( currentBlock.nodeName ) ) ;
+					continue ;
+				}
+
+				if ( lastNewBlock )
+				{
+					FCKDomTools.MoveNode( cursor, lastNewBlock ) ;
+					j-- ;	// restart at current index at next iteration
+				}
+			}
 		}
 
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fcktoolbarbutton.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fcktoolbarbutton.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fcktoolbarbutton.js	(revision 1825)
@@ -49,12 +49,17 @@
 FCKToolbarButton.prototype.RefreshState = function()
 {
+	var uiButton = this._UIButton ;
+
+	if ( !uiButton )
+		return ;
+
 	// Gets the actual state.
 	var eState = FCK.ToolbarSet.CurrentInstance.Commands.GetCommand( this.CommandName ).GetState() ;
 
 	// If there are no state changes than do nothing and return.
-	if ( eState == this._UIButton.State ) return ;
+	if ( eState == uiButton.State ) return ;
 
 	// Sets the actual state.
-	this._UIButton.ChangeState( eState ) ;
+	uiButton.ChangeState( eState ) ;
 }
 
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckw3crange.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckw3crange.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/classes/fckw3crange.js	(revision 1825)
@@ -263,17 +263,21 @@
 			// If the start container has children and the offset is pointing
 			// to a child, then we should start from its previous sibling.
-			if ( startNode.childNodes.length > 0 &&  startOffset <= startNode.childNodes.length - 1 )
-			{
-				// If the offset points to the first node, we don't have a
-				// sibling, so let's use the first one, but mark it for removal.
-				if ( startOffset == 0 )
-				{
-					// Let's create a temporary node and mark it for removal.
-					startNode = startNode.insertBefore( this._Document.createTextNode(''), startNode.firstChild ) ;
-					removeStartNode = true ;
-				}
-				else
-					startNode = startNode.childNodes[ startOffset ].previousSibling ;
-			}
+
+			// If the offset points to the first node, we don't have a
+			// sibling, so let's use the first one, but mark it for removal.
+			if ( startOffset == 0 )
+			{
+				// Let's create a temporary node and mark it for removal.
+				startNode = startNode.insertBefore( this._Document.createTextNode(''), startNode.firstChild ) ;
+				removeStartNode = true ;
+			}
+			else if ( startOffset > startNode.childNodes.length - 1 )
+			{
+				// Let's create a temporary node and mark it for removal.
+				startNode = startNode.appendChild( this._Document.createTextNode('') ) ;
+				removeStartNode = true ;
+			}
+			else
+				startNode = startNode.childNodes[ startOffset ].previousSibling ;
 		}
 
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/commandclasses/fck_othercommands.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/commandclasses/fck_othercommands.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/commandclasses/fck_othercommands.js	(revision 1825)
@@ -258,8 +258,5 @@
 	oRange.MoveToSelection() ;
 	var oSplitInfo = oRange.SplitBlock() ;
-	if ( oSplitInfo.NextBlock )
-		oSplitInfo.NextBlock.parentNode.insertBefore( oFakeImage, oSplitInfo.NextBlock ) ;
-	else
-		oSplitInfo.PreviousBlock.parentNode.insertBefore( oFakeImage, oSplitInfo.PreviousBlock.nextSibling ) ;
+	oRange.InsertNode( oFakeImage ) ;
 
 	FCK.Events.FireEvent( 'OnSelectionChange' ) ;
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/commandclasses/fcklistcommands.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/commandclasses/fcklistcommands.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/commandclasses/fcklistcommands.js	(revision 1825)
@@ -146,5 +146,5 @@
 				{
 					rangeQueue = [] ;
-					var selectionObject = FCK.EditorWindow.getSelection() ;
+					var selectionObject = FCKSelection.GetSelection() ;
 					if ( selectionObject && listGroups.length == 0 )
 						rangeQueue.push( selectionObject.getRangeAt( 0 ) ) ;
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/fckeditorapi.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/fckeditorapi.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/fckeditorapi.js	(revision 1825)
@@ -43,16 +43,16 @@
 				'Version : "[Development]",' +
 				'VersionBuild : "[DEV]",' +
-				'__Instances : new Object(),' +
+				'Instances : new Object(),' +
 
 				'GetInstance : function( name )' +
 				'{' +
-					'return this.__Instances[ name ];' +
+					'return this.Instances[ name ];' +
 				'},' +
 
 				'_FormSubmit : function()' +
 				'{' +
-					'for ( var name in FCKeditorAPI.__Instances )' +
+					'for ( var name in FCKeditorAPI.Instances )' +
 					'{' +
-						'var oEditor = FCKeditorAPI.__Instances[ name ] ;' +
+						'var oEditor = FCKeditorAPI.Instances[ name ] ;' +
 						'if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )' +
 							'oEditor.UpdateLinkedField() ;' +
@@ -130,8 +130,12 @@
 
 		FCKeditorAPI = oParentWindow.FCKeditorAPI ;
+
+		// The __Instances properly has been changed to the public Instances,
+		// but we should still have the "deprecated" version of it.
+		FCKeditorAPI.__Instances = FCKeditorAPI.Instances ;
 	}
 
 	// Add the current instance to the FCKeditorAPI's instances collection.
-	FCKeditorAPI.__Instances[ FCK.Name ] = FCK ;
+	FCKeditorAPI.Instances[ FCK.Name ] = FCK ;
 }
 
@@ -163,5 +167,5 @@
 	if ( ! window.FCKUnloadFlag )
 		return ;
-	delete FCKeditorAPI.__Instances[ FCK.Name ] ;
+	delete FCKeditorAPI.Instances[ FCK.Name ] ;
 }
 function FCKeditorAPI_ConfirmCleanup()
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/fckscriptloader.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/fckscriptloader.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/fckscriptloader.js	(revision 1825)
@@ -41,4 +41,6 @@
 		return ;
 
+	FCKScriptLoader._LoadedScripts[ scriptName ] = true ;
+
 	var oScriptInfo = this._Scripts[ scriptName ] ;
 
@@ -66,6 +68,4 @@
 			this._LoadScript( sBaseScriptName + '_gecko.js' ) ;
 	}
-
-	FCKScriptLoader._LoadedScripts[ scriptName ] = true ;
 }
 
@@ -111,5 +111,5 @@
 FCKScriptLoader.AddScript( 'FCKConfig'			, 'internals/'	, ['FCKBrowserInfo','FCKConstants'] ) ;
 FCKScriptLoader.AddScript( 'FCKDebug'			, 'internals/'	, ['FCKConfig'] ) ;
-FCKScriptLoader.AddScript( 'FCKDomTools'		, 'internals/'	, ['FCKJSCoreExtensions','FCKBrowserInfo','FCKTools'], FCK_GENERIC ) ;
+FCKScriptLoader.AddScript( 'FCKDomTools'		, 'internals/'	, ['FCKJSCoreExtensions','FCKBrowserInfo','FCKTools','FCKDomRange'], FCK_GENERIC ) ;
 FCKScriptLoader.AddScript( 'FCKListsLib'		, 'internals/' ) ;
 FCKScriptLoader.AddScript( 'FCKListHandler'		, 'internals/'	, ['FCKConfig', 'FCKDocumentFragment', 'FCKJSCoreExtensions','FCKDomTools'], FCK_GENERIC ) ;
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fck.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fck.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fck.js	(revision 1825)
@@ -364,5 +364,5 @@
 		// IE doesn't support <abbr> and it breaks it. Let's protect it.
 		if ( FCKBrowserInfo.IsIE )
-			sTags += sTags.length > 0 ? '|ABBR|XML|EMBED' : 'ABBR|XML|EMBED' ;
+			sTags += sTags.length > 0 ? '|ABBR|XML|EMBED|OBJECT' : 'ABBR|XML|EMBED|OBJECT' ;
 
 		var oRegex ;
@@ -400,5 +400,5 @@
 		if ( FCKBrowserInfo.IsIE && FCK.EditorDocument )
 		{
-				FCK.EditorDocument.detachEvent("onselectionchange", Doc_OnSelectionChange ) ;
+			FCK.EditorDocument.detachEvent("onselectionchange", Doc_OnSelectionChange ) ;
 		}
 
@@ -661,4 +661,6 @@
 		var elementName = element.nodeName.toLowerCase() ;
 
+		FCKSelection.Restore() ;
+
 		// Create a range for the selection. V3 will have a new selection
 		// object that may internally supply this feature.
@@ -670,5 +672,5 @@
 			range.InsertNode( element ) ;
 
-			var next = FCKDomTools.GetNextSourceElement( element, false, null, [ 'hr','br','param','img','area','input' ] ) ;
+			var next = FCKDomTools.GetNextSourceElement( element, false, null, [ 'hr','br','param','img','area','input' ], true ) ;
 
 			// Be sure that we have something after the new element, so we can move the cursor there.
@@ -864,5 +866,5 @@
 		// Prevent the caret from going between the body and the padding node in Firefox.
 		// i.e. <body>|<p></p></body>
-		var sel = FCK.EditorWindow.getSelection() ;
+		var sel = FCKSelection.GetSelection() ;
 		if ( sel && sel.rangeCount == 1 )
 		{
@@ -1146,6 +1148,20 @@
 function FCKFocusManager_Win_OnFocus_Area()
 {
+	// Check if we are already focusing the editor (to avoid loops).
+	if ( FCKFocusManager._IsFocusing )
+		return ;
+
+	FCKFocusManager._IsFocusing = true ;
+
 	FCK.Focus() ;
 	FCKFocusManager_Win_OnFocus() ;
+
+	// The above FCK.Focus() call may trigger other focus related functions.
+	// So, to avoid a loop, we delay the focusing mark removal, so it get
+	// executed after all othre functions have been run.
+	FCKTools.RunFunction( function()
+		{
+			delete FCKFocusManager._IsFocusing ;
+		} ) ;
 }
 
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fck_gecko.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fck_gecko.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fck_gecko.js	(revision 1825)
@@ -89,5 +89,5 @@
 		var moveCursor = function()
 		{
-			var selection = FCK.EditorWindow.getSelection() ;
+			var selection = FCKSelection.GetSelection() ;
 			var range = selection.getRangeAt(0) ;
 			if ( ! range || ! range.collapsed )
@@ -105,5 +105,5 @@
 			// only perform the patched behavior if we're in an <a> tag, or the End key is pressed.
 			var parentTag = node.parentNode.tagName.toLowerCase() ;
-			if ( ! (  parentTag == 'a' ||
+			if ( ! (  parentTag == 'a' || String(node.parentNode.contentEditable) == 'false' ||
 					( ! ( FCKListsLib.BlockElements[parentTag] || FCKListsLib.NonEmptyBlockElements[parentTag] )
 					  && keyCode == 35 ) ) )
@@ -362,4 +362,6 @@
 	this.Focus() ;
 
+	FCKDocumentProcessor.Process( FCK.EditorDocument ) ;
+
 	// For some strange reason the SaveUndoStep() call doesn't activate the undo button at the first InsertHtml() call.
 	this.Events.FireEvent( "OnSelectionChange" ) ;
@@ -447,5 +449,5 @@
 {
 	FCK._FillEmptyBlock( FCK.EditorDocument.body.firstChild ) ;
-	var sel = FCK.EditorWindow.getSelection() ;
+	var sel = FCKSelection.GetSelection() ;
 	if ( !sel || sel.rangeCount < 1 )
 		return ;
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fck_ie.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fck_ie.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fck_ie.js	(revision 1825)
@@ -94,5 +94,5 @@
 {
 	// Don't fire the event if no document is loaded.
-	if ( FCK.EditorDocument )
+	if ( !FCK.IsSelectionChangeLocked && FCK.EditorDocument )
 		FCK.Events.FireEvent( "OnSelectionChange" ) ;
 }
@@ -156,5 +156,5 @@
 
 	// Gets the actual selection.
-	var oSel = FCK.EditorDocument.selection ;
+	var oSel = FCKSelection.GetSelection() ;
 
 	// Deletes the actual selection contents.
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckcommands.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckcommands.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckcommands.js	(revision 1825)
@@ -56,5 +56,5 @@
 		case 'BulletedList'	: oCommand = new FCKDialogCommand( 'BulletedList', FCKLang.BulletedListProp		, 'dialog/fck_listprop.html?UL'	, 370, 160 ) ; break ;
 		case 'NumberedList'	: oCommand = new FCKDialogCommand( 'NumberedList', FCKLang.NumberedListProp		, 'dialog/fck_listprop.html?OL'	, 370, 160 ) ; break ;
-		case 'About'		: oCommand = new FCKDialogCommand( 'About'		, FCKLang.About					, 'dialog/fck_about.html'		, 400, 310, function(){ return FCK_TRISTATE_OFF ; } ) ; break ;
+		case 'About'		: oCommand = new FCKDialogCommand( 'About'		, FCKLang.About					, 'dialog/fck_about.html'		, 420, 330, function(){ return FCK_TRISTATE_OFF ; } ) ; break ;
 		case 'Find'			: oCommand = new FCKDialogCommand( 'Find'		, FCKLang.DlgFindAndReplaceTitle, 'dialog/fck_replace.html'		, 340, 230, null, null, 'Find' ) ; break ;
 		case 'Replace'		: oCommand = new FCKDialogCommand( 'Replace'	, FCKLang.DlgFindAndReplaceTitle, 'dialog/fck_replace.html'		, 340, 230, null, null, 'Replace' ) ; break ;
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckconfig.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckconfig.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckconfig.js	(revision 1825)
@@ -177,8 +177,5 @@
 
 	// <noscript> tags (get lost in IE and messed up in FF).
-	/<noscript[\s\S]*?<\/noscript>/gi,
-
-	// Protect <object> tags. See #359.
-	/<object[\s\S]+?<\/object>/gi
+	/<noscript[\s\S]*?<\/noscript>/gi
 ] ;
 
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckdialog.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckdialog.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckdialog.js	(revision 1825)
@@ -76,7 +76,14 @@
 	}
 
+	var resetStyles = function( element )
+	{
+		element.style.cssText = 'margin:0;' +
+			'padding:0;' +
+			'border:0;' +
+			'background-color:transparent;' +
+			'background-image:none;' ;
+	}
+
 	return {
-		SelectionData : null,
-
 		/**
 		 * Opens a dialog window using the standard dialog template.
@@ -94,38 +101,8 @@
 				Editor : window,
 				CustomValue : customValue,		// Optional
-				SelectionData : null,
 				TopWindow : topWindow
 			}
 
-			var currentInstance = FCK.ToolbarSet.CurrentInstance ;
-
-			// IE doens't support multiple selections, even if in different
-			// IFRAMEs, like the dialog, so the current selection must be saved to
-			// be restored in the dialog code.
-			if ( FCKBrowserInfo.IsIE && !topDialog )
-			{
-				// Ensures the editor has the selection focus. (#1801)
-				currentInstance.Focus() ;
-
-				var editorDocument = currentInstance.EditorDocument ;
-				var selection = editorDocument.selection ;
-				var range ;
-
-				if ( selection )
-				{
-					range = selection.createRange() ;
-
-					// Ensure that the range comes from the editor document.
-					if ( range )
-					{
-						if ( range.parentElement && FCKTools.GetElementDocument( range.parentElement() ) != editorDocument )
-							range = null ;
-						else if ( range.item && FCKTools.GetElementDocument( range.item(0) )!= editorDocument )
-							range = null ;
-					}
-				}
-
-				this.SelectionData = range ;
-			}
+			FCK.ToolbarSet.CurrentInstance.Selection.Save() ;
 
 			// Calculate the dialog position, centering it on the screen.
@@ -137,4 +114,5 @@
 			// Setup the IFRAME that will hold the dialog.
 			var dialog = topDocument.createElement( 'iframe' ) ;
+			resetStyles( dialog ) ;
 			dialog.src = FCKConfig.BasePath + 'fckdialog.html' ;
 
@@ -182,5 +160,5 @@
 			{
 				// Set the Focus in the browser, so the "OnBlur" event is not
-				// fired. In IE, there is no need to d othat because the dialog
+				// fired. In IE, there is no need to do that because the dialog
 				// already moved the selection to the editing area before
 				// closing (EnsureSelection). Also, the Focus() call here
@@ -192,5 +170,7 @@
 				// Bug #1918: Assigning topDialog = null directly causes IE6 to crash.
 				setTimeout( function(){ topDialog = null ; }, 0 ) ;
-				this.SelectionData = null ;
+
+				// Release the previously saved selection.
+				FCK.ToolbarSet.CurrentInstance.Selection.Release() ;
 			}
 		},
@@ -200,4 +180,5 @@
 			// Setup the DIV that will be used to cover.
 			cover = topDocument.createElement( 'div' ) ;
+			resetStyles( cover ) ;
 			FCKDomTools.SetElementStyles( cover,
 				{
@@ -215,4 +196,5 @@
 			{
 				var iframe = topDocument.createElement( 'iframe' ) ;
+				resetStyles( iframe ) ;
 				iframe.hideFocus = true ;
 				iframe.frameBorder = 0 ;
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckdocumentprocessor.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckdocumentprocessor.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckdocumentprocessor.js	(revision 1825)
@@ -34,12 +34,15 @@
 FCKDocumentProcessor.Process = function( document )
 {
+	var bIsDirty = FCK.IsDirty() ;
 	var oProcessor, i = 0 ;
 	while( ( oProcessor = this._Items[i++] ) )
 		oProcessor.ProcessDocument( document ) ;
+	if ( !bIsDirty )
+		FCK.ResetIsDirty() ;
 }
 
 var FCKDocumentProcessor_CreateFakeImage = function( fakeClass, realElement )
 {
-	var oImg = FCK.EditorDocument.createElement( 'IMG' ) ;
+	var oImg = FCKTools.GetElementDocument( realElement ).createElement( 'IMG' ) ;
 	oImg.className = fakeClass ;
 	oImg.src = FCKConfig.FullBasePath + 'images/spacer.gif' ;
@@ -119,54 +122,60 @@
 }
 
-// Flash Embeds.
-var FCKFlashProcessor = FCKDocumentProcessor.AppendNew() ;
-FCKFlashProcessor.ProcessDocument = function( document )
-{
-	/*
-	Sample code:
-	This is some <embed src="/UserFiles/Flash/Yellow_Runners.swf"></embed><strong>sample text</strong>. You are&nbsp;<a name="fred"></a> using <a href="http://www.fckeditor.net/">FCKeditor</a>.
-	*/
-
-	var bIsDirty = FCK.IsDirty() ;
-
-	var aEmbeds = document.getElementsByTagName( 'EMBED' ) ;
-
-	var oEmbed ;
-	var i = aEmbeds.length - 1 ;
-	while ( i >= 0 && ( oEmbed = aEmbeds[i--] ) )
-	{
-		// IE doesn't return the type attribute with oEmbed.type or oEmbed.getAttribute("type")
-		// But it turns out that after accessing it then it doesn't gets copied later
-		var oType = oEmbed.attributes[ 'type' ] ;
-
-		// Check the extension and the type. Now it should be enough with just the type
-		// Opera doesn't return oEmbed.src so oEmbed.src.EndsWith will fail
-		if ( (oEmbed.src && oEmbed.src.EndsWith( '.swf', true )) || ( oType && oType.nodeValue == 'application/x-shockwave-flash' ) )
-		{
-			var oCloned = oEmbed.cloneNode( true ) ;
-
-			var oImg = FCKDocumentProcessor_CreateFakeImage( 'FCK__Flash', oCloned ) ;
-			oImg.setAttribute( '_fckflash', 'true', 0 ) ;
-
-			FCKFlashProcessor.RefreshView( oImg, oEmbed ) ;
-
-			oEmbed.parentNode.insertBefore( oImg, oEmbed ) ;
-			oEmbed.parentNode.removeChild( oEmbed ) ;
-		}
-	}
-
-	// Fix the IsDirty state (#1406).
-	if ( !bIsDirty )
-		FCK.ResetIsDirty() ;
-}
-
-FCKFlashProcessor.RefreshView = function( placeHolderImage, originalEmbed )
-{
-	if ( originalEmbed.getAttribute( 'width' ) > 0 )
-		placeHolderImage.style.width = FCKTools.ConvertHtmlSizeToStyle( originalEmbed.getAttribute( 'width' ) ) ;
-
-	if ( originalEmbed.getAttribute( 'height' ) > 0 )
-		placeHolderImage.style.height = FCKTools.ConvertHtmlSizeToStyle( originalEmbed.getAttribute( 'height' ) ) ;
-}
+// EMBED and OBJECT tags.
+FCKEmbedAndObjectProcessor = (function()
+{
+	var customProcessors = [] ;
+
+	var processElement = function( el )
+	{
+		var clone = el.cloneNode( true ) ;
+		var replaceElement ;
+		var fakeImg = replaceElement = FCKDocumentProcessor_CreateFakeImage( 'FCK__UnknownObject', clone ) ;
+		FCKEmbedAndObjectProcessor.RefreshView( fakeImg, el ) ;
+
+		for ( var i = 0 ; i < customProcessors.length ; i++ )
+			replaceElement = customProcessors[i]( el, replaceElement ) || replaceElement ;
+
+		if ( replaceElement != fakeImg )
+			FCKTempBin.RemoveElement( fakeImg.getAttribute( '_fckrealelement' ) ) ;
+
+		el.parentNode.replaceChild( replaceElement, el ) ;
+	}
+
+	return FCKTools.Merge( FCKDocumentProcessor.AppendNew(),
+		       {
+				ProcessDocument : function( doc )
+				{
+					// Firefox 3 would sometimes throw an unknown exception while accessing EMBEDs and OBJECTs
+					// without the setTimeout().
+					FCKTools.RunFunction( function()
+						{
+							// Process OBJECTs first, since EMBEDs can sometimes go inside OBJECTS (e.g. Flash).
+							var aObjects = doc.getElementsByTagName( 'object' );
+							for ( var i = aObjects.length - 1 ; i >= 0 ; i-- )
+								processElement( aObjects[i] ) ;
+
+							// Now process any EMBEDs left.
+							var aEmbeds = doc.getElementsByTagName( 'embed' ) ;
+							for ( var i = aEmbeds.length - 1 ; i >= 0 ; i-- )
+								processElement( aEmbeds[i] ) ;
+						} ) ;
+				},
+
+				RefreshView : function( placeHolder, original )
+				{
+					if ( original.getAttribute( 'width' ) > 0 )
+						placeHolder.style.width = FCKTools.ConvertHtmlSizeToStyle( original.getAttribute( 'width' ) ) ;
+
+					if ( original.getAttribute( 'height' ) > 0 )
+						placeHolder.style.height = FCKTools.ConvertHtmlSizeToStyle( original.getAttribute( 'height' ) ) ;
+				},
+
+				AddCustomHandler : function( func )
+				{
+					customProcessors.push( func ) ;
+				}
+			} ) ;
+} )() ;
 
 FCK.GetRealElement = function( fakeElement )
@@ -230,2 +239,11 @@
 	}
 }
+
+// Flash handler.
+FCKEmbedAndObjectProcessor.AddCustomHandler( function( el, fakeImg )
+	{
+		if ( ! ( el.nodeName.IEquals( 'embed' ) && ( el.type == 'application/x-shockwave-flash' || /\.swf($|#|\?)/i.test( el.src ) ) ) )
+			return ;
+		fakeImg.className = 'FCK__Flash' ;
+		fakeImg.setAttribute( '_fckflash', 'true', 0 );
+	} ) ;
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckdomtools.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckdomtools.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckdomtools.js	(revision 1825)
@@ -579,5 +579,5 @@
 	 * If element = <span />, we have these results:
 	 *		<b>This <i>is some</i><span /><i> sample</i> test text</b>			(If parent = <i>)
-	 *		<b>This <i>is some</i></b><span /><b<i> sample</i> test text</b>	(If parent = <b>)
+	 *		<b>This <i>is some</i></b><span /><b><i> sample</i> test text</b>	(If parent = <b>)
 	 */
 	BreakParent : function( element, parent, reusableRange )
@@ -1006,4 +1006,19 @@
 		if ( offset > 0 && offset > currentScroll )
 			window.scrollTo( 0, offset ) ;
+	},
+
+	/**
+	 * Check if the element can be edited inside the browser.
+	 */
+	CheckIsEditable : function( element )
+	{
+		// Get the element name.
+		var nodeName = element.nodeName.toLowerCase() ;
+
+		// Get the element DTD (defaults to span for unknown elements).
+		var childDTD = FCK.DTD[ nodeName ] || FCK.DTD.span ;
+
+		// In the DTD # == text node.
+		return ( childDTD['#'] && !FCKListsLib.NonEditableElements[ nodeName ] ) ;
 	}
 } ;
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcklistslib.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcklistslib.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcklistslib.js	(revision 1825)
@@ -55,4 +55,7 @@
 	StyleObjectElements : { img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1 },
 
+	// Elements that accept text nodes, but are not possible to edit in the browser.
+	NonEditableElements : { button:1,option:1,script:1,iframe:1,textarea:1,object:1,embed:1,map:1,applet:1 },
+
 	// Elements used to separate block contents.
 	BlockBoundaries : { p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1 },
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckselection_gecko.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckselection_gecko.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckselection_gecko.js	(revision 1825)
@@ -31,5 +31,5 @@
 
 	var sel ;
-	try { sel = FCK.EditorWindow.getSelection() ; } catch (e) {}
+	try { sel = this.GetSelection() ; } catch (e) {}
 
 	if ( sel && sel.rangeCount == 1 )
@@ -52,5 +52,5 @@
 FCKSelection.GetSelectedElement = function()
 {
-	var selection = !!FCK.EditorWindow && FCK.EditorWindow.getSelection() ;
+	var selection = !!FCK.EditorWindow && this.GetSelection() ;
 	if ( !selection || selection.rangeCount < 1 )
 		return null ;
@@ -73,5 +73,5 @@
 	else
 	{
-		var oSel = FCK.EditorWindow.getSelection() ;
+		var oSel = this.GetSelection() ;
 		if ( oSel )
 		{
@@ -118,5 +118,5 @@
 	else
 	{
-		var oSel = FCK.EditorWindow.getSelection() ;
+		var oSel = this.GetSelection() ;
 		if ( oSel && oSel.rangeCount > 0 )
 		{
@@ -136,5 +136,5 @@
 	oRange.selectNode( element ) ;
 
-	var oSel = FCK.EditorWindow.getSelection() ;
+	var oSel = this.GetSelection() ;
 	oSel.removeAllRanges() ;
 	oSel.addRange( oRange ) ;
@@ -143,5 +143,5 @@
 FCKSelection.Collapse = function( toStart )
 {
-	var oSel = FCK.EditorWindow.getSelection() ;
+	var oSel = this.GetSelection() ;
 
 	if ( toStart == null || toStart === true )
@@ -157,5 +157,5 @@
 	if ( ! oContainer && FCK.EditorWindow )
 	{
-		try		{ oContainer = FCK.EditorWindow.getSelection().getRangeAt(0).startContainer ; }
+		try		{ oContainer = this.GetSelection().getRangeAt(0).startContainer ; }
 		catch(e){}
 	}
@@ -177,5 +177,5 @@
 	var oContainer = this.GetSelectedElement() ;
 	if ( ! oContainer )
-		oContainer = FCK.EditorWindow.getSelection().getRangeAt(0).startContainer ;
+		oContainer = this.GetSelection().getRangeAt(0).startContainer ;
 
 	while ( oContainer )
@@ -192,5 +192,5 @@
 {
 	// Gets the actual selection.
-	var oSel = FCK.EditorWindow.getSelection() ;
+	var oSel = this.GetSelection() ;
 
 	// Deletes the actual selection contents.
@@ -202,2 +202,19 @@
 	return oSel ;
 }
+
+/**
+ * Returns the native selection object.
+ */
+FCKSelection.GetSelection = function()
+{
+	return FCK.EditorWindow.getSelection() ;
+}
+
+// The following are IE only features (we don't need then in other browsers
+// currently).
+FCKSelection.Save = function()
+{}
+FCKSelection.Restore = function()
+{}
+FCKSelection.Release = function()
+{}
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckselection_ie.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckselection_ie.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckselection_ie.js	(revision 1825)
@@ -29,9 +29,9 @@
 	try
 	{
-		var ieType = FCK.EditorDocument.selection.type ;
+		var ieType = FCKSelection.GetSelection().type ;
 		if ( ieType == 'Control' || ieType == 'Text' )
 			return ieType ;
 
-		if ( FCK.EditorDocument.selection.createRange().parentElement )
+		if ( this.GetSelection().createRange().parentElement )
 			return 'Text' ;
 	}
@@ -50,8 +50,8 @@
 	if ( this.GetType() == 'Control' )
 	{
-		var oRange = FCK.EditorDocument.selection.createRange() ;
+		var oRange = this.GetSelection().createRange() ;
 
 		if ( oRange && oRange.item )
-			return FCK.EditorDocument.selection.createRange().item(0) ;
+			return this.GetSelection().createRange().item(0) ;
 	}
 	return null ;
@@ -70,5 +70,5 @@
 
 		default :
-			return FCK.EditorDocument.selection.createRange().parentElement() ;
+			return this.GetSelection().createRange().parentElement() ;
 	}
 } ;
@@ -102,5 +102,5 @@
 {
 	FCK.Focus() ;
-	FCK.EditorDocument.selection.empty() ;
+	this.GetSelection().empty() ;
 	var oRange ;
 	try
@@ -125,5 +125,5 @@
 	if ( this.GetType() == 'Text' )
 	{
-		var oRange = FCK.EditorDocument.selection.createRange() ;
+		var oRange = this.GetSelection().createRange() ;
 		oRange.collapse( toStart == null || toStart === true ) ;
 		oRange.select() ;
@@ -136,5 +136,5 @@
 	var oContainer ;
 
-	if ( FCK.EditorDocument.selection.type == "Control" )
+	if ( this.GetSelection().type == "Control" )
 	{
 		oContainer = this.GetSelectedElement() ;
@@ -142,5 +142,5 @@
 	else
 	{
-		var oRange  = FCK.EditorDocument.selection.createRange() ;
+		var oRange  = this.GetSelection().createRange() ;
 		oContainer = oRange.parentElement() ;
 	}
@@ -163,7 +163,7 @@
 		return null ;
 
-	if ( FCK.EditorDocument.selection.type == "Control" )
-	{
-		oRange = FCK.EditorDocument.selection.createRange() ;
+	if ( this.GetSelection().type == "Control" )
+	{
+		oRange = this.GetSelection().createRange() ;
 		for ( i = 0 ; i < oRange.length ; i++ )
 		{
@@ -177,5 +177,5 @@
 	else
 	{
-		oRange  = FCK.EditorDocument.selection.createRange() ;
+		oRange  = this.GetSelection().createRange() ;
 		oNode = oRange.parentElement() ;
 	}
@@ -190,5 +190,5 @@
 {
 	// Gets the actual selection.
-	var oSel = FCK.EditorDocument.selection ;
+	var oSel = this.GetSelection() ;
 
 	// Deletes the actual selection contents.
@@ -200,2 +200,76 @@
 	return oSel ;
 } ;
+
+/**
+ * Returns the native selection object.
+ */
+FCKSelection.GetSelection = function()
+{
+	this.Restore() ;
+	return FCK.EditorDocument.selection ;
+}
+
+FCKSelection.Save = function()
+{
+	// Ensures the editor has the selection focus. (#1801)
+	FCK.Focus() ;
+
+	var editorDocument = FCK.EditorDocument ;
+
+	if ( !editorDocument )
+		return ;
+
+	var selection = editorDocument.selection ;
+	var range ;
+
+	if ( selection )
+	{
+		range = selection.createRange() ;
+
+		// Ensure that the range comes from the editor document.
+		if ( range )
+		{
+			if ( range.parentElement && FCKTools.GetElementDocument( range.parentElement() ) != editorDocument )
+				range = null ;
+			else if ( range.item && FCKTools.GetElementDocument( range.item(0) )!= editorDocument )
+				range = null ;
+		}
+	}
+
+	this.SelectionData = range ;
+}
+
+FCKSelection._GetSelectionDocument = function( selection )
+{
+	var range = selection.createRange() ;
+	if ( !range )
+		return null;
+	else if ( range.item )
+		return FCKTools.GetElementDocument( range.item( 0 ) ) ;
+	else
+		return FCKTools.GetElementDocument( range.parentElement() ) ;
+}
+
+FCKSelection.Restore = function()
+{
+	if ( this.SelectionData )
+	{
+		FCK.IsSelectionChangeLocked = true ;
+
+		try
+		{
+			// Don't repeat the restore process if the editor document is already selected.
+			if ( this._GetSelectionDocument( FCK.EditorDocument.selection ) == FCK.EditorDocument )
+				return ;
+			this.SelectionData.select() ;
+		}
+		catch ( e ) {}
+
+		FCK.IsSelectionChangeLocked = false ;
+	}
+}
+
+FCKSelection.Release = function()
+{
+	delete this.SelectionData ;
+}
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcktablehandler_gecko.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcktablehandler_gecko.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcktablehandler_gecko.js	(revision 1825)
@@ -26,5 +26,5 @@
 	var aCells = new Array() ;
 
-	var oSelection = FCK.EditorWindow.getSelection() ;
+	var oSelection = FCKSelection.GetSelection() ;
 
 	// If the selection is a text.
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcktablehandler_ie.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcktablehandler_ie.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcktablehandler_ie.js	(revision 1825)
@@ -32,5 +32,5 @@
 	var aCells = new Array() ;
 
-	var oRange = FCK.EditorDocument.selection.createRange() ;
+	var oRange = FCKSelection.GetSelection().createRange() ;
 //	var oParent = oRange.parentElement() ;
 	var oParent = FCKSelection.GetParentElement() ;
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcktools.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcktools.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcktools.js	(revision 1825)
@@ -46,5 +46,5 @@
 	return cssStyles.replace( /url\s*\(([\s'"]*)(.*?)([\s"']*)\)/g, function( match, opener, path, closer )
 		{
-			if ( /^\/|^\w?:/.test() )
+			if ( /^\/|^\w?:/.test( path ) )
 				return match ;
 			else
@@ -130,5 +130,5 @@
 			{
 				// The string may have several URLs separated by comma.
-				return this.GetStyleHtml( cssFileOrArrayOrDef.split(',') ) ;
+				return this.GetStyleHtml( cssFileOrArrayOrDef.split(','), markTemp ) ;
 			}
 			else
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcktools_gecko.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcktools_gecko.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcktools_gecko.js	(revision 1825)
@@ -121,34 +121,9 @@
 			// Originaly, we were had the following here:
 			// return document.implementation.createDocument( '', '', null ) ;
-			//
-			// But, when manipulating document.domain (#123), we had
-			// "Permission denied" errors when trying to call methods inside
-			// the returned object. To avoid it, we have to change to the
-			// following, by implementing a "custom" DOM document object, which
-			// includes the methods that are useful for us.
-
-			var domDoc = document.createDocumentFragment() ;
-
-			domDoc.createElement = function( name )
-			{
-				return document.createElement( name ) ;
-			}
-
-			domDoc.createTextNode = function( text )
-			{
-				return document.createTextNode( text ) ;
-			}
-
-			domDoc.createAttribute = function( attName )
-			{
-				return document.createAttribute( attName ) ;
-			}
-
-			domDoc.createComment = function( text )
-			{
-				return document.createComment( text ) ;
-			}
-
-			return domDoc ;
+			// But that doesn't work if we're running under domain relaxation mode, so we need a workaround.
+			// See http://ajaxian.com/archives/xml-messages-with-cross-domain-json about the trick we're using.
+			var doc = ( new DOMParser() ).parseFromString( '<tmp></tmp>', 'text/xml' ) ;
+			FCKDomTools.RemoveNode( doc.firstChild ) ;
+			return doc ;
 	}
 	return null ;
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcktools_ie.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcktools_ie.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fcktools_ie.js	(revision 1825)
@@ -75,4 +75,7 @@
 	{
 		case 'XmlHttp' :
+			// Try the native XMLHttpRequest introduced with IE7.
+			try { return new XMLHttpRequest() ; } catch (e) {}
+
 			aObjs = [ 'MSXML2.XmlHttp', 'Microsoft.XmlHttp' ] ;
 			break ;
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckundo.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckundo.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckundo.js	(revision 1825)
@@ -32,4 +32,6 @@
 FCKUndo._GetBookmark = function()
 {
+	FCKSelection.Restore() ;
+
 	var range = new FCKDomRange( FCK.EditorWindow ) ;
 	try
Index: /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckxhtml_gecko.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckxhtml_gecko.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/_source/internals/fckxhtml_gecko.js	(revision 1825)
@@ -25,5 +25,5 @@
 FCKXHtml._GetMainXmlString = function()
 {
-	return '<xhtml>' + this.MainNode.innerHTML + '</xhtml>' ;
+	return ( new XMLSerializer() ).serializeToString( this.MainNode ) ;
 }
 
Index: /FCKeditor/branches/versions/2.6.x/editor/css/fck_internal.css
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/css/fck_internal.css	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/css/fck_internal.css	(revision 1825)
@@ -52,4 +52,14 @@
 	background-position: center center;
 	background-image: url(images/fck_flashlogo.gif);
+	background-repeat: no-repeat;
+	width: 80px;
+	height: 80px;
+}
+
+.FCK__UnknownObject
+{
+	border: #a9a9a9 1px solid;
+	background-position: center center;
+	background-image: url(images/fck_plugin.gif);
 	background-repeat: no-repeat;
 	width: 80px;
Index: /FCKeditor/branches/versions/2.6.x/editor/dialog/common/fck_dialog_common.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/dialog/common/fck_dialog_common.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/dialog/common/fck_dialog_common.js	(revision 1825)
@@ -61,5 +61,5 @@
 	/* @Packager.RemoveLine
 	// CSS minified by http://iceyboard.no-ip.org/projects/css_compressor
-	return FCKConfig.BasePath + 'dialog/common/' + '|.ImagePreviewArea{border:#000 1px solid;overflow:auto;width:100%;height:170px;background-color:#fff}.FlashPreviewArea{border:#000 1px solid;padding:5px;overflow:auto;width:100%;height:170px;background-color:#fff}.BtnReset{float:left;background-position:center center;background-image:url(images/reset.gif);width:16px;height:16px;background-repeat:no-repeat;border:1px none;font-size:1px}.BtnLocked,.BtnUnlocked{float:left;background-position:center center;background-image:url(images/locked.gif);width:16px;height:16px;background-repeat:no-repeat;border:none 1px;font-size:1px}.BtnUnlocked{background-image:url(images/unlocked.gif)}.BtnOver{border:outset 1px;cursor:hand}' ;
+	return FCKConfig.BasePath + 'dialog/common/' + '|.ImagePreviewArea{border:#000 1px solid;overflow:auto;width:100%;height:170px;background-color:#fff}.FlashPreviewArea{border:#000 1px solid;padding:5px;overflow:auto;width:100%;height:170px;background-color:#fff}.BtnReset{float:left;background-position:center center;background-image:url(images/reset.gif);width:16px;height:16px;background-repeat:no-repeat;border:1px none;font-size:1px}.BtnLocked,.BtnUnlocked{float:left;background-position:center center;background-image:url(images/locked.gif);width:16px;height:16px;background-repeat:no-repeat;border:none 1px;font-size:1px}.BtnUnlocked{background-image:url(images/unlocked.gif)}.BtnOver{border:outset 1px;cursor:pointer;cursor:hand}' ;
 	@Packager.RemoveLine */
 }
@@ -105,5 +105,8 @@
 	var element = GetE( elementId ) ;
 	element.focus() ;
-	element.select() ;
+
+	// element.select may not be available for some fields (like <select>).
+	if ( element.select )
+		element.select() ;
 }
 
@@ -278,20 +281,21 @@
 				oldNode = null ;
 
-				if ( oEditor.FCKDialog.SelectionData )
+				if ( oEditor.FCK.Selection.SelectionData )
 				{
-					// Trick to refresh the selection object and avoid error in fckdialog.html Selection.EnsureSelection
+					// Trick to refresh the selection object and avoid error in
+					// fckdialog.html Selection.EnsureSelection
 					var oSel = oEditor.FCK.EditorDocument.selection ;
-					oEditor.FCKDialog.SelectionData = oSel.createRange() ; // Now oSel.type will be 'None' reflecting the real situation
+					oEditor.FCK.Selection.SelectionData = oSel.createRange() ; // Now oSel.type will be 'None' reflecting the real situation
 				}
 			}
 			oNewNode = oEditor.FCK.InsertElement( oNewNode ) ;
 
-			// FCKDialog.SelectionData is broken by now since we've deleted the previously selected element.
-			// So we need to reassign it.
-			if ( oEditor.FCKDialog.SelectionData )
+			// FCK.Selection.SelectionData is broken by now since we've
+			// deleted the previously selected element. So we need to reassign it.
+			if ( oEditor.FCK.Selection.SelectionData )
 			{
 				var range = oEditor.FCK.EditorDocument.body.createControlRange() ;
 				range.add( oNewNode ) ;
-				oEditor.FCKDialog.SelectionData = range ;
+				oEditor.FCK.Selection.SelectionData = range ;
 			}
 		}
Index: /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_about.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_about.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_about.html	(revision 1825)
@@ -1,3 +1,3 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
@@ -71,5 +71,5 @@
 		<table cellpadding="0" cellspacing="0" border="0" width="100%" style="height: 100%">
 			<tr>
-				<td>
+				<td colspan="2">
 					<img alt="" src="fck_about/logo_fckeditor.gif" width="236" height="41" align="left" />
 					<table width="80" border="0" cellspacing="0" cellpadding="5" bgcolor="#ffffff" align="right">
@@ -86,13 +86,21 @@
 			</tr>
 			<tr style="height: 100%">
-				<td align="center">
-					&nbsp;<br />
+				<td align="center" valign="middle">
 					<span style="font-size: 14px" dir="ltr">
-						<br />
 						<b><a href="http://www.fckeditor.net/?about" target="_blank" title="Visit the FCKeditor web site">
 							Support <b>Open Source</b> Software</a></b> </span>
-					<br />
-					<br />
-					<br />
+					<div style="padding-top:15px">
+						<img alt="" src="fck_about/logo_fredck.gif" width="87" height="36" />
+					</div>
+				</td>
+				<td align="center" nowrap="nowrap" valign="middle">
+					<div>
+						<div style="margin-bottom:5px" dir="ltr">Selected Sponsor</div>
+						<a href="http://www.spellchecker.net/fckeditor/" target="_blank"><img alt="Selected Sponsor" border="0" src="fck_about/sponsors/spellchecker_net.gif" width="75" height="75" /></a>
+					</div>
+				</td>
+			</tr>
+			<tr>
+				<td width="100%" nowrap="nowrap">
 					<span fcklang="DlgAboutInfo">For further information go to</span> <a href="http://www.fckeditor.net/?About"
 						target="_blank">http://www.fckeditor.net/</a>.
@@ -100,8 +108,6 @@
 					Copyright &copy; 2003-2008 <a href="#" onclick="SendEMail();">Frederico Caldeira Knabben</a>
 				</td>
-			</tr>
-			<tr>
 				<td align="center">
-					<img alt="" src="fck_about/logo_fredck.gif" width="87" height="36" />
+					<a href="http://www.fckeditor.net/sponsors/apply" target="_blank">Become a Sponsor</a>
 				</td>
 			</tr>
Index: /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_flash.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_flash.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_flash.html	(revision 1825)
@@ -97,5 +97,7 @@
 				<br />
 				<input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" />
-				<iframe name="UploadWindow" style="DISPLAY: none" src="javascript:void(0)"></iframe>
+				<script type="text/javascript">
+					document.write( '<iframe name="UploadWindow" style="DISPLAY: none" src="' + FCKTools.GetVoidUrl() + '"></iframe>' ) ;
+				</script>
 			</form>
 		</div>
Index: /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_flash/fck_flash.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_flash/fck_flash.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_flash/fck_flash.js	(revision 1825)
@@ -142,5 +142,5 @@
 	}
 
-	oEditor.FCKFlashProcessor.RefreshView( oFakeImage, oEmbed ) ;
+	oEditor.FCKEmbedAndObjectProcessor.RefreshView( oFakeImage, oEmbed ) ;
 
 	return true ;
Index: /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_image.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_image.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_image.html	(revision 1825)
@@ -165,5 +165,7 @@
 			<br />
 			<input id="btnUpload" type="submit" value="Send it to the Server" fcklang="DlgLnkBtnUpload" />
-			<iframe name="UploadWindow" style="display: none" src="javascript:void(0)"></iframe>
+			<script type="text/javascript">
+				document.write( '<iframe name="UploadWindow" style="display: none" src="' + FCKTools.GetVoidUrl() + '"></iframe>' ) ;
+			</script>
 		</form>
 	</div>
Index: /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_image/fck_image.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_image/fck_image.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_image/fck_image.js	(revision 1825)
@@ -251,6 +251,4 @@
 		else			// Creating a new link.
 		{
-			dialog.Selection.EnsureSelection() ;
-
 			if ( !bHasImage )
 				oEditor.FCKSelection.SelectNode( oImage ) ;
Index: /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_image/fck_image_preview.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_image/fck_image_preview.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_image/fck_image_preview.html	(revision 1825)
@@ -54,5 +54,5 @@
 	<div>
 		<a id="lnkPreview" onclick="return false;" style="cursor: default">
-			<img id="imgPreview" src="javascript:void(0)" onload="window.parent.UpdateOriginal();"
+			<img id="imgPreview" onload="window.parent.UpdateOriginal();"
 				style="display: none" alt="" /></a>Lorem ipsum dolor sit amet, consectetuer adipiscing
 		elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus
Index: /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_link/fck_link.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_link/fck_link.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_link/fck_link.js	(revision 1825)
@@ -160,5 +160,20 @@
 	// Activate the "OK" button.
 	dialog.SetOkButton( true ) ;
-	SelectField( 'txtUrl' ) ;
+
+	// Select the first field.
+	switch( GetE('cmbLinkType').value )
+	{
+		case 'url' :
+			SelectField( 'txtUrl' ) ;
+			break ;
+		case 'email' :
+			SelectField( 'txtEMailAddress' ) ;
+			break ;
+		case 'anchor' :
+			if ( GetE('divSelAnchor').style.display != 'none' )
+				SelectField( 'cmbAnchorName' ) ;
+			else
+				SelectField( 'cmbLinkType' ) ;
+	}
 }
 
@@ -624,5 +639,4 @@
 
 	// Select the (first) link.
-	dialog.Selection.EnsureSelection() ;
 	oEditor.FCKSelection.SelectNode( aLinks[0] );
 
Index: /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_replace.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_replace.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_replace.html	(revision 1825)
@@ -232,7 +232,6 @@
 // Knuth-Morris-Pratt Algorithm for stream input
 KMP_NOMATCH = 0 ;
-KMP_STARTED = 1 ;
-KMP_ADVANCED = 2 ;
-KMP_MATCHED = 3 ;
+KMP_ADVANCED = 1 ;
+KMP_MATCHED = 2 ;
 function KmpMatch( pattern, ignoreCase )
 {
@@ -269,5 +268,5 @@
 					return KMP_MATCHED;
 				}
-				return this._State > 1 ? KMP_ADVANCED : KMP_STARTED ;
+				return KMP_ADVANCED ;
 			}
 			else if ( this._State == 0 )
@@ -292,4 +291,5 @@
 	var matchState = KMP_NOMATCH ;
 	var matchBookmark = null ;
+	var matchBookmarkStart = [] ;
 
 	// Match finding.
@@ -306,5 +306,5 @@
 				{
 					matcher.Reset();
-					matchBookmark = null ;
+					matchBookmarkStart = [] ;
 				}
 			}
@@ -316,17 +316,21 @@
 				// So delete any positional information.
 				if ( matchState == KMP_NOMATCH )
-					matchBookmark = null ;
-				// The currently scanned character is a possible start, so mark down the starting position.
-				else if ( matchState == KMP_STARTED )
-					matchBookmark = { Start : cursor.concat( [] ) } ;
+					matchBookmarkStart = [] ;
+				// We've matched something, but it's not a complete match, so let's just mark down the position for backtracking later.
+				else if ( matchState == KMP_ADVANCED )
+				{
+					matchBookmarkStart.push( cursor.concat( [] ) ) ;
+					if ( matchBookmarkStart.length > matcher._State )
+						matchBookmarkStart.shift() ;
+				}
 				// Found a complete match! Mark down the ending position as well.
 				else if ( matchState == KMP_MATCHED )
 				{
-					// It is possible to get a KMP_MATCHED without KMP_STARTED when the match pattern is only 1 character.
+					// It is possible to get a KMP_MATCHED without KMP_ADVANCED when the match pattern is only 1 character.
 					// So need to check and mark down the starting position as well.
-					if ( matchBookmark == null )
-						matchBookmark = { Start : cursor.concat( [] ) } ;
-
-					matchBookmark.End = cursor.concat( [] ) ;
+					if ( matchBookmarkStart.length == 0 )
+						matchBookmarkStart = [cursor.concat( [] )] ;
+
+					matchBookmark = { 'Start' : matchBookmarkStart.shift(), 'End' : cursor.concat( [] ) } ;
 					matchBookmark.End[ matchBookmark.End.length - 1 ]++;
 
Index: /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_smiley.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_smiley.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_smiley.html	(revision 1825)
@@ -50,6 +50,4 @@
 function InsertSmiley( url )
 {
-	dialog.Selection.EnsureSelection() ;
-
 	oEditor.FCKUndo.SaveUndoStep() ;
 
Index: /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_specialchar.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_specialchar.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_specialchar.html	(revision 1825)
@@ -44,5 +44,4 @@
 {
 	oEditor.FCKUndo.SaveUndoStep() ;
-	parent.Selection.EnsureSelection() ;
 	oEditor.FCK.InsertHtml( charValue || "" ) ;
 	window.parent.Cancel() ;
Index: /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_tablecell.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_tablecell.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/dialog/fck_tablecell.html	(revision 1825)
@@ -37,5 +37,4 @@
 
 // Array of selected Cells
-dialog.Selection.EnsureSelection() ;
 var aCells = oEditor.FCKTableHandler.GetSelectedCells() ;
 
Index: /FCKeditor/branches/versions/2.6.x/editor/dtd/fck_dtd_test.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/dtd/fck_dtd_test.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/dtd/fck_dtd_test.html	(revision 1825)
@@ -17,6 +17,4 @@
 	<table border="1">
 		<script type="text/javascript">
-
-    alert(FCK.DTD);
 
 for ( var p in FCK.DTD )
Index: /FCKeditor/branches/versions/2.6.x/editor/fckdialog.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/fckdialog.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/fckdialog.html	(revision 1825)
@@ -376,36 +376,33 @@
 
 // Selection related functions.
-var Selection = function()
-{
-	return {
-		/**
-		 * Ensures that the editing area contains an active selection. This is a
-		 * requirement for IE, as it looses the selection when the focus moves to other
-		 * frames.
-		 */
-		EnsureSelection : function()
-		{
-			if ( FCKDialog.SelectionData )
-				FCKDialog.SelectionData.select() ;
-		},
-
-		/**
-		 * Get the FCKSelection object for the editor instance.
-		 */
-		GetSelection : function()
-		{
-			this.EnsureSelection() ;
-			return FCK.Selection ;
-		},
-
-		/**
-		 * Get the selected element in the editing area (for object selections).
-		 */
-		GetSelectedElement : function()
-		{
-			return this.GetSelection().GetSelectedElement() ;
-		}
-	} ;
-}() ;
+//(Became simple shortcuts after the fix for #1990)
+var Selection =
+{
+	/**
+	 * Ensures that the editing area contains an active selection. This is a
+	 * requirement for IE, as it looses the selection when the focus moves to other
+	 * frames.
+	 */
+	EnsureSelection : function()
+	{
+		FCK.Selection.Restore() ;
+	},
+
+	/**
+	 * Get the FCKSelection object for the editor instance.
+	 */
+	GetSelection : function()
+	{
+		return FCK.Selection ;
+	},
+
+	/**
+	 * Get the selected element in the editing area (for object selections).
+	 */
+	GetSelectedElement : function()
+	{
+		return FCK.Selection.GetSelectedElement() ;
+	}
+}
 
 // Tab related functions.
@@ -676,4 +673,5 @@
 	window.Cancel = function( dontFireChange )
 	{
+		Selection.EnsureSelection() ;
 		return CloseDialog( dontFireChange ) ;
 	} ;
@@ -682,6 +680,4 @@
 	{
 		Throbber.Hide() ;
-
-		Selection.EnsureSelection() ;
 
 		// Points the src to a non-existent location to avoid loading errors later, in case the dialog
@@ -694,5 +690,11 @@
 			// All dialog windows, by default, will fire the "OnSelectionChange"
 			// event, no matter the Ok or Cancel button has been pressed.
-			FCK.Events.FireEvent( 'OnSelectionChange' ) ;
+			// It seems that OnSelectionChange may enter on a concurrency state
+			// on some situations (#1965), so we should put the event firing in
+			// the execution queue instead of executing it immediately.
+			setTimeout( function()
+				{
+					FCK.Events.FireEvent( 'OnSelectionChange' ) ;
+				}, 0 ) ;
 		}
 
Index: /FCKeditor/branches/versions/2.6.x/editor/fckeditor.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/fckeditor.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/fckeditor.html	(revision 1825)
@@ -341,6 +341,7 @@
 	{
 		// Running in Chrome makes the window receive the event including subframes.
-		// we care only about this window. Ticket #1642
-		if ( e && e.originalTarget !== document )
+		// we care only about this window. Ticket #1642.
+		// #2002: The originalTarget from the event can be the current document, the window, or the editing area.
+		if ( e && e.originalTarget !== document && e.originalTarget !== window && (!e.originalTarget.ownerDocument || e.originalTarget.ownerDocument != document ))
 			return ;
 
@@ -350,6 +351,6 @@
 		if ( eInnerElement )
 		{
-			eInnerElement.style.height = 0 ;
-			eInnerElement.style.height = oCell.scrollHeight - 2 ;
+			eInnerElement.style.height = '0px' ;
+			eInnerElement.style.height = ( oCell.scrollHeight - 2 ) + 'px' ;
 		}
 	}
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/browser.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/browser.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/browser.html	(revision 1825)
@@ -25,7 +25,39 @@
 	<head>
 		<title>FCKeditor - Resources Browser</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 		<link href="browser.css" type="text/css" rel="stylesheet">
 		<script type="text/javascript" src="js/fckxml.js"></script>
 		<script language="javascript">
+// Automatically detect the correct document.domain (#1919).
+(function()
+{
+	var d = document.domain ;
+
+	while ( true )
+	{
+		// Test if we can access a parent property.
+		try
+		{
+			var test = window.opener.document.domain ;
+			break ;
+		}
+		catch( e ) {}
+
+		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+		d = d.replace( /.*?(?:\.|$)/, '' ) ;
+
+		if ( d.length == 0 )
+			break ;		// It was not able to detect the domain.
+
+		try
+		{
+			document.domain = d ;
+		}
+		catch (e)
+		{
+			break ;
+		}
+	}
+})() ;
 
 function GetUrlParam( paramName )
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/frmactualfolder.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/frmactualfolder.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/frmactualfolder.html	(revision 1825)
@@ -24,6 +24,38 @@
 <html>
 	<head>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 		<link href="browser.css" type="text/css" rel="stylesheet">
 		<script type="text/javascript">
+// Automatically detect the correct document.domain (#1919).
+(function()
+{
+	var d = document.domain ;
+
+	while ( true )
+	{
+		// Test if we can access a parent property.
+		try
+		{
+			var test = window.top.opener.document.domain ;
+			break ;
+		}
+		catch( e ) {}
+
+		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+		d = d.replace( /.*?(?:\.|$)/, '' ) ;
+
+		if ( d.length == 0 )
+			break ;		// It was not able to detect the domain.
+
+		try
+		{
+			document.domain = d ;
+		}
+		catch (e)
+		{
+			break ;
+		}
+	}
+})() ;
 
 function OnResize()
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/frmfolders.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/frmfolders.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/frmfolders.html	(revision 1825)
@@ -26,4 +26,5 @@
 	<head>
 		<link href="browser.css" type="text/css" rel="stylesheet">
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 		<script type="text/javascript" src="js/common.js"></script>
 		<script language="javascript">
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/frmresourceslist.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/frmresourceslist.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/frmresourceslist.html	(revision 1825)
@@ -25,4 +25,5 @@
 <head>
 	<link href="browser.css" type="text/css" rel="stylesheet" />
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 	<script type="text/javascript" src="js/common.js"></script>
 	<script type="text/javascript">
@@ -88,5 +89,5 @@
 function OpenFile( fileUrl )
 {
-	window.top.opener.SetUrl( encodeURI( fileUrl ) ) ;
+	window.top.opener.SetUrl( encodeURI( fileUrl ).replace( '#', '%23' ) ) ;
 	window.top.close() ;
 	window.top.opener.focus() ;
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/frmupload.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/frmupload.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/frmupload.html	(revision 1825)
@@ -25,4 +25,5 @@
 	<head>
 		<title>File Upload</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 		<link href="browser.css" type="text/css" rel="stylesheet" />
 		<script type="text/javascript" src="js/common.js"></script>
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/js/common.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/js/common.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/js/common.js	(revision 1825)
@@ -22,4 +22,36 @@
  * File Browser dialog window.
  */
+
+// Automatically detect the correct document.domain (#1919).
+(function()
+{
+	var d = document.domain ;
+
+	while ( true )
+	{
+		// Test if we can access a parent property.
+		try
+		{
+			var test = window.top.opener.document.domain ;
+			break ;
+		}
+		catch( e ) {}
+
+		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+		d = d.replace( /.*?(?:\.|$)/, '' ) ;
+
+		if ( d.length == 0 )
+			break ;		// It was not able to detect the domain.
+
+		try
+		{
+			document.domain = d ;
+		}
+		catch (e)
+		{
+			break ;
+		}
+	}
+})() ;
 
 function AddSelectOption( selectElement, optionText, optionValue )
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/js/fckxml.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/js/fckxml.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/browser/default/js/fckxml.js	(revision 1825)
@@ -32,6 +32,6 @@
 {
 	// Gecko / IE7
-	if ( typeof(XMLHttpRequest) != 'undefined' )
-		return new XMLHttpRequest() ;
+	try { return new XMLHttpRequest(); }
+	catch(e) {}
 
 	// IE6
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/io.asp
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/io.asp	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/io.asp	(revision 1825)
@@ -173,5 +173,5 @@
 
 	' Check for invalid folder paths (..)
-	If ( InStr( 1, sCurrentFolder, ".." ) <> 0 ) Then
+	If ( InStr( 1, sCurrentFolder, ".." ) <> 0 OR InStr( 1, sCurrentFolder, "\" ) <> 0) Then
 		SendError 102, ""
 	End If
@@ -186,6 +186,6 @@
 	oRegex.Global		= True
 
-' remove . \ / | : ? *  " < >
-	oRegex.Pattern = "(\.|\\|\/|\||:|\?|\*|""|\<|\>)"
+' remove . \ / | : ? *  " < > and control characters
+	oRegex.Pattern = "(\.|\\|\/|\||:|\?|\*|""|\<|\>|[\u0000-\u001F]|\u007F)"
 	SanitizeFolderName = oRegex.Replace( sNewFolderName, "_" )
 
@@ -204,6 +204,6 @@
 	end if
 
-' remove \ / | : ? *  " < >
-	oRegex.Pattern = "(\\|\/|\||:|\?|\*|""|\<|\>)"
+' remove \ / | : ? *  " < > and control characters
+	oRegex.Pattern = "(\\|\/|\||:|\?|\*|""|\<|\>|[\u0000-\u001F]|\u007F)"
 	SanitizeFileName = oRegex.Replace( sNewFileName, "_" )
 
@@ -215,4 +215,36 @@
 	Response.Clear
 	Response.Write "<script type=""text/javascript"">"
+	Response.Write "(function()"
+	Response.Write "{"
+	Response.Write "var d = document.domain ;"
+
+	Response.Write " while ( true )"
+	Response.Write "	{"
+	' Test if we can access a parent property.
+	Response.Write "		try"
+	Response.Write "		{"
+	Response.Write "			var test = window.top.opener.document.domain ;"
+	Response.Write "			break ;"
+	Response.Write "		}"
+	Response.Write "		catch( e ) {}"
+
+	' Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+	Response.Write "		d = d.replace( /.*?(?:\.|$)/, '' ) ;"
+
+	Response.Write "		if ( d.length == 0 )"
+	' It was not able to detect the domain.
+	Response.Write "			break ;"
+	Response.Write ""
+	Response.Write "		try"
+	Response.Write "		{"
+	Response.Write "			document.domain = d ;"
+	Response.Write "		}"
+	Response.Write "		catch (e)"
+	Response.Write "		{"
+	Response.Write "			break ;"
+	Response.Write "		}"
+	Response.Write "	}"
+	Response.Write "})() ;"
+
 	Response.Write "window.parent.OnUploadCompleted(" & errorNumber & ",""" & Replace( fileUrl, """", "\""" ) & """,""" & Replace( fileName, """", "\""" ) & """,""" & Replace( customMsg , """", "\""" ) & """) ;"
 	Response.Write "</script>"
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/upload.asp
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/upload.asp	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/asp/upload.asp	(revision 1825)
@@ -33,4 +33,8 @@
 <%
 
+Sub SendError( number, text )
+	SendUploadResults number, "", "", text
+End Sub
+
 ' Check if this uploader has been enabled.
 If ( ConfigIsEnabled = False ) Then
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf5_connector.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf5_connector.cfm	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf5_connector.cfm	(revision 1825)
@@ -130,5 +130,5 @@
 	<cfset xmlContent = "<Error number=""1"" text=""This connector is disabled. Please check the 'editor/filemanager/connectors/cfm/config.cfm' file"" />">
 
-<cfelseif find("..",url.currentFolder)>
+<cfelseif find("..",url.currentFolder) or find("\",url.currentFolder)>
 
 	<cfset xmlContent = "<Error number=""102"" />">
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf5_upload.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf5_upload.cfm	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf5_upload.cfm	(revision 1825)
@@ -48,4 +48,36 @@
 	{
 		WriteOutput('<script type="text/javascript">');
+		WriteOutput("(function()"&
+"{"&
+"	var d = document.domain ;"&
+""&
+"	while ( true )"&
+"	{"&
+		// Test if we can access a parent property.
+"		try"&
+"		{"&
+"			var test = window.top.opener.document.domain ;"&
+"			break ;"&
+"		}"&
+"		catch( e ) {}"&
+""&
+		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+"		d = d.replace( /.*?(?:\.|$)/, '' ) ;"&
+""&
+"		if ( d.length == 0 )"&
+			// It was not able to detect the domain.
+"			break ;"&
+""&
+"		try"&
+"		{"&
+"			document.domain = d ;"&
+"		}"&
+"		catch (e)"&
+"		{"&
+"			break ;"&
+"		}"&
+"	}"&
+"})() ;");
+
 		WriteOutput('window.parent.OnUploadCompleted(' & errorNumber & ', "' & JSStringFormat(fileUrl) & '", "' & JSStringFormat(fileName) & '", "' & JSStringFormat(customMsg) & '");' );
 		WriteOutput('</script>');
@@ -68,5 +100,5 @@
 </cfif>
 
-<cfif find( "..", url.currentFolder)>
+<cfif find( "..", url.currentFolder) or find( "\", url.currentFolder)>
 	<cfset SendUploadResults(102)>
 	<cfabort>
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_io.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_io.cfm	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_io.cfm	(revision 1825)
@@ -175,5 +175,5 @@
 </cffunction>
 
-<cffunction name="GetCurrentFolder" returntype="String" output="false">
+<cffunction name="GetCurrentFolder" returntype="String" output="true">
 	<cfset var sCurrentFolder = "/">
 
@@ -194,5 +194,5 @@
 	<cfset sCurrentFolder = rereplace( sCurrentFolder, "//+", "/", "all" )>
 
-	<cfif find( "..", sCurrentFolder)>
+	<cfif find( "..", sCurrentFolder) or find( "\", sCurrentFolder) >
 		<cfset SendError( 102, "" )>
 	</cfif>
@@ -205,6 +205,6 @@
 
 	<!--- Do a cleanup of the folder name to avoid possible problems --->
-	<!--- Remove . \ / | : ? * " < > --->
-	<cfset sNewFolderName = rereplace( sNewFolderName, '\.+|\\+|\/+|\|+|\:+|\?+|\*+|"+|<+|>+', "_", "all" )>
+	<!--- Remove . \ / | : ? * " < > and control characters --->
+	<cfset sNewFolderName = rereplace( sNewFolderName, '\.+|\\+|\/+|\|+|\:+|\?+|\*+|"+|<+|>+|[[:cntrl:]]+', "_", "all" )>
 
 	<cfreturn sNewFolderName>
@@ -267,5 +267,36 @@
 
 	<cfoutput>
-		<script type="text/javascript">
+<script type="text/javascript">
+(function()
+{
+	var d = document.domain ;
+
+	while ( true )
+	{
+		// Test if we can access a parent property.
+		try
+		{
+			var test = window.top.opener.document.domain ;
+			break ;
+		}
+		catch( e ) {}
+
+		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+		d = d.replace( /.*?(?:\.|$)/, '' ) ;
+
+		if ( d.length == 0 )
+			break ;		// It was not able to detect the domain.
+
+		try
+		{
+			document.domain = d ;
+		}
+		catch (e)
+		{
+			break ;
+		}
+	}
+})() ;
+
 			window.parent.OnUploadCompleted( #errorNumber#, "#JSStringFormat(fileUrl)#", "#JSStringFormat(fileName)#", "#JSStringFormat(customMsg)#" );
 		</script>
@@ -282,6 +313,6 @@
 
 	<!--- Do a cleanup of the file name to avoid possible problems --->
-	<!--- Remove \ / | : ? * " < > --->
-	<cfset sNewFileName = rereplace( sNewFileName, '\\[.]+|\\+|\/+|\|+|\:+|\?+|\*+|"+|<+|>+', "_", "all" )>
+	<!--- Remove \ / | : ? * " < > and control characters --->
+	<cfset sNewFileName = rereplace( sNewFileName, '\\[.]+|\\+|\/+|\|+|\:+|\?+|\*+|"+|<+|>+|[[:cntrl:]]+', "_", "all" )>
 
 	<cfreturn sNewFileName>
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_upload.cfm
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_upload.cfm	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/cfm/cf_upload.cfm	(revision 1825)
@@ -34,4 +34,10 @@
 <cfinclude template="cf_commands.cfm">
 
+<cffunction name="SendError" returntype="void" output="true">
+	<cfargument name="number" required="true" type="Numeric">
+	<cfargument name="text" required="true">
+	<cfreturn SendUploadResults( "#ARGUMENTS.number#", "", "", "ARGUMENTS.text" )>
+</cffunction>
+
 <cfset REQUEST.Config = Config>
 <cfif find( "/", getBaseTemplatePath() ) >
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/lasso/connector.lasso
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/lasso/connector.lasso	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/lasso/connector.lasso	(revision 1825)
@@ -56,4 +56,63 @@
 	);
 
+	/*.....................................................................
+	Custom tag sets the HTML response.
+	*/
+
+	define_tag(
+		'htmlreply',
+		-namespace='fck_',
+		-priority='replace',
+		-required='uploadResult',
+		-optional='NewFilePath',
+		-type='string',
+		-description='Sets the HTML response for the FCKEditor File Upload feature.'
+	);
+		$__html_reply__ = '\
+<script type="text/javascript">
+(function()
+{
+	var d = document.domain ;
+
+	while ( true )
+	{
+		// Test if we can access a parent property.
+		try
+		{
+			var test = window.top.opener.document.domain ;
+			break ;
+		}
+		catch( e ) {}
+
+		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+		d = d.replace( /.*?(?:\\.|$)/, "" ) ;
+
+		if ( d.length == 0 )
+			break ;		// It was not able to detect the domain.
+
+		try
+		{
+			document.domain = d ;
+		}
+		catch (e)
+		{
+			break ;
+		}
+	}
+})() ;
+';
+			if($uploadResult == '0' || $uploadResult == '201');
+			$__html_reply__ = $__html_reply__ + '\
+	window.parent.OnUploadCompleted(' + $uploadResult + ',\'' + $NewFilePath + '\',\'' + $NewFilePath->split('/')->last + '\');
+</script>
+			';
+			else;
+			$__html_reply__ = $__html_reply__ + '\
+	window.parent.OnUploadCompleted(' + $uploadResult + ');
+</script>
+			';
+			/if;
+	/define_tag;
+
 
     /*.....................................................................
@@ -64,7 +123,19 @@
 	var('currentFolderURL' = $ServerPath
 		+ $config->find('Subdirectories')->find(action_param('Type'))
-		+ action_param('CurrentFolder')
+		+ $CurrentFolder
 	);
 
+	if($CurrentFolder->(Find: '..') || $CurrentFolder->(Find: '\\'));
+		if($Command == 'FileUpload');
+			$responseType = 'html';
+			$uploadResult = '102';
+			fck_htmlreply(
+				-uploadResult=$uploadResult
+			);
+		else;
+			$errorNumber = 102;
+			$commandData += '<Error number="' + $errorNumber + '" />\n';
+		/if;
+	else;
 
     /*.....................................................................
@@ -111,4 +182,5 @@
             */
 			case('CreateFolder');
+				$NewFolderName = (String_ReplaceRegExp: $NewFolderName, -find='\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_');
 				var('newFolder' = $currentFolderURL + $NewFolderName + '/');
 				file_create($newFolder);
@@ -149,5 +221,9 @@
                 Was a file actually uploaded?
                 */
-				file_uploads->size ? $NewFile = file_uploads->get(1) | $uploadResult = '202';
+                if(file_uploads->size);
+                	$NewFile = file_uploads->get(1);
+                else;
+                	$uploadResult = '202';
+                /if;
 
 				if($uploadResult == '0');
@@ -158,7 +234,9 @@
                     */
 					$NewFileName = $NewFile->find('OrigName');
+					$NewFileName = (String_ReplaceRegExp: $NewFileName, -find='\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_');
 					$OrigFilePath = $currentFolderURL + $NewFileName;
 					$NewFilePath = $OrigFilePath;
 					local('fileExtension') = '.' + $NewFile->find('OrigExtension');
+					#fileExtension = (String_ReplaceRegExp: #fileExtension, -find='\\\\|\\/|\\||\\:|\\?|\\*|"|<|>', -replace='_');
 					local('shortFileName') = $NewFileName->removetrailing(#fileExtension)&;
 
@@ -192,29 +270,15 @@
 								$OrigFilePath != $NewFilePath ? $uploadResult = 201;
 							case;
-								$uploadResult = '202';
+								$uploadResult = file_currenterror( -errorcode);
 						/select;
 					/if;
 				/if;
-
-
-                /*.........................................................
-                Set the HTML response.
-                */
-                if($uploadResult == '0' || $uploadResult == '201');
-				$__html_reply__ = '\
-<script type="text/javascript">
-	window.parent.frames[\'frmUpload\'].OnUploadCompleted(' + $uploadResult + ',\'' + $NewFilePath + '\',\'' + $NewFilePath->split('/')->last + '\');
-</script>
-				';
-                else;
-				$__html_reply__ = '\
-<script type="text/javascript">
-	window.parent.frames[\'frmUpload\'].OnUploadCompleted(' + $uploadResult + ');
-</script>
-				';
-				/if;
+				fck_htmlreply(
+					-uploadResult=$uploadResult,
+					-NewFilePath=$NewFilePath
+				);
 		/select;
 	/inline;
-
+	/if;
 
     /*.....................................................................
@@ -235,23 +299,24 @@
 Content-Type: text/xml; charset=utf-8
 [//lasso
-		/header;
-
-
-        /*.................................................................
-        Set the content type encoding for Lasso.
-        */
+/header;
+
+		/*
+			Set the content type encoding for Lasso.
+		*/
 		content_type('text/xml; charset=utf-8');
 
-
-        /*.................................................................
-        Wrap the response as XML and output.
-        */
+		/*
+			Wrap the response as XML and output.
+		*/
 		$__html_reply__ = '\
 <?xml version="1.0" encoding="utf-8" ?>
-<Connector command="' + $Command + '" resourceType="' + $Type + '">
-	<CurrentFolder path="' + $CurrentFolder + '" url="' + $currentFolderURL + '" />
-' + $commandData + '
-</Connector>
-		';
+<Connector command="' + $Command + '" resourceType="' + $Type + '">';
+
+		if($errorNumber != '102');
+			$__html_reply__ += '<CurrentFolder path="' + $CurrentFolder + '" url="' + $currentFolderURL + '" />';
+		/if;
+
+		$__html_reply__ += $commandData + '
+</Connector>';
 	/if;
 ]
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/lasso/upload.lasso
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/lasso/upload.lasso	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/lasso/upload.lasso	(revision 1825)
@@ -57,5 +57,4 @@
 	);
 
-
 	/*.....................................................................
 	Custom tag sets the HTML response.
@@ -78,4 +77,34 @@
 		$__html_reply__ = '\
 <script type="text/javascript">
+(function()
+{
+	var d = document.domain ;
+
+	while ( true )
+	{
+		// Test if we can access a parent property.
+		try
+		{
+			var test = window.top.opener.document.domain ;
+			break ;
+		}
+		catch( e ) {}
+
+		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+		d = d.replace( /.*?(?:\\.|$)/, "" ) ;
+
+		if ( d.length == 0 )
+			break ;		// It was not able to detect the domain.
+
+		try
+		{
+			document.domain = d ;
+		}
+		catch (e)
+		{
+			break ;
+		}
+	}
+})() ;
 	window.parent.OnUploadCompleted(' + #errorNumber + ',"'
 		+ string_replace(#fileUrl, -find='"', -replace='\\"') + '","'
@@ -86,4 +115,7 @@
 	/define_tag;
 
+	if($CurrentFolder->(Find: '..') || $CurrentFolder->(Find: '\\'));
+		$errorNumber = 102;
+	/if;
 
 	if($config->find('Enabled'));
@@ -95,5 +127,7 @@
 			Was a file actually uploaded?
 			*/
-			file_uploads->size ? $NewFile = file_uploads->get(1) | $errorNumber = 202;
+			if($errorNumber != '102');
+				file_uploads->size ? $NewFile = file_uploads->get(1) | $errorNumber = 202;
+			/if;
 
 			if($errorNumber == 0);
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/commands.pl
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/commands.pl	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/commands.pl	(revision 1825)
@@ -92,4 +92,5 @@
 	if($FORM{'NewFolderName'} ne "") {
 		$sNewFolderName = $FORM{'NewFolderName'};
+		$sNewFolderName =~ s/\.|\\|\/|\||\:|\?|\*|\"|<|>|[[:cntrl:]]/_/g;
 		# Map the virtual path to the local server path of the current folder.
 		$sServerDir = &ServerMapFolder($resourceType, $currentFolder);
@@ -129,4 +130,5 @@
 		# Get the uploaded file name.
 		$sFileName = $new_fname;
+		$sFileName =~ s/\\|\/|\||\:|\?|\*|\"|<|>|[[:cntrl:]]/_/g;
 		$sOriginalFileName = $sFileName;
 
@@ -168,6 +170,41 @@
 	local($sErrorNumber, $sFileUrl, $sFileName, $customMsg) = @_;
 
-	print "Content-type: text/html\n\n";
-	print '<script type="text/javascript">';
+	print <<EOF;
+Content-type: text/html
+
+<script type="text/javascript">
+// Automatically detect the correct document.domain (#1919).
+(function()
+{
+	var d = document.domain ;
+
+	while ( true )
+	{
+		// Test if we can access a parent property.
+		try
+		{
+			var test = window.top.opener.document.domain ;
+			break ;
+		}
+		catch( e ) {}
+
+		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+		d = d.replace( /.*?(?:\\.|\$)/, '' ) ;
+
+		if ( d.length == 0 )
+			break ;		// It was not able to detect the domain.
+
+		try
+		{
+			document.domain = d ;
+		}
+		catch (e)
+		{
+			break ;
+		}
+	}
+})() ;
+
+EOF
 	print 'window.parent.OnUploadCompleted(' . $sErrorNumber . ',"' . JS_cnv($sFileUrl) . '","' . JS_cnv($sFileName) . '","' . JS_cnv($customMsg) . '") ;';
 	print '</script>';
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/connector.cgi
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/connector.cgi	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/connector.cgi	(revision 1825)
@@ -102,5 +102,5 @@
 
 	# Check for invalid folder paths (..)
-	if ( $sCurrentFolder =~ /\.\./ ) {
+	if ( $sCurrentFolder =~ /(?:\.\.|\\)/ ) {
 		SendError( 102, "" ) ;
 	}
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/upload.cgi
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/upload.cgi	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/perl/upload.cgi	(revision 1825)
@@ -105,5 +105,5 @@
 
 	# Check for invalid folder paths (..)
-	if ( $sCurrentFolder =~ /\.\./ ) {
+	if ( $sCurrentFolder =~ /(?:\.\.|\\)/ ) {
 		SendError( 102, "" ) ;
 	}
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/io.php
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/io.php	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/io.php	(revision 1825)
@@ -151,7 +151,7 @@
 function GetRootPath()
 {
-    if (!isset($_SERVER)) {
-        global $_SERVER;
-    }
+	if (!isset($_SERVER)) {
+		global $_SERVER;
+	}
 	$sRealPath = realpath( './' ) ;
 
@@ -224,12 +224,14 @@
 function GetCurrentFolder()
 {
-    if (!isset($_GET)) {
-        global $_GET;
-    }
+	if (!isset($_GET)) {
+		global $_GET;
+	}
 	$sCurrentFolder	= isset( $_GET['CurrentFolder'] ) ? $_GET['CurrentFolder'] : '/' ;
 
 	// Check the current folder syntax (must begin and start with a slash).
-	if ( ! ereg( '/$', $sCurrentFolder ) ) $sCurrentFolder .= '/' ;
-	if ( strpos( $sCurrentFolder, '/' ) !== 0 ) $sCurrentFolder = '/' . $sCurrentFolder ;
+	if ( !preg_match( '|/$|', $sCurrentFolder ) )
+		$sCurrentFolder .= '/' ;
+	if ( strpos( $sCurrentFolder, '/' ) !== 0 )
+		$sCurrentFolder = '/' . $sCurrentFolder ;
 
 	// Ensure the folder path has no double-slashes
@@ -239,5 +241,5 @@
 
 	// Check for invalid folder paths (..)
-	if ( strpos( $sCurrentFolder, '..' ) )
+	if ( strpos( $sCurrentFolder, '..' ) || strpos( $sCurrentFolder, "\\" ))
 		SendError( 102, '' ) ;
 
@@ -251,5 +253,5 @@
 
 	// Remove . \ / | : ? * " < >
-	$sNewFolderName = preg_replace( '/\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>/', '_', $sNewFolderName ) ;
+	$sNewFolderName = preg_replace( '/\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[[:cntrl:]]/', '_', $sNewFolderName ) ;
 
 	return $sNewFolderName ;
@@ -268,5 +270,5 @@
 
 	// Remove \ / | : ? * " < >
-	$sNewFileName = preg_replace( '/\\\\|\\/|\\||\\:|\\?|\\*|"|<|>/', '_', $sNewFileName ) ;
+	$sNewFileName = preg_replace( '/\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[[:cntrl:]]/', '_', $sNewFileName ) ;
 
 	return $sNewFileName ;
@@ -276,5 +278,38 @@
 function SendUploadResults( $errorNumber, $fileUrl = '', $fileName = '', $customMsg = '' )
 {
-	echo '<script type="text/javascript">' ;
+	echo <<<EOF
+<script type="text/javascript">
+(function()
+{
+	var d = document.domain ;
+
+	while ( true )
+	{
+		// Test if we can access a parent property.
+		try
+		{
+			var test = window.top.opener.document.domain ;
+			break ;
+		}
+		catch( e ) {}
+
+		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+		d = d.replace( /.*?(?:\.|$)/, '' ) ;
+
+		if ( d.length == 0 )
+			break ;		// It was not able to detect the domain.
+
+		try
+		{
+			document.domain = d ;
+		}
+		catch (e)
+		{
+			break ;
+		}
+	}
+})() ;
+
+EOF;
 	$rpl = array( '\\' => '\\\\', '"' => '\\"' ) ;
 	echo 'window.parent.OnUploadCompleted(' . $errorNumber . ',"' . strtr( $fileUrl, $rpl ) . '","' . strtr( $fileName, $rpl ) . '", "' . strtr( $customMsg, $rpl ) . '") ;' ;
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/util.php
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/util.php	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/php/util.php	(revision 1825)
@@ -35,4 +35,27 @@
 }
 
+function FindBadUtf8( $string )
+{
+	$regex =
+	'([\x00-\x7F]'.
+	'|[\xC2-\xDF][\x80-\xBF]'.
+	'|\xE0[\xA0-\xBF][\x80-\xBF]'.
+	'|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}'.
+	'|\xED[\x80-\x9F][\x80-\xBF]'.
+	'|\xF0[\x90-\xBF][\x80-\xBF]{2}'.
+	'|[\xF1-\xF3][\x80-\xBF]{3}'.
+	'|\xF4[\x80-\x8F][\x80-\xBF]{2}'.
+	'|(.{1}))';
+
+	while (preg_match('/'.$regex.'/S', $string, $matches)) {
+		if ( isset($matches[2])) {
+			return true;
+		}
+		$string = substr($string, strlen($matches[0]));
+	}
+
+	return false;
+}
+
 function ConvertToXmlAttribute( $value )
 {
@@ -46,5 +69,5 @@
 	}
 
-	if ( strtoupper( substr( $os, 0, 3 ) ) === 'WIN' )
+	if ( strtoupper( substr( $os, 0, 3 ) ) === 'WIN' || FindBadUtf8( $value ) )
 	{
 		return ( utf8_encode( htmlspecialchars( $value ) ) ) ;
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/fckoutput.py
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/fckoutput.py	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/fckoutput.py	(revision 1825)
@@ -103,4 +103,35 @@
 		"This is the function that sends the results of the uploading process"
 		return """<script type="text/javascript">
+			(function()
+			{
+				var d = document.domain ;
+
+				while ( true )
+				{
+					// Test if we can access a parent property.
+					try
+					{
+						var test = window.top.opener.document.domain ;
+						break ;
+					}
+					catch( e ) {}
+
+					// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+					d = d.replace( /.*?(?:\.|$)/, '' ) ;
+
+					if ( d.length == 0 )
+						break ;		// It was not able to detect the domain.
+
+					try
+					{
+						document.domain = d ;
+					}
+					catch (e)
+					{
+						break ;
+					}
+				}
+			})() ;
+
 			window.parent.OnUploadCompleted(%(errorNumber)s,"%(fileUrl)s","%(fileName)s","%(customMsg)s");
 			</script>""" % {
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/fckutil.py
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/fckutil.py	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/py/fckutil.py	(revision 1825)
@@ -62,6 +62,6 @@
 def sanitizeFolderName( newFolderName ):
 	"Do a cleanup of the folder name to avoid possible problems"
-	# Remove . \ / | : ? *
-	return re.sub( '\\.|\\\\|\\/|\\||\\:|\\?|\\*', '_', newFolderName )
+	# Remove . \ / | : ? * " < > and control characters
+	return re.sub( '(?u)\\.|\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[^\u0000-\u001f\u007f-\u009f]', '_', newFolderName )
 
 def sanitizeFileName( newFileName ):
@@ -73,5 +73,5 @@
 	newFileName = os.path.basename (newFileName)	# strip directories
 	# Remove \ / | : ? *
-	return re.sub ( '/\\\\|\\/|\\||\\:|\\?|\\*/', '_', newFileName )
+	return re.sub ( '(?u)/\\\\|\\/|\\||\\:|\\?|\\*|"|<|>|[^\u0000-\u001f\u007f-\u009f]/', '_', newFileName )
 
 def getCurrentFolder(currentFolder):
@@ -90,5 +90,5 @@
 
 	# Check for invalid folder paths (..)
-	if '..' in currentFolder:
+	if '..' in currentFolder or '\\' in currentFolder:
 		return None
 
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/test.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/test.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/test.html	(revision 1825)
@@ -25,5 +25,38 @@
 <head>
 	<title>FCKeditor - Connectors Tests</title>
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 	<script type="text/javascript">
+
+// Automatically detect the correct document.domain (#1919).
+(function()
+{
+	var d = document.domain ;
+
+	while ( true )
+	{
+		// Test if we can access a parent property.
+		try
+		{
+			var test = window.opener.document.domain ;
+			break ;
+		}
+		catch( e ) {}
+
+		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+		d = d.replace( /.*?(?:\.|$)/, '' ) ;
+
+		if ( d.length == 0 )
+			break ;		// It was not able to detect the domain.
+
+		try
+		{
+			document.domain = d ;
+		}
+		catch (e)
+		{
+			break ;
+		}
+	}
+})() ;
 
 function BuildBaseUrl( command )
Index: /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/uploadtest.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/uploadtest.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/filemanager/connectors/uploadtest.html	(revision 1825)
@@ -24,5 +24,38 @@
 	<head>
 		<title>FCKeditor - Uploaders Tests</title>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 		<script type="text/javascript">
+
+// Automatically detect the correct document.domain (#1919).
+(function()
+{
+	var d = document.domain ;
+
+	while ( true )
+	{
+		// Test if we can access a parent property.
+		try
+		{
+			var test = window.opener.document.domain ;
+			break ;
+		}
+		catch( e ) {}
+
+		// Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ...
+		d = d.replace( /.*?(?:\.|$)/, '' ) ;
+
+		if ( d.length == 0 )
+			break ;		// It was not able to detect the domain.
+
+		try
+		{
+			document.domain = d ;
+		}
+		catch (e)
+		{
+			break ;
+		}
+	}
+})() ;
 
 function SendFile()
@@ -42,7 +75,12 @@
 	txtUrl.value = '' ;
 
-	frmUpload.action = sUploaderUrl;
+	var date = new Date()
+
+	frmUpload.action = sUploaderUrl + '?time=' + date.getTime();
 	if (document.getElementById('cmbType').value) {
-		frmUpload.action = frmUpload.action + '?Type='+document.getElementById('cmbType').value;
+		frmUpload.action = frmUpload.action + '&Type='+document.getElementById('cmbType').value;
+	}
+	if (document.getElementById('CurrentFolder').value) {
+		frmUpload.action = frmUpload.action + '&CurrentFolder='+document.getElementById('CurrentFolder').value;
 	}
 	frmUpload.submit() ;
@@ -89,5 +127,5 @@
 						<tr>
 							<td nowrap>
-								Select the "File Uploader" to use:<br>
+								Select the "File Uploader" to use: <br>
 								<select id="cmbUploaderUrl">
 									<option selected value="asp/upload.asp">ASP</option>
@@ -112,4 +150,8 @@
 							</select>
 						</td>
+						<td>
+						Current Folder: <br>
+						<input type="text" name="CurrentFolder" id="CurrentFolder" value="/">
+						</td>
 							<td nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
 							<td width="100%">
@@ -126,4 +168,5 @@
 									Upload a new file:<br>
 									<input type="file" name="NewFile"><br>
+
 									<input type="button" value="Send it to the Server" onclick="SendFile();">
 								</form>
Index: /FCKeditor/branches/versions/2.6.x/editor/lang/_translationstatus.txt
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/lang/_translationstatus.txt	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/lang/_translationstatus.txt	(revision 1825)
@@ -1,3 +1,3 @@
-﻿/*
+/*
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
  * Copyright (C) 2003-2008 Frederico Caldeira Knabben
@@ -55,5 +55,5 @@
 lt.js      Found: 376   Missing: 35
 lv.js      Found: 381   Missing: 30
-mn.js      Found: 226   Missing: 185
+mn.js      Found: 411   Missing: 0
 ms.js      Found: 352   Missing: 59
 nb.js      Found: 395   Missing: 16
Index: /FCKeditor/branches/versions/2.6.x/editor/lang/ca.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/lang/ca.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/lang/ca.js	(revision 1825)
@@ -27,11 +27,11 @@
 Dir					: "ltr",
 
-ToolbarCollapse		: "Col·lapsa la barra",
-ToolbarExpand		: "Amplia la barra",
+ToolbarCollapse		: "Redueix la barra d'eines",
+ToolbarExpand		: "Amplia la barra d'eines",
 
 // Toolbar Items and Context Menu
 Save				: "Desa",
 NewPage				: "Nova Pàgina",
-Preview				: "Vista Prèvia",
+Preview				: "Visualització prèvia",
 Cut					: "Retalla",
 Copy				: "Copia",
@@ -59,5 +59,5 @@
 InsertSmileyLbl		: "Icona",
 InsertSmiley		: "Insereix icona",
-About				: "Quant a FCKeditor",
+About				: "Quant a l'FCKeditor",
 Bold				: "Negreta",
 Italic				: "Cursiva",
@@ -66,17 +66,17 @@
 Subscript			: "Subíndex",
 Superscript			: "Superíndex",
-LeftJustify			: "Aliniament esquerra",
-CenterJustify		: "Aliniament centrat",
-RightJustify		: "Aliniament dreta",
-BlockJustify		: "Justifica",
-DecreaseIndent		: "Sagna el text",
-IncreaseIndent		: "Treu el sagnat del text",
+LeftJustify			: "Alinia a l'esquerra",
+CenterJustify		: "Centrat",
+RightJustify		: "Alinia a la dreta",
+BlockJustify		: "Justificat",
+DecreaseIndent		: "Redueix el sagnat",
+IncreaseIndent		: "Augmenta el sagnat",
 Blockquote			: "Bloc de cita",
 Undo				: "Desfés",
 Redo				: "Refés",
 NumberedListLbl		: "Llista numerada",
-NumberedList		: "Aplica o elimina la llista numerada",
+NumberedList		: "Numeració activada/desactivada",
 BulletedListLbl		: "Llista de pics",
-BulletedList		: "Aplica o elimina la llista de pics",
+BulletedList		: "Pics activats/descativats",
 ShowTableBorders	: "Mostra les vores de les taules",
 ShowDetails			: "Mostra detalls",
@@ -144,5 +144,5 @@
 FormProp			: "Propietats del formulari",
 
-FontFormats			: "Normal;Formatejat;Adreça;Encapçalament 1;Encapçalament 2;Encapçalament 3;Encapçalament 4;Encapçalament 5;Encapçalament 6",
+FontFormats			: "Normal;Formatejat;Adreça;Encapçalament 1;Encapçalament 2;Encapçalament 3;Encapçalament 4;Encapçalament 5;Encapçalament 6;Normal (DIV)",
 
 // Alerts and Messages
@@ -375,5 +375,5 @@
 // Speller Pages Dialog
 DlgSpellNotInDic		: "No és al diccionari",
-DlgSpellChangeTo		: "Canvia a",
+DlgSpellChangeTo		: "Reemplaça amb",
 DlgSpellBtnIgnore		: "Ignora",
 DlgSpellBtnIgnoreAll	: "Ignora-les totes",
@@ -381,12 +381,12 @@
 DlgSpellBtnReplaceAll	: "Canvia-les totes",
 DlgSpellBtnUndo			: "Desfés",
-DlgSpellNoSuggestions	: "Cap sugerència",
-DlgSpellProgress		: "Comprovació ortogràfica en progrés",
-DlgSpellNoMispell		: "Comprovació ortogràfica completada",
-DlgSpellNoChanges		: "Comprovació ortogràfica: cap paraulada canviada",
-DlgSpellOneChange		: "Comprovació ortogràfica: una paraula canviada",
-DlgSpellManyChanges		: "Comprovació ortogràfica %1 paraules canviades",
-
-IeSpellDownload			: "Comprovació ortogràfica no instal·lada. Voleu descarregar-ho ara?",
+DlgSpellNoSuggestions	: "Cap suggeriment",
+DlgSpellProgress		: "Verificació ortogràfica en curs...",
+DlgSpellNoMispell		: "Verificació ortogràfica acabada: no hi ha cap paraula mal escrita",
+DlgSpellNoChanges		: "Verificació ortogràfica: no s'ha canviat cap paraula",
+DlgSpellOneChange		: "Verificació ortogràfica: s'ha canviat una paraula",
+DlgSpellManyChanges		: "Verificació ortogràfica: s'han canviat %1 paraules",
+
+IeSpellDownload			: "Verificació ortogràfica no instal·lada. Voleu descarregar-ho ara?",
 
 // Button Dialog
@@ -431,6 +431,6 @@
 DlgTextName			: "Nom",
 DlgTextValue		: "Valor",
-DlgTextCharWidth	: "Amplada de caràcter",
-DlgTextMaxChars		: "Màxim de caràcters",
+DlgTextCharWidth	: "Amplada",
+DlgTextMaxChars		: "Nombre màxim de caràcters",
 DlgTextType			: "Tipus",
 DlgTextTypeText		: "Text",
@@ -452,6 +452,6 @@
 DlgLstTypeLCase		: "Lletres minúscules (a, b, c)",
 DlgLstTypeUCase		: "Lletres majúscules (A, B, C)",
-DlgLstTypeSRoman	: "Números romans minúscules (i, ii, iii)",
-DlgLstTypeLRoman	: "Números romans majúscules (I, II, III)",
+DlgLstTypeSRoman	: "Números romans en minúscules (i, ii, iii)",
+DlgLstTypeLRoman	: "Números romans en majúscules (I, II, III)",
 
 // Document Properties Dialog
@@ -502,5 +502,5 @@
 Templates			: "Plantilles",
 DlgTemplatesTitle	: "Contingut plantilles",
-DlgTemplatesSelMsg	: "Si us plau, seleccioneu la plantilla per obrir en l'editor<br>(el contingut actual no serà enregistrat):",
+DlgTemplatesSelMsg	: "Si us plau, seleccioneu la plantilla per obrir a l'editor<br>(el contingut actual no serà enregistrat):",
 DlgTemplatesLoading	: "Carregant la llista de plantilles. Si us plau, espereu...",
 DlgTemplatesNoTpl	: "(No hi ha plantilles definides)",
Index: /FCKeditor/branches/versions/2.6.x/editor/lang/mn.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/lang/mn.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/lang/mn.js	(revision 1825)
@@ -45,10 +45,10 @@
 InsertLink			: "Линк Оруулах/Засварлах",
 RemoveLink			: "Линк авч хаях",
-Anchor				: "Insert/Edit Anchor",	//MISSING
-AnchorDelete		: "Remove Anchor",	//MISSING
+Anchor				: "Холбоос Оруулах/Засварлах",
+AnchorDelete		: "Холбоос Авах",
 InsertImageLbl		: "Зураг",
 InsertImage			: "Зураг Оруулах/Засварлах",
-InsertFlashLbl		: "Flash",	//MISSING
-InsertFlash			: "Insert/Edit Flash",	//MISSING
+InsertFlashLbl		: "Флаш",
+InsertFlash			: "Флаш Оруулах/Засварлах",
 InsertTableLbl		: "Хүснэгт",
 InsertTable			: "Хүснэгт Оруулах/Засварлах",
@@ -72,5 +72,5 @@
 DecreaseIndent		: "Догол мөр нэмэх",
 IncreaseIndent		: "Догол мөр хасах",
-Blockquote			: "Blockquote",	//MISSING
+Blockquote			: "Хайрцаглах",
 Undo				: "Хүчингүй болгох",
 Redo				: "Өмнөх үйлдлээ сэргээх",
@@ -90,57 +90,57 @@
 Find				: "Хайх",
 Replace				: "Солих",
-SpellCheck			: "Check Spelling",	//MISSING
-UniversalKeyboard	: "Universal Keyboard",	//MISSING
-PageBreakLbl		: "Page Break",	//MISSING
-PageBreak			: "Insert Page Break",	//MISSING
-
-Form			: "Form",	//MISSING
-Checkbox		: "Checkbox",	//MISSING
-RadioButton		: "Radio Button",	//MISSING
-TextField		: "Text Field",	//MISSING
-Textarea		: "Textarea",	//MISSING
-HiddenField		: "Hidden Field",	//MISSING
-Button			: "Button",	//MISSING
-SelectionField	: "Selection Field",	//MISSING
-ImageButton		: "Image Button",	//MISSING
-
-FitWindow		: "Maximize the editor size",	//MISSING
-ShowBlocks		: "Show Blocks",	//MISSING
+SpellCheck			: "Үгийн дүрэх шалгах",
+UniversalKeyboard	: "Униварсал гар",
+PageBreakLbl		: "Хуудас тусгаарлах",
+PageBreak			: "Хуудас тусгаарлагч оруулах",
+
+Form			: "Форм",
+Checkbox		: "Чекбокс",
+RadioButton		: "Радио товч",
+TextField		: "Техт талбар",
+Textarea		: "Техт орчин",
+HiddenField		: "Нууц талбар",
+Button			: "Товч",
+SelectionField	: "Сонгогч талбар",
+ImageButton		: "Зурагтай товч",
+
+FitWindow		: "editor-н хэмжээг томруулах",
+ShowBlocks		: "Block-уудыг үзүүлэх",
 
 // Context Menu
 EditLink			: "Холбоос засварлах",
-CellCM				: "Cell",	//MISSING
-RowCM				: "Row",	//MISSING
-ColumnCM			: "Column",	//MISSING
-InsertRowAfter		: "Insert Row After",	//MISSING
-InsertRowBefore		: "Insert Row Before",	//MISSING
+CellCM				: "Нүх/зай",
+RowCM				: "Мөр",
+ColumnCM			: "Багана",
+InsertRowAfter		: "Мөр дараа нь оруулах",
+InsertRowBefore		: "Мөр өмнө нь оруулах",
 DeleteRows			: "Мөр устгах",
-InsertColumnAfter	: "Insert Column After",	//MISSING
-InsertColumnBefore	: "Insert Column Before",	//MISSING
+InsertColumnAfter	: "Багана дараа нь оруулах",
+InsertColumnBefore	: "Багана өмнө нь оруулах",
 DeleteColumns		: "Багана устгах",
-InsertCellAfter		: "Insert Cell After",	//MISSING
-InsertCellBefore	: "Insert Cell Before",	//MISSING
+InsertCellAfter		: "Нүх/зай дараа нь оруулах",
+InsertCellBefore	: "Нүх/зай өмнө нь оруулах",
 DeleteCells			: "Нүх устгах",
 MergeCells			: "Нүх нэгтэх",
-MergeRight			: "Merge Right",	//MISSING
-MergeDown			: "Merge Down",	//MISSING
-HorizontalSplitCell	: "Split Cell Horizontally",	//MISSING
-VerticalSplitCell	: "Split Cell Vertically",	//MISSING
-TableDelete			: "Delete Table",	//MISSING
-CellProperties		: "Хоосон зайн шинж чанар",
+MergeRight			: "Баруун тийш нэгтгэх",
+MergeDown			: "Доош нэгтгэх",
+HorizontalSplitCell	: "Нүх/зайг босоогоор нь тусгаарлах",
+VerticalSplitCell	: "Нүх/зайг хөндлөнгөөр нь тусгаарлах",
+TableDelete			: "Хүснэгт устгах",
+CellProperties		: "Нүх/зай зайн шинж чанар",
 TableProperties		: "Хүснэгт",
 ImageProperties		: "Зураг",
-FlashProperties		: "Flash Properties",	//MISSING
-
-AnchorProp			: "Anchor Properties",	//MISSING
-ButtonProp			: "Button Properties",	//MISSING
-CheckboxProp		: "Checkbox Properties",	//MISSING
-HiddenFieldProp		: "Hidden Field Properties",	//MISSING
-RadioButtonProp		: "Radio Button Properties",	//MISSING
-ImageButtonProp		: "Image Button Properties",	//MISSING
-TextFieldProp		: "Text Field Properties",	//MISSING
-SelectionFieldProp	: "Selection Field Properties",	//MISSING
-TextareaProp		: "Textarea Properties",	//MISSING
-FormProp			: "Form Properties",	//MISSING
+FlashProperties		: "Флаш шинж чанар",
+
+AnchorProp			: "Холбоос шинж чанар",
+ButtonProp			: "Товчны шинж чанар",
+CheckboxProp		: "Чекбоксны шинж чанар",
+HiddenFieldProp		: "Нууц талбарын шинж чанар",
+RadioButtonProp		: "Радио товчны шинж чанар",
+ImageButtonProp		: "Зурган товчны шинж чанар",
+TextFieldProp		: "Текст талбарын шинж чанар",
+SelectionFieldProp	: "Согогч талбарын шинж чанар",
+TextareaProp		: "Текст орчны шинж чанар",
+FormProp			: "Форм шинж чанар",
 
 FontFormats			: "Хэвийн;Formatted;Хаяг;Heading 1;Heading 2;Heading 3;Heading 4;Heading 5;Heading 6;Paragraph (DIV)",
@@ -155,7 +155,7 @@
 NotImplemented		: "Зөвшөөрөгдөхгүй комманд",
 UnknownToolbarSet	: "Багажны хэсэгт \"%1\" оноох, үүсээгүй байна",
-NoActiveX			: "Your browser's security settings could limit some features of the editor. You must enable the option \"Run ActiveX controls and plug-ins\". You may experience errors and notice missing features.",	//MISSING
-BrowseServerBlocked : "The resources browser could not be opened. Make sure that all popup blockers are disabled.",	//MISSING
-DialogBlocked		: "It was not possible to open the dialog window. Make sure all popup blockers are disabled.",	//MISSING
+NoActiveX			: "Таны үзүүлэгч/browser-н хамгаалалтын тохиргоо editor-н зарим боломжийг хязгаарлаж байна. Та \"Run ActiveX controls ба plug-ins\" сонголыг идвэхитэй болго.",
+BrowseServerBlocked : "Нөөц үзүүгч нээж чадсангүй. Бүх popup blocker-г disabled болгоно уу.",
+DialogBlocked		: "Харилцах цонхонд энийг нээхэд боломжгүй ээ. Бүх popup blocker-г disabled болгоно уу.",
 
 // Dialogs
@@ -163,9 +163,9 @@
 DlgBtnCancel		: "Болих",
 DlgBtnClose			: "Хаах",
-DlgBtnBrowseServer	: "Browse Server",	//MISSING
+DlgBtnBrowseServer	: "Сервер харуулах",
 DlgAdvancedTag		: "Нэмэлт",
-DlgOpOther			: "<Other>",	//MISSING
-DlgInfoTab			: "Info",	//MISSING
-DlgAlertUrl			: "Please insert the URL",	//MISSING
+DlgOpOther			: "<Бусад>",
+DlgInfoTab			: "Мэдээлэл",
+DlgAlertUrl			: "URL оруулна уу",
 
 // General Dialogs Labels
@@ -195,5 +195,5 @@
 DlgImgWidth			: "Өргөн",
 DlgImgHeight		: "Өндөр",
-DlgImgLockRatio		: "Lock Ratio",
+DlgImgLockRatio		: "Радио түгжих",
 DlgBtnResetSize		: "хэмжээ дахин оноох",
 DlgImgBorder		: "Хүрээ",
@@ -212,15 +212,15 @@
 DlgImgPreview		: "Уридчлан харах",
 DlgImgAlertUrl		: "Зурагны URL-ын төрлийн сонгоно уу",
-DlgImgLinkTab		: "Link",	//MISSING
+DlgImgLinkTab		: "Линк",
 
 // Flash Dialog
-DlgFlashTitle		: "Flash Properties",	//MISSING
-DlgFlashChkPlay		: "Auto Play",	//MISSING
-DlgFlashChkLoop		: "Loop",	//MISSING
-DlgFlashChkMenu		: "Enable Flash Menu",	//MISSING
-DlgFlashScale		: "Scale",	//MISSING
-DlgFlashScaleAll	: "Show all",	//MISSING
-DlgFlashScaleNoBorder	: "No Border",	//MISSING
-DlgFlashScaleFit	: "Exact Fit",	//MISSING
+DlgFlashTitle		: "Флаш  шинж чанар",
+DlgFlashChkPlay		: "Автоматаар тоглох",
+DlgFlashChkLoop		: "Давтах",
+DlgFlashChkMenu		: "Флаш цэс идвэхжүүлэх",
+DlgFlashScale		: "Өргөгтгөх",
+DlgFlashScaleAll	: "Бүгдийг харуулах",
+DlgFlashScaleNoBorder	: "Хүрээгүй",
+DlgFlashScaleFit	: "Яг тааруулах",
 
 // Link Dialog
@@ -241,5 +241,5 @@
 DlgLnkNoAnchors		: "(Баримт бичиг холбоосгүй байна)",
 DlgLnkEMail			: "E-Mail Хаяг",
-DlgLnkEMailSubject	: "Message Subject",
+DlgLnkEMailSubject	: "Message гарчиг",
 DlgLnkEMailBody		: "Message-ийн агуулга",
 DlgLnkUpload		: "Хуулах",
@@ -253,5 +253,5 @@
 DlgLnkTargetSelf	: "Төстэй цонх (_self)",
 DlgLnkTargetTop		: "Хамгийн түрүүн байх цонх (_top)",
-DlgLnkTargetFrameName	: "Target Frame Name",	//MISSING
+DlgLnkTargetFrameName	: "Очих фремын нэр",
 DlgLnkPopWinName	: "Popup цонхны нэр",
 DlgLnkPopWinFeat	: "Popup цонхны онцлог",
@@ -272,5 +272,5 @@
 DlnLnkMsgNoEMail	: "Е-mail хаягаа төрөлжүүлнэ үү",
 DlnLnkMsgNoAnchor	: "Холбоосоо сонгоно уу",
-DlnLnkMsgInvPopName	: "The popup name must begin with an alphabetic character and must not contain spaces",	//MISSING
+DlnLnkMsgInvPopName	: "popup нэр нь үсгэн тэмдэгтээр эхэлсэн байх ба хоосон зай агуулаагүй байх ёстой.",
 
 // Color Dialog
@@ -300,8 +300,8 @@
 DlgTableWidthPc		: "хувь",
 DlgTableHeight		: "Өндөр",
-DlgTableCellSpace	: "Нүх хоорондын зай",
-DlgTableCellPad		: "Нүх доторлох",
+DlgTableCellSpace	: "Нүх хоорондын зай (spacing)",
+DlgTableCellPad		: "Нүх доторлох(padding)",
 DlgTableCaption		: "Тайлбар",
-DlgTableSummary		: "Summary",	//MISSING
+DlgTableSummary		: "Тайлбар",
 
 // Table Cell Dialog
@@ -326,6 +326,6 @@
 DlgCellVerAlignBottom	: "Доод тал",
 DlgCellVerAlignBaseline	: "Baseline",
-DlgCellRowSpan		: "Нийт мөр",
-DlgCellCollSpan		: "Нийт багана",
+DlgCellRowSpan		: "Нийт мөр (span)",
+DlgCellCollSpan		: "Нийт багана (span)",
 DlgCellBackColor	: "Фонны өнгө",
 DlgCellBorderColor	: "Хүрээний өнгө",
@@ -333,5 +333,5 @@
 
 // Find and Replace Dialog
-DlgFindAndReplaceTitle	: "Find and Replace",	//MISSING
+DlgFindAndReplaceTitle	: "Хай мөн Дарж бич",
 
 // Find Dialog
@@ -356,8 +356,8 @@
 PasteFromWord	: "Word-оос буулгах",
 
-DlgPasteMsg2	: "Please paste inside the following box using the keyboard (<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.",	//MISSING
-DlgPasteSec		: "Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.",	//MISSING
-DlgPasteIgnoreFont		: "Ignore Font Face definitions",	//MISSING
-DlgPasteRemoveStyles	: "Remove Styles definitions",	//MISSING
+DlgPasteMsg2	: "(<strong>Ctrl+V</strong>) товчийг ашиглан paste хийнэ үү. Мөн <strong>OK</strong> дар.",
+DlgPasteSec		: "Таны үзүүлэгч/browser/-н хамгаалалтын тохиргооноос болоод editor clipboard өгөгдөлрүү шууд хандах боломжгүй. Энэ цонход дахин paste хийхийг оролд.",
+DlgPasteIgnoreFont		: "Тодорхойлогдсон Font Face зөвшөөрнө",
+DlgPasteRemoveStyles	: "Тодорхойлогдсон загварыг авах",
 
 // Color Picker
@@ -366,149 +366,149 @@
 
 // Document Properties
-DocProps		: "Document Properties",	//MISSING
+DocProps		: "Баримт бичиг шинж чанар",
 
 // Anchor Dialog
-DlgAnchorTitle		: "Anchor Properties",	//MISSING
-DlgAnchorName		: "Anchor Name",	//MISSING
-DlgAnchorErrorName	: "Please type the anchor name",	//MISSING
+DlgAnchorTitle		: "Холбоос шинж чанар",
+DlgAnchorName		: "Холбоос нэр",
+DlgAnchorErrorName	: "Холбоос төрөл оруулна уу",
 
 // Speller Pages Dialog
-DlgSpellNotInDic		: "Not in dictionary",	//MISSING
-DlgSpellChangeTo		: "Change to",	//MISSING
-DlgSpellBtnIgnore		: "Ignore",	//MISSING
-DlgSpellBtnIgnoreAll	: "Ignore All",	//MISSING
-DlgSpellBtnReplace		: "Replace",	//MISSING
-DlgSpellBtnReplaceAll	: "Replace All",	//MISSING
-DlgSpellBtnUndo			: "Undo",	//MISSING
-DlgSpellNoSuggestions	: "- No suggestions -",	//MISSING
-DlgSpellProgress		: "Spell check in progress...",	//MISSING
-DlgSpellNoMispell		: "Spell check complete: No misspellings found",	//MISSING
-DlgSpellNoChanges		: "Spell check complete: No words changed",	//MISSING
-DlgSpellOneChange		: "Spell check complete: One word changed",	//MISSING
-DlgSpellManyChanges		: "Spell check complete: %1 words changed",	//MISSING
-
-IeSpellDownload			: "Spell checker not installed. Do you want to download it now?",	//MISSING
+DlgSpellNotInDic		: "Толь бичиггүй",
+DlgSpellChangeTo		: "Өөрчлөх",
+DlgSpellBtnIgnore		: "Зөвшөөрөх",
+DlgSpellBtnIgnoreAll	: "Бүгдийг зөвшөөрөх",
+DlgSpellBtnReplace		: "Дарж бичих",
+DlgSpellBtnReplaceAll	: "Бүгдийг Дарж бичих",
+DlgSpellBtnUndo			: "Буцаах",
+DlgSpellNoSuggestions	: "- Тайлбаргүй -",
+DlgSpellProgress		: "Дүрэм шалгаж байгаа үйл явц...",
+DlgSpellNoMispell		: "Дүрэм шалгаад дууссан: Алдаа олдсонгүй",
+DlgSpellNoChanges		: "Дүрэм шалгаад дууссан: үг өөрчлөгдөөгүй",
+DlgSpellOneChange		: "Дүрэм шалгаад дууссан: 1 үг өөрчлөгдсөн",
+DlgSpellManyChanges		: "Дүрэм шалгаад дууссан: %1 үг өөрчлөгдсөн",
+
+IeSpellDownload			: "Дүрэм шалгагч суугаагүй байна. Татаж авахыг хүсч байна уу?",
 
 // Button Dialog
-DlgButtonText		: "Text (Value)",	//MISSING
-DlgButtonType		: "Type",	//MISSING
-DlgButtonTypeBtn	: "Button",	//MISSING
-DlgButtonTypeSbm	: "Submit",	//MISSING
-DlgButtonTypeRst	: "Reset",	//MISSING
+DlgButtonText		: "Тэкст (Утга)",
+DlgButtonType		: "Төрөл",
+DlgButtonTypeBtn	: "Товч",
+DlgButtonTypeSbm	: "Submit",
+DlgButtonTypeRst	: "Болих",
 
 // Checkbox and Radio Button Dialogs
-DlgCheckboxName		: "Name",	//MISSING
-DlgCheckboxValue	: "Value",	//MISSING
-DlgCheckboxSelected	: "Selected",	//MISSING
+DlgCheckboxName		: "Нэр",
+DlgCheckboxValue	: "Утга",
+DlgCheckboxSelected	: "Сонгогдсон",
 
 // Form Dialog
-DlgFormName		: "Name",	//MISSING
-DlgFormAction	: "Action",	//MISSING
-DlgFormMethod	: "Method",	//MISSING
+DlgFormName		: "Нэр",
+DlgFormAction	: "Үйлдэл",
+DlgFormMethod	: "Арга",
 
 // Select Field Dialog
-DlgSelectName		: "Name",	//MISSING
-DlgSelectValue		: "Value",	//MISSING
-DlgSelectSize		: "Size",	//MISSING
-DlgSelectLines		: "lines",	//MISSING
-DlgSelectChkMulti	: "Allow multiple selections",	//MISSING
-DlgSelectOpAvail	: "Available Options",	//MISSING
-DlgSelectOpText		: "Text",	//MISSING
-DlgSelectOpValue	: "Value",	//MISSING
-DlgSelectBtnAdd		: "Add",	//MISSING
-DlgSelectBtnModify	: "Modify",	//MISSING
-DlgSelectBtnUp		: "Up",	//MISSING
-DlgSelectBtnDown	: "Down",	//MISSING
-DlgSelectBtnSetValue : "Set as selected value",	//MISSING
-DlgSelectBtnDelete	: "Delete",	//MISSING
+DlgSelectName		: "Нэр",
+DlgSelectValue		: "Утга",
+DlgSelectSize		: "Хэмжээ",
+DlgSelectLines		: "Мөр",
+DlgSelectChkMulti	: "Олон сонголт зөвшөөрөх",
+DlgSelectOpAvail	: "Идвэхтэй сонголт",
+DlgSelectOpText		: "Тэкст",
+DlgSelectOpValue	: "Утга",
+DlgSelectBtnAdd		: "Нэмэх",
+DlgSelectBtnModify	: "Өөрчлөх",
+DlgSelectBtnUp		: "Дээш",
+DlgSelectBtnDown	: "Доош",
+DlgSelectBtnSetValue : "Сонгогдсан утга оноох",
+DlgSelectBtnDelete	: "Устгах",
 
 // Textarea Dialog
-DlgTextareaName	: "Name",	//MISSING
-DlgTextareaCols	: "Columns",	//MISSING
-DlgTextareaRows	: "Rows",	//MISSING
+DlgTextareaName	: "Нэр",
+DlgTextareaCols	: "Багана",
+DlgTextareaRows	: "Мөр",
 
 // Text Field Dialog
-DlgTextName			: "Name",	//MISSING
-DlgTextValue		: "Value",	//MISSING
-DlgTextCharWidth	: "Character Width",	//MISSING
-DlgTextMaxChars		: "Maximum Characters",	//MISSING
-DlgTextType			: "Type",	//MISSING
-DlgTextTypeText		: "Text",	//MISSING
-DlgTextTypePass		: "Password",	//MISSING
+DlgTextName			: "Нэр",
+DlgTextValue		: "Утга",
+DlgTextCharWidth	: "Тэмдэгтын өргөн",
+DlgTextMaxChars		: "Хамгийн их тэмдэгт",
+DlgTextType			: "Төрөл",
+DlgTextTypeText		: "Текст",
+DlgTextTypePass		: "Нууц үг",
 
 // Hidden Field Dialog
-DlgHiddenName	: "Name",	//MISSING
-DlgHiddenValue	: "Value",	//MISSING
+DlgHiddenName	: "Нэр",
+DlgHiddenValue	: "Утга",
 
 // Bulleted List Dialog
-BulletedListProp	: "Bulleted List Properties",	//MISSING
-NumberedListProp	: "Numbered List Properties",	//MISSING
-DlgLstStart			: "Start",	//MISSING
-DlgLstType			: "Type",	//MISSING
-DlgLstTypeCircle	: "Circle",	//MISSING
-DlgLstTypeDisc		: "Disc",	//MISSING
-DlgLstTypeSquare	: "Square",	//MISSING
-DlgLstTypeNumbers	: "Numbers (1, 2, 3)",	//MISSING
-DlgLstTypeLCase		: "Lowercase Letters (a, b, c)",	//MISSING
-DlgLstTypeUCase		: "Uppercase Letters (A, B, C)",	//MISSING
-DlgLstTypeSRoman	: "Small Roman Numerals (i, ii, iii)",	//MISSING
-DlgLstTypeLRoman	: "Large Roman Numerals (I, II, III)",	//MISSING
+BulletedListProp	: "Bulleted жагсаалын шинж чанар",
+NumberedListProp	: "Дугаарласан жагсаалын шинж чанар",
+DlgLstStart			: "Эхлэх",
+DlgLstType			: "Төрөл",
+DlgLstTypeCircle	: "Тойрог",
+DlgLstTypeDisc		: "Тайлбар",
+DlgLstTypeSquare	: "Square",
+DlgLstTypeNumbers	: "Тоо (1, 2, 3)",
+DlgLstTypeLCase		: "Жижиг үсэг (a, b, c)",
+DlgLstTypeUCase		: "Том үсэг (A, B, C)",
+DlgLstTypeSRoman	: "Жижиг Ром тоо (i, ii, iii)",
+DlgLstTypeLRoman	: "Том Ром тоо (I, II, III)",
 
 // Document Properties Dialog
-DlgDocGeneralTab	: "General",	//MISSING
-DlgDocBackTab		: "Background",	//MISSING
-DlgDocColorsTab		: "Colors and Margins",	//MISSING
-DlgDocMetaTab		: "Meta Data",	//MISSING
-
-DlgDocPageTitle		: "Page Title",	//MISSING
-DlgDocLangDir		: "Language Direction",	//MISSING
-DlgDocLangDirLTR	: "Left to Right (LTR)",	//MISSING
-DlgDocLangDirRTL	: "Right to Left (RTL)",	//MISSING
-DlgDocLangCode		: "Language Code",	//MISSING
-DlgDocCharSet		: "Character Set Encoding",	//MISSING
-DlgDocCharSetCE		: "Central European",	//MISSING
-DlgDocCharSetCT		: "Chinese Traditional (Big5)",	//MISSING
-DlgDocCharSetCR		: "Cyrillic",	//MISSING
-DlgDocCharSetGR		: "Greek",	//MISSING
-DlgDocCharSetJP		: "Japanese",	//MISSING
-DlgDocCharSetKR		: "Korean",	//MISSING
-DlgDocCharSetTR		: "Turkish",	//MISSING
-DlgDocCharSetUN		: "Unicode (UTF-8)",	//MISSING
-DlgDocCharSetWE		: "Western European",	//MISSING
-DlgDocCharSetOther	: "Other Character Set Encoding",	//MISSING
-
-DlgDocDocType		: "Document Type Heading",	//MISSING
-DlgDocDocTypeOther	: "Other Document Type Heading",	//MISSING
-DlgDocIncXHTML		: "Include XHTML Declarations",	//MISSING
-DlgDocBgColor		: "Background Color",	//MISSING
-DlgDocBgImage		: "Background Image URL",	//MISSING
-DlgDocBgNoScroll	: "Nonscrolling Background",	//MISSING
-DlgDocCText			: "Text",	//MISSING
-DlgDocCLink			: "Link",	//MISSING
-DlgDocCVisited		: "Visited Link",	//MISSING
-DlgDocCActive		: "Active Link",	//MISSING
-DlgDocMargins		: "Page Margins",	//MISSING
-DlgDocMaTop			: "Top",	//MISSING
-DlgDocMaLeft		: "Left",	//MISSING
-DlgDocMaRight		: "Right",	//MISSING
-DlgDocMaBottom		: "Bottom",	//MISSING
-DlgDocMeIndex		: "Document Indexing Keywords (comma separated)",	//MISSING
-DlgDocMeDescr		: "Document Description",	//MISSING
-DlgDocMeAuthor		: "Author",	//MISSING
-DlgDocMeCopy		: "Copyright",	//MISSING
-DlgDocPreview		: "Preview",	//MISSING
+DlgDocGeneralTab	: "Ерөнхий",
+DlgDocBackTab		: "Фоно",
+DlgDocColorsTab		: "Захын зай ба Өнгө",
+DlgDocMetaTab		: "Meta өгөгдөл",
+
+DlgDocPageTitle		: "Хуудасны гарчиг",
+DlgDocLangDir		: "Хэлний чиглэл",
+DlgDocLangDirLTR	: "Зүүнээс баруунруу (LTR)",
+DlgDocLangDirRTL	: "Баруунаас зүүнрүү (RTL)",
+DlgDocLangCode		: "Хэлний код",
+DlgDocCharSet		: "Encoding тэмдэгт",
+DlgDocCharSetCE		: "Төв европ",
+DlgDocCharSetCT		: "Хятадын уламжлалт (Big5)",
+DlgDocCharSetCR		: "Крил",
+DlgDocCharSetGR		: "Гред",
+DlgDocCharSetJP		: "Япон",
+DlgDocCharSetKR		: "Солонгос",
+DlgDocCharSetTR		: "Tурк",
+DlgDocCharSetUN		: "Юникод (UTF-8)",
+DlgDocCharSetWE		: "Баруун европ",
+DlgDocCharSetOther	: "Encoding-д өөр тэмдэгт оноох",
+
+DlgDocDocType		: "Баримт бичгийн төрөл Heading",
+DlgDocDocTypeOther	: "Бусад баримт бичгийн төрөл Heading",
+DlgDocIncXHTML		: "XHTML агуулж зарлах",
+DlgDocBgColor		: "Фоно өнгө",
+DlgDocBgImage		: "Фоно зурагны URL",
+DlgDocBgNoScroll	: "Гүйдэггүй фоно",
+DlgDocCText			: "Текст",
+DlgDocCLink			: "Линк",
+DlgDocCVisited		: "Зочилсон линк",
+DlgDocCActive		: "Идвэхитэй линк",
+DlgDocMargins		: "Хуудасны захын зай",
+DlgDocMaTop			: "Дээд тал",
+DlgDocMaLeft		: "Зүүн тал",
+DlgDocMaRight		: "Баруун тал",
+DlgDocMaBottom		: "Доод тал",
+DlgDocMeIndex		: "Баримт бичгийн индекс түлхүүр үг (таслалаар тусгаарлагдана)",
+DlgDocMeDescr		: "Баримт бичгийн тайлбар",
+DlgDocMeAuthor		: "Зохиогч",
+DlgDocMeCopy		: "Зохиогчийн эрх",
+DlgDocPreview		: "Харах",
 
 // Templates Dialog
-Templates			: "Templates",	//MISSING
-DlgTemplatesTitle	: "Content Templates",	//MISSING
-DlgTemplatesSelMsg	: "Please select the template to open in the editor<br />(the actual contents will be lost):",	//MISSING
-DlgTemplatesLoading	: "Loading templates list. Please wait...",	//MISSING
-DlgTemplatesNoTpl	: "(No templates defined)",	//MISSING
-DlgTemplatesReplace	: "Replace actual contents",	//MISSING
+Templates			: "Загварууд",
+DlgTemplatesTitle	: "Загварын агуулга",
+DlgTemplatesSelMsg	: "Загварыг нээж editor-рүү сонгож оруулна уу<br />(Одоогийн агууллагыг устаж магадгүй):",
+DlgTemplatesLoading	: "Загваруудыг ачааллаж байна. Түр хүлээнэ үү...",
+DlgTemplatesNoTpl	: "(Загвар тодорхойлогдоогүй байна)",
+DlgTemplatesReplace	: "Одоогийн агууллагыг дарж бичих",
 
 // About Dialog
-DlgAboutAboutTab	: "About",	//MISSING
-DlgAboutBrowserInfoTab	: "Browser Info",	//MISSING
-DlgAboutLicenseTab	: "License",	//MISSING
+DlgAboutAboutTab	: "Тухай",
+DlgAboutBrowserInfoTab	: "Мэдээлэл үзүүлэгч",
+DlgAboutLicenseTab	: "Лиценз",
 DlgAboutVersion		: "Хувилбар",
 DlgAboutInfo		: "Мэдээллээр туслах"
Index: /FCKeditor/branches/versions/2.6.x/editor/plugins/placeholder/fck_placeholder.html
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/plugins/placeholder/fck_placeholder.html	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/plugins/placeholder/fck_placeholder.html	(revision 1825)
@@ -27,7 +27,9 @@
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 		<meta content="noindex, nofollow" name="robots">
+		<script src="../../dialog/common/fck_dialog_common.js" type="text/javascript"></script>
 		<script language="javascript">
 
-var oEditor = window.parent.InnerDialogLoaded() ;
+var dialog = window.parent ;
+var oEditor = dialog.InnerDialogLoaded() ;
 var FCKLang = oEditor.FCKLang ;
 var FCKPlaceholders = oEditor.FCKPlaceholders ;
@@ -41,8 +43,11 @@
 
 	// Show the "Ok" button.
-	window.parent.SetOkButton( true ) ;
+	dialog.SetOkButton( true ) ;
+
+	// Select text field on load.
+	SelectField( 'txtName' ) ;
 }
 
-var eSelected = oEditor.FCKSelection.GetSelectedElement() ;
+var eSelected = dialog.Selection.GetSelectedElement() ;
 
 function LoadSelected()
Index: /FCKeditor/branches/versions/2.6.x/editor/skins/default/fck_dialog.css
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/skins/default/fck_dialog.css	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/skins/default/fck_dialog.css	(revision 1825)
@@ -348,6 +348,6 @@
 {
 	right: auto;
-	left: 0px;
-	margin-left: 10px;
+	left: 10px;
+	margin-right: 0px;
 }
 
Index: /FCKeditor/branches/versions/2.6.x/editor/skins/default/fck_editor.css
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/skins/default/fck_editor.css	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/skins/default/fck_editor.css	(revision 1825)
@@ -410,5 +410,5 @@
 }
 
-.SC_FieldDisabled .SC_FieldButton, .SC_FieldDisabled .SC_FieldCaption
+.SC_FieldDisabled .SC_FieldButton, .SC_FieldDisabled .SC_FieldCaption, .SC_FieldDisabled .TB_ButtonType_Text
 {
     opacity: 0.30; /* Safari, Opera and Mozilla */
Index: /FCKeditor/branches/versions/2.6.x/editor/skins/office2003/fck_dialog.css
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/skins/office2003/fck_dialog.css	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/skins/office2003/fck_dialog.css	(revision 1825)
@@ -348,6 +348,6 @@
 {
 	right: auto;
-	left: 0px;
-	margin-left: 10px;
+	left: 10px;
+	margin-right: 0px;
 }
 
Index: /FCKeditor/branches/versions/2.6.x/editor/skins/office2003/fck_editor.css
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/skins/office2003/fck_editor.css	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/skins/office2003/fck_editor.css	(revision 1825)
@@ -422,5 +422,5 @@
 }
 
-.SC_FieldDisabled .SC_FieldButton, .SC_FieldDisabled .SC_FieldCaption
+.SC_FieldDisabled .SC_FieldButton, .SC_FieldDisabled .SC_FieldCaption, .SC_FieldDisabled .TB_ButtonType_Text
 {
     opacity: 0.30; /* Safari, Opera and Mozilla */
Index: /FCKeditor/branches/versions/2.6.x/editor/skins/silver/fck_dialog.css
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/skins/silver/fck_dialog.css	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/skins/silver/fck_dialog.css	(revision 1825)
@@ -348,6 +348,6 @@
 {
 	right: auto;
-	left: 0px;
-	margin-left: 10px;
+	left: 10px;
+	margin-right: 0px;
 }
 
Index: /FCKeditor/branches/versions/2.6.x/editor/skins/silver/fck_editor.css
===================================================================
--- /FCKeditor/branches/versions/2.6.x/editor/skins/silver/fck_editor.css	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/editor/skins/silver/fck_editor.css	(revision 1825)
@@ -419,5 +419,5 @@
 }
 
-.SC_FieldDisabled .SC_FieldButton, .SC_FieldDisabled .SC_FieldCaption
+.SC_FieldDisabled .SC_FieldButton, .SC_FieldDisabled .SC_FieldCaption, .SC_FieldDisabled .TB_ButtonType_Text
 {
     opacity: 0.30; /* Safari, Opera and Mozilla */
Index: /FCKeditor/branches/versions/2.6.x/fckconfig.js
===================================================================
--- /FCKeditor/branches/versions/2.6.x/fckconfig.js	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/fckconfig.js	(revision 1825)
@@ -126,4 +126,5 @@
 	[ CTRL + 70 /*F*/, true ],
 	[ CTRL + 83 /*S*/, true ],
+	[ CTRL + 84 /*T*/, true ],
 	[ CTRL + 88 /*X*/, true ],
 	[ CTRL + 86 /*V*/, 'Paste' ],
@@ -139,6 +140,5 @@
 	[ CTRL + 85 /*U*/, 'Underline' ],
 	[ CTRL + SHIFT + 83 /*S*/, 'Save' ],
-	[ CTRL + ALT + 13 /*ENTER*/, 'FitWindow' ],
-	[ CTRL + 9 /*TAB*/, 'Source' ]
+	[ CTRL + ALT + 13 /*ENTER*/, 'FitWindow' ]
 ] ;
 
@@ -205,6 +205,6 @@
 {
 	// Basic Inline Styles.
-	'Bold'			: { Element : 'b', Overrides : 'strong' },
-	'Italic'		: { Element : 'i', Overrides : 'em' },
+	'Bold'			: { Element : 'strong', Overrides : 'b' },
+	'Italic'		: { Element : 'em', Overrides : 'i' },
 	'Underline'		: { Element : 'u' },
 	'StrikeThrough'	: { Element : 'strike' },
Index: /FCKeditor/branches/versions/2.6.x/fckstyles.xml
===================================================================
--- /FCKeditor/branches/versions/2.6.x/fckstyles.xml	(revision 1824)
+++ /FCKeditor/branches/versions/2.6.x/fckstyles.xml	(revision 1825)
@@ -69,7 +69,4 @@
 	</Style>
 
-	<Style name="Strong Emphasis" element="strong" />
-	<Style name="Emphasis" element="em" />
-
 	<Style name="Big" element="big" />
 	<Style name="Small" element="small" />
