Index: /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fck.js
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fck.js	(revision 1056)
+++ /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fck.js	(revision 1057)
@@ -784,10 +784,14 @@
 		{
 			var parentDivPosition = FCKTools.GetDocumentPosition( this.Window.parent, editorParentElement ) ;
+			var positionedAncestor = FCKDomTools.GetPositionedAncestor( this.Window.parent, editorParentElement.parentNode ) ;
+			var positionedAncestorPosition = positionedAncestor ? 
+				FCKTools.GetDocumentPosition( this.Window.parent, positionedAncestor ) : 
+				{'x' : 0, 'y' : 0} ;
 			FCKDomTools.SetElementStyles( this.EditorBlocker,
 				{
 					'width' : editorFrame.offsetWidth + 'px',
 					'height' : editorFrame.offsetHeight + 'px',
-					'left' : parentDivPosition.x + 'px',
-					'top' : parentDivPosition.y + 'px',
+					'left' : ( parentDivPosition.x - positionedAncestorPosition.x ) + 'px',
+					'top' : ( parentDivPosition.y - positionedAncestorPosition.y ) + 'px',
 					'display' : ''
 				} ) ;
@@ -796,6 +800,6 @@
 					'width' : Math.max( doc.documentElement.scrollWidth, doc.documentElement.clientWidth ) + 'px',
 					'height' : Math.max( doc.documentElement.scrollHeight, doc.documentElement.clientHeight ) + 'px',
-					'left' : '0px',
-					'top' : '0px',
+					'left' : ( -1 * positionedAncestorPosition.x ) + 'px',
+					'top' : ( -1 * positionedAncestorPosition.y ) + 'px',
 					'display' : ''
 				} ) ;
Index: /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js	(revision 1056)
+++ /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js	(revision 1057)
@@ -25,5 +25,6 @@
 {
 	BaseZIndex : 10000,
-	LastSelectionData : null
+	LastSelectionData : null,
+	DialogStack : []
 } ;
 
@@ -84,4 +85,5 @@
 	// 1. The dialog iframe
 	// 2. The dialog shadow
+	// 3. The dialog blocker (visible only when the dialog is disabled)
 	var container = ownerDocument.createElement( 'div' ) ;
 	container.dialogId = dialogId ;
@@ -124,5 +126,10 @@
 	oWindow.focus() ;
 	this.Window = oWindow ;
-	FCK.SetDialogMode( true ) ;
+
+	// Keep record of the current dialog in the dialog stack, and enable dialog mode
+	// if this is the first dialog in the dialog stack.
+	if ( this.DialogStack.length == 0 )
+		FCK.SetDialogMode( true ) ;
+	this.DialogStack.push( container ) ;
 }
 
@@ -186,4 +193,6 @@
 		'dialog.shadow.bottom.right.png'
 	];
+	var x = [ 0, 20, container.offsetWidth - 20 ] ;
+	var y = [ 0, 20, container.offsetHeight - 20 ] ;
 	for ( var i = 0 ; i < 9 ; i++ )
 	{
@@ -201,6 +210,4 @@
 			d.style.height = ( container.offsetHeight - 40 ) + 'px' ;
 		FCKDomTools.LoadPNG( d, FCKConfig.SkinPath + 'images/' + partUrl[i] ) ;
-		var x = [ 0, 20, container.offsetWidth - 20 ] ;
-		var y = [ 0, 20, container.offsetHeight - 20 ] ;
 		FCKDomTools.SetElementStyles( d,
 			{
@@ -223,4 +230,8 @@
 	container.parentNode.removeChild( container ) ;
 	this.BaseZIndex -= 100 ;
-	FCK.SetDialogMode( false ) ;
-}
+
+	// Pop the dialog from the dialog stack, and disable dialog mode if the stack is empty.
+	this.DialogStack.pop() ;
+	if ( this.DialogStack.length == 0)
+		FCK.SetDialogMode( false ) ;
+}
Index: /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdomtools.js
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdomtools.js	(revision 1056)
+++ /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdomtools.js	(revision 1057)
@@ -914,4 +914,24 @@
 		else
 			element.style.opacity = opacity ;
+	},
+
+	GetCurrentElementStyle : function( w, element, attrName )
+	{
+		if ( FCKBrowserInfo.IsIE )
+			return element.currentStyle[attrName] ;
+		else
+			return w.getComputedStyle( element, '' )[attrName] ;
+	},
+
+	GetPositionedAncestor : function( w, element )
+	{
+		var currentElement = element ;
+		while ( currentElement != currentElement.ownerDocument.documentElement )
+		{
+			if ( this.GetCurrentElementStyle( w, currentElement, 'position' ) != 'static' )
+				return currentElement ;
+			currentElement = currentElement.parentNode ;
+		}
+		return null ;
 	}
 } ;
