Index: /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js	(revision 1053)
+++ /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js	(revision 1054)
@@ -24,5 +24,6 @@
 var FCKDialog = 
 {
-	BaseZIndex : 10000
+	BaseZIndex : 10000,
+	LastSelectionData : null
 } ;
 
@@ -36,4 +37,30 @@
 	oDialogInfo.Editor = window ;
 	oDialogInfo.CustomValue = customValue ;		// Optional
+	oDialogInfo.SelectionData = null ;
+
+	if ( FCKBrowserInfo.IsIE )
+	{
+		var oSel = FCK.EditorDocument.selection ;
+		var bInvalidRange = false ;
+
+		if ( !oSel )
+			bInvalidRange = true ;
+
+		var oRange = oSel.createRange() ;
+		if ( !oRange )
+			bInvalidRange = true ;
+		if ( oRange.parentElement && oRange.parentElement().ownerDocument != FCK.EditorDocument )
+			bInvalidRange = true ;
+		if ( oRange.item && oRange.item(0).ownerDocument != FCK.EditorDocument )
+			bInvalidRange = true ;
+
+		if ( bInvalidRange )
+			oDialogInfo.SelectionData = this.LastSelectionData ;
+		else
+		{
+			oDialogInfo.SelectionData = oRange ;
+			this.LastSelectionData = oRange ;
+		}
+	}
 
 	var sUrl = FCKConfig.BasePath + 'fckdialog.html' ;
Index: /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_button.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_button.html	(revision 1053)
+++ /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_button.html	(revision 1054)
@@ -35,4 +35,6 @@
 var oDOM = oEditor.FCK.EditorDocument ;
 
+if ( window.parent.dialogArguments.SelectionData )
+	window.parent.dialogArguments.SelectionData.select() ;
 var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
 
Index: /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_checkbox.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_checkbox.html	(revision 1053)
+++ /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_checkbox.html	(revision 1054)
@@ -35,4 +35,6 @@
 var oDOM = oEditor.FCK.EditorDocument ;
 
+if ( window.parent.dialogArguments.SelectionData )
+	window.parent.dialogArguments.SelectionData.select() ;
 var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
 
Index: /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_form.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_form.html	(revision 1053)
+++ /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_form.html	(revision 1054)
@@ -35,4 +35,6 @@
 var oDOM = oEditor.FCK.EditorDocument ;
 
+if ( window.parent.dialogArguments.SelectionData )
+	window.parent.dialogArguments.SelectionData.select() ;
 var oActiveEl = oEditor.FCKSelection.MoveToAncestorNode( 'FORM' ) ;
 
