Index: /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fck.js
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fck.js	(revision 1097)
+++ /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fck.js	(revision 1098)
@@ -748,4 +748,20 @@
 			this.BackgroundBlocker.src = FCKConfig.SkinPath + 'fck_background_blocker.html' ;
 			this.EditorBlocker.src = FCKConfig.SkinPath + 'fck_editor_blocker.html' ;
+			this.BackgroundBlocker.onload = this.BackgroundBlocker.onreadystatechange = function( evt )
+			{
+				if ( !evt )
+					evt = this.ownerDocument.parentWindow.event ;
+				if ( evt.type == 'readystatechange' && this.readyState != 'complete' )
+					return ;
+				FCK.Events.FireEvent( 'OnBackgroundBlockerLoaded', this.contentWindow ) ;
+			}
+			this.EditorBlocker.onload = this.EditorBlocker.onreadystatechange = function( evt )
+			{
+				if ( !evt )
+					evt = this.ownerDocument.parentWindow.event ;
+				if ( evt.type == 'readystatechange' && this.readyState != 'complete' )
+					return ;
+				FCK.Events.FireEvent( 'OnEditorBlockerLoaded', this.contentWindow ) ;
+			}
 
 			this.BackgroundBlocker.frameBorder = 0 ;
@@ -789,4 +805,6 @@
 					+ doc.body.scrollHeight ) ;
 			*/
+			FCKDebug.Output( 'frame.x: ' + editorFrameCoords.x + ', frame.y:' + editorFrameCoords.y
+				      + ', ancestor.x: ' + positionedAncestorCoords.x + ', ancestor.y: ' + positionedAncestorCoords.y ) ;
 			FCKDomTools.SetElementStyles( this.BackgroundBlocker,
 				{
Index: /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js	(revision 1097)
+++ /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js	(revision 1098)
@@ -134,4 +134,13 @@
 		this.SetEnabled( this.DialogStack[ this.DialogStack.length - 1 ], false );
 	this.DialogStack.push( container ) ;
+
+	// Register drag handlers.
+	this.InitDragHandlers( ownerWindow ) ;
+	if ( ! this._RegisteredBlockerHandlers )
+	{
+		FCK.Events.AttachEvent( 'OnBackgroundBlockerLoaded', function( FCK, w ) { FCKDialog.RegisterDragHandlers( w ) ; } ) ;
+		FCK.Events.AttachEvent( 'OnEditorBlockerLoaded', function( FCK, w ) { FCKDialog.RegisterDragHandlers( w ) ; } ) ;
+		this._RegisteredBlockerHandlers = true ;
+	}
 }
 
@@ -300,7 +309,21 @@
 function _FCKDialog_Drag_Handlers()
 {
-	var _dragMode = false ;
 	var _dragDialog = null ;
 	var _ownerWindow = null ;
+	var _lastCoords = null ;
+
+	FCKDialog._GetMouseCoordinates = function( evt )
+	{
+		var element = evt.srcElement || evt.target ;
+		var view = element.ownerDocument.parentWindow || evt.view ;
+		var retval = { 'x': evt.clientX, 'y': evt.clientY };
+		if ( view != _ownerWindow )
+		{
+			var offset = FCKTools.GetDocumentPosition( _ownerWindow, element.ownerDocument.documentElement ) ;
+			retval.x += offset.x ;
+			retval.y += offset.y ;
+		}
+		return retval ;
+	}
 
 	FCKDialog._DragMouseDownHandler = function( evt )
@@ -316,23 +339,54 @@
 
 		_dragDialog = view.dialogArguments.Dialog ;
-		_dragMode = true ;
+		_lastCoords = FCKDialog._GetMouseCoordinates( evt ) ;
 	}
 
 	FCKDialog._DragMouseMoveHandler = function( evt )
 	{
+		if ( !_dragDialog )
+			return ;
 		if ( !evt )
 			evt = this.ownerDocument.parentWindow.event ;
+
+		var currentCoords = FCKDialog._GetMouseCoordinates( evt );
+		var dx = currentCoords.x - _lastCoords.x;
+		var dy = currentCoords.y - _lastCoords.y;
+		_lastCoords = currentCoords;
+
+		var x = parseInt( FCKDomTools.GetCurrentElementStyle( _ownerWindow, _dragDialog, 'left' ) ) + dx ;
+		var y = parseInt( FCKDomTools.GetCurrentElementStyle( _ownerWindow, _dragDialog, 'top' ) ) + dy ;
+		FCKDomTools.SetElementStyles( _dragDialog, 
+			{
+				'left' : x + 'px',
+				'top' : y + 'px'
+			} ) ;
 	}
 
 	FCKDialog._DragMouseUpHandler = function( evt )
 	{
+		if ( !_dragDialog )
+			return ;
 		if ( !evt )
 			evt = this.ownerDocument.parentWindow.event ;
-	}
-
-	FCKDialog.InitFCKDialogHandlers = function( w )
-	{
+		_dragDialog = null ;
+		_lastCoords = null ;
+	}
+
+	FCKDialog.RegisterDragHandlers = function( w )
+	{
+		if ( w._FCKDialogHandlersRegistered )
+			return ;
+
+		FCKTools.AddEventListener( w.document.documentElement, 'mousemove', this._DragMouseMoveHandler ) ;
+		FCKTools.AddEventListener( w.document.documentElement, 'mouseup', this._DragMouseUpHandler ) ;
+		w._FCKDialogHandlersRegistered = true ;
+	}
+
+	FCKDialog.InitDragHandlers = function( w )
+	{
+		if ( _ownerWindow )
+			return ;
 		_ownerWindow = w ;
-		w.FCKDialogHandlersRegistered = true ;
+		this.RegisterDragHandlers( w ) ;
 	}
 }
Index: /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fcktools.js
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fcktools.js	(revision 1097)
+++ /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fcktools.js	(revision 1098)
@@ -460,10 +460,14 @@
 
 	// document.body is a special case when it comes to offsetTop and offsetLeft values.
-	// We can't just blindly sum it up in the while loop above.
-	if ( FCKDomTools.GetCurrentElementStyle( w, w.document.body, 'position') != 'static' )
+	// 1. It matters if document.body itself is a positioned element;
+	// 2. It matters is when we're in IE and the element has no positioned ancestor.
+	// Otherwise the values should be ignored.
+	if ( FCKDomTools.GetCurrentElementStyle( w, w.document.body, 'position') != 'static' 
+			|| ( FCKBrowserInfo.IsIE && FCKDomTools.GetPositionedAncestor( w, node ) == null ) )
 	{
 		x += w.document.body.offsetLeft ;
 		y += w.document.body.offsetTop ;
 	}
+
 	return { "x" : x, "y" : y } ;
 }
