Index: fckdialog.js
===================================================================
--- fckdialog.js	(revision 1709)
+++ fckdialog.js	(working copy)
@@ -104,27 +104,38 @@
 			// be restored in the dialog code.
 			if ( FCKBrowserInfo.IsIE && !topDialog )
 			{
-				// Ensures the editor has the selection focus. (#1801)
-				currentInstance.Focus() ;
+			
+        if (currentInstance.EditMode == FCK_EDITMODE_WYSIWYG) {
+            // Ensures the editor has the selection focus. (#1801)
+            currentInstance.Focus() ;
+            var editorDocument = currentInstance.EditorDocument ;
+            var selection = editorDocument.selection ;
+            var range ;
 
-				var editorDocument = currentInstance.EditorDocument ;
-				var selection = editorDocument.selection ;
-				var range ;
+            if ( selection )
+            {
+                range = selection.createRange() ;
 
-				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 ;
+                }
+            }
+        } else {
+            currentInstance.EditingArea.Textarea.focus();
+            var editorDocument = currentInstance.EditingArea.Textarea ;
+            var selection = editorDocument.document.selection ;
+            var range ;
 
-					// 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 ;
-					}
-				}
-
+            if ( selection ) {
+                range = selection.createRange() ;
+            }
+        }
+			
 				this.SelectionData = range ;
 			}
 