Index: /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_image/fck_image.js
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_image/fck_image.js	(revision 1053)
+++ /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_image/fck_image.js	(revision 1054)
@@ -247,4 +247,6 @@
 		else			// Creating a new link.
 		{
+			if ( window.parent.dialogArguments.SelectionData )
+				window.parent.dialogArguments.SelectionData.select() ;
 			if ( !bHasImage )
 				oEditor.FCKSelection.SelectNode( oImage ) ;
Index: /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_link/fck_link.js
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_link/fck_link.js	(revision 1053)
+++ /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_link/fck_link.js	(revision 1054)
@@ -621,4 +621,6 @@
 
 	// Select the (first) link.
+	if ( window.parent.dialogArguments.SelectionData )
+		window.parent.dialogArguments.SelectionData.select() ;
 	oEditor.FCKSelection.SelectNode( aLinks[0] );
 
Index: /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_listprop.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_listprop.html	(revision 1053)
+++ /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_listprop.html	(revision 1054)
@@ -36,4 +36,6 @@
 var sListType = ( location.search == '?OL' ? 'OL' : 'UL' ) ;
 
+if ( window.parent.dialogArguments.SelectionData )
+	window.parent.dialogArguments.SelectionData.select() ;
 var oActiveEl = oEditor.FCKSelection.MoveToAncestorNode( sListType ) ;
 var oActiveSel ;
Index: /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_paste.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_paste.html	(revision 1053)
+++ /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_paste.html	(revision 1054)
@@ -120,4 +120,6 @@
 		var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
 		var oDoc = oEditor.FCK.EditorDocument ;
+		if ( window.parent.dialogArguments.SelectionData )
+			window.parent.dialogArguments.SelectionData.select() ;
 		range.MoveToSelection() ;
 		range.DeleteContents() ;
Index: /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_radiobutton.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_radiobutton.html	(revision 1053)
+++ /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_radiobutton.html	(revision 1054)
@@ -35,4 +35,6 @@
 var oDOM = oEditor.FCK.EditorDocument ;
 
+if ( window.parent.dialogArguments.SelectionData )
+	window.parent.dialogArguments.SelectionData.select() ;
 var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
 
Index: /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_replace.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_replace.html	(revision 1053)
+++ /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_replace.html	(revision 1054)
@@ -78,4 +78,7 @@
 {
 	var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
+
+	if ( window.parent.dialogArguments.SelectionData )
+		window.parent.dialogArguments.SelectionData.select() ;
 	range.MoveToSelection() ;
 	return range.CreateBookmark2() ;
@@ -332,4 +335,6 @@
 {
 	var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
+	if ( window.parent.dialogArguments.SelectionData )
+		window.parent.dialogArguments.SelectionData.select() ;
 	range.MoveToSelection() ;
 	range.Collapse( false ) ;
@@ -343,4 +348,6 @@
 {
 	var selection = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
+	if ( window.parent.dialogArguments.SelectionData )
+		window.parent.dialogArguments.SelectionData.select() ;
 	selection.MoveToSelection() ;
 
@@ -369,4 +376,6 @@
 	while ( _Find() )
 	{
+		if ( window.parent.dialogArguments.SelectionData )
+			window.parent.dialogArguments.SelectionData.select() ;
 		range.MoveToSelection() ;
 		range.DeleteContents() ;
Index: /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_select.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_select.html	(revision 1053)
+++ /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_select.html	(revision 1054)
@@ -36,4 +36,6 @@
 var oDOM = oEditor.FCK.EditorDocument ;
 
+if ( window.parent.dialogArguments.SelectionData )
+	window.parent.dialogArguments.SelectionData.select() ;
 var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
 
Index: /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_table.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_table.html	(revision 1053)
+++ /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_table.html	(revision 1054)
@@ -31,4 +31,5 @@
 
 var oEditor = window.parent.InnerDialogLoaded() ;
+var dialogArguments = window.parent.dialogArguments ;
 
 // Gets the document DOM
@@ -37,4 +38,6 @@
 // Gets the table if there is one selected.
 var table ;
+if ( dialogArguments.SelectionData )
+	dialogArguments.SelectionData.select() ;
 var e = oEditor.FCKSelection.GetSelectedElement() ;
 
Index: /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_tablecell.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_tablecell.html	(revision 1053)
+++ /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_tablecell.html	(revision 1054)
@@ -36,4 +36,6 @@
 
 // Array of selected Cells
+if ( window.parent.dialogArguments.SelectionData )
+	window.parent.dialogArguments.SelectionData.select() ;
 var aCells = oEditor.FCKTableHandler.GetSelectedCells() ;
 
Index: /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_textarea.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_textarea.html	(revision 1053)
+++ /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_textarea.html	(revision 1054)
@@ -35,4 +35,6 @@
 var oDOM = oEditor.FCK.EditorDocument ;
 
+if ( window.parent.dialogArguments.SelectionData )
+	window.parent.dialogArguments.SelectionData.select() ;
 var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
 
Index: /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_textfield.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_textfield.html	(revision 1053)
+++ /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_textfield.html	(revision 1054)
@@ -35,4 +35,6 @@
 var oDOM = oEditor.FCK.EditorDocument ;
 
+if ( window.parent.dialogArguments.SelectionData )
+	window.parent.dialogArguments.SelectionData.select() ;
 var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
 
