Index: /FCKeditor/branches/features/floating_dialog/editor/_source/classes/fckdomrange_ie.js
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/_source/classes/fckdomrange_ie.js	(revision 1070)
+++ /FCKeditor/branches/features/floating_dialog/editor/_source/classes/fckdomrange_ie.js	(revision 1071)
@@ -34,4 +34,5 @@
 	if ( oSel.type != 'Control' )
 	{
+		var htmlText = this.Window.document.selection.createRange().htmlText ;
 		var eMarkerStart	= this._GetSelectionMarkerTag( true ) ;
 		var eMarkerEnd		= this._GetSelectionMarkerTag( false ) ;
@@ -53,4 +54,8 @@
 
 		this._UpdateElementInfo() ;
+
+		// Kludge for IE bug #1491.
+		if ( htmlText.match( /^\s*<(LI)><\/\1>$/ ) )
+			this.Collapse( true ) ;
 	}
 	else
Index: /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js	(revision 1070)
+++ /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js	(revision 1071)
@@ -73,8 +73,10 @@
 	var ownerWindow = FCK.ToolbarSet.CurrentInstance.Window.parent ;
 	var ownerDocument = ownerWindow.document ;
-	var innerWidth = FCKBrowserInfo.IsIE ? ownerDocument.documentElement.offsetWidth : ownerWindow.innerWidth;
-	var innerHeight = FCKBrowserInfo.IsIE ? ownerDocument.documentElement.offsetHeight : ownerWindow.innerHeight;
-	var iTop  = (innerHeight - dialogHeight) / 2 ;
-	var iLeft = (innerWidth - dialogWidth)  / 2	;
+	var scrollTop = ownerDocument.body.scrollTop ;
+	var scrollLeft = ownerDocument.body.scrollLeft ;
+	var innerWidth = FCKBrowserInfo.IsIE ? ownerDocument.documentElement.offsetWidth : ownerWindow.innerWidth ;
+	var innerHeight = FCKBrowserInfo.IsIE ? ownerDocument.documentElement.offsetHeight : ownerWindow.innerHeight ;
+	var iTop  = Math.max( scrollTop + ( innerHeight - dialogHeight - 20 ) / 2, 0 ) ;
+	var iLeft = Math.max( scrollLeft + ( innerWidth - dialogWidth - 20 )  / 2, 0 ) ;
 	if ( ! ownerWindow.FCKDialogArguments )
 		ownerWindow.FCKDialogArguments = {} ;
@@ -129,4 +131,6 @@
 	if ( this.DialogStack.length == 0 )
 		FCK.ToolbarSet.CurrentInstance.SetDialogMode( true ) ;
+	else
+		this.SetEnabled( this.DialogStack[ this.DialogStack.length - 1 ], false );
 	this.DialogStack.push( container ) ;
 }
@@ -154,10 +158,7 @@
 FCKDialog.RemoveShadow = function( container )
 {
-	for( var i = 0 ; i < container.childNodes.length ; i++ )
-	{
-		var candidate = container.childNodes[i] ;
-		if ( candidate.nodeName.IEquals( 'div' ) )
-			candidate.parentNode.removeChild( candidate ) ;
-	}
+	var shadow = container.ownerDocument.getElementById( container.shadowId ) ;
+	if ( shadow )
+		shadow.parentNode.removeChild( shadow ) ;
 }
 
@@ -166,4 +167,6 @@
 	var doc = container.ownerDocument ;
 	var shadowBlock = doc.createElement( 'div' ) ;
+	shadowBlock.id = parseInt( Math.random() * 0x10000000 ) ;
+	container.shadowId = shadowBlock.id ;
 	FCKDomTools.SetElementStyles( shadowBlock,
 		{
@@ -233,4 +236,55 @@
 	if ( this.DialogStack.length == 0)
 		FCK.ToolbarSet.CurrentInstance.SetDialogMode( false ) ;
-
-}
+	else
+		this.SetEnabled( this.DialogStack[ this.DialogStack.length - 1 ], true ) ;
+
+}
+
+FCKDialog.SetEnabled = function( container, yes )
+{
+	var doc = container.ownerDocument ;
+	if ( !yes )
+	{
+		if ( doc.getElementById( container.coverBlockId ) )
+			return ;
+		var coverBlock = doc.createElement( FCKBrowserInfo.IsIE ? 'div' : 'img' ) ;
+		coverBlock.id = parseInt( Math.random() * 0x10000000, 10 ) ;
+		container.coverBlockId = coverBlock.id ;
+		FCKDomTools.SetElementStyles( coverBlock,
+			{
+				'width' : ( container.offsetWidth - 20 ) + 'px',
+				'height' : ( container.offsetHeight - 20 ) + 'px',
+				'left' : '6px',
+				'top' : '6px',
+				'position' : 'absolute',
+				'zIndex' : 1000
+			} ) ;
+		if ( FCKBrowserInfo.IsIE )
+			FCKDomTools.LoadPNG( coverBlock, FCKConfig.SkinPath + 'images/WindowCover.png' ) ;
+		container.appendChild( coverBlock ) ;
+		if ( FCKBrowserInfo.IsIE )
+		{
+			var spacer = doc.createElement( 'img' ) ;
+			spacer.src = FCKConfig.BasePath + 'images/spacer.gif' ;
+			FCKDomTools.SetElementStyles( spacer,
+				{
+					'width' : coverBlock.offsetWidth + 'px',
+					'height' : coverBlock.offsetHeight + 'px',
+					'position' : 'absolute',
+					'left' : '0px',
+					'top' : '0px'
+				} ) ;
+			coverBlock.appendChild( spacer ) ;
+		}
+		else
+			FCKDomTools.SetOpacity( container, 0.5 ) ;
+	}
+	else
+	{
+		var coverBlock = doc.getElementById( container.coverBlockId ) ;
+		if ( coverBlock )
+			coverBlock.parentNode.removeChild( coverBlock ) ;
+		if ( !FCKBrowserInfo.IsIE )
+			FCKDomTools.SetOpacity( container, 1.0 ) ;
+	}
+}
Index: /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_smiley.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_smiley.html	(revision 1070)
+++ /FCKeditor/branches/features/floating_dialog/editor/dialog/fck_smiley.html	(revision 1071)
@@ -46,5 +46,8 @@
 function InsertSmiley( url )
 {
+	if ( parent.dialogArguments.SelectionData )
+		parent.dialogArguments.SelectionData.select() ;
 	oEditor.FCKUndo.SaveUndoStep() ;
+
 	var oImg = oEditor.FCK.InsertElement( 'img' ) ;
 	oImg.src = url ;
Index: /FCKeditor/branches/features/floating_dialog/editor/fckdialog.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/fckdialog.html	(revision 1070)
+++ /FCKeditor/branches/features/floating_dialog/editor/fckdialog.html	(revision 1071)
@@ -139,9 +139,20 @@
 function Ok()
 {
+	if ( dialogArguments.SelectionData )
+		dialogArguments.SelectionData.select() ;
 	if ( window.frames["frmMain"].Ok && window.frames["frmMain"].Ok() )
-		Cancel() ;
+		CloseDialog() ;
+	else
+		window.frames["frmMain"].focus() ;
 }
 
 function Cancel( dontFireChange )
+{
+	if ( dialogArguments.SelectionData )
+		dialogArguments.SelectionData.select() ;
+	return CloseDialog( dontFireChange ) ;
+}
+
+function CloseDialog( dontFireChange )
 {
 	if ( !dontFireChange && !oEditor.FCK.EditMode )
