Index: /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fcktools.js
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fcktools.js	(revision 1093)
+++ /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fcktools.js	(revision 1094)
@@ -424,12 +424,46 @@
 	var y = 0 ;
 	var curNode = node ;
-	while ( curNode && curNode != w.document.body )
+	var prevNode = null ;
+	var curWindow = FCKTools.GetElementWindow( curNode ) ;
+	while ( curNode && !( curWindow == w && curNode == w.document.body ) )
 	{
 		x += curNode.offsetLeft - curNode.scrollLeft ;
 		y += curNode.offsetTop - curNode.scrollTop ;
-		curNode = curNode.offsetParent ;
-	}
-	x += w.document.body.offsetLeft ;
-	y += w.document.body.offsetTop ;
+
+		if ( ! FCKBrowserInfo.IsOpera )
+		{
+			var scrollNode = prevNode ;
+			while ( scrollNode && scrollNode != curNode )
+			{
+				x -= scrollNode.scrollLeft ;
+				y -= scrollNode.scrollTop ;
+				scrollNode = scrollNode.parentNode ;
+			}
+		}
+
+		prevNode = curNode ;
+		if ( curNode.offsetParent )
+			curNode = curNode.offsetParent ;
+		else
+		{
+			if ( curWindow != w )
+			{
+				curNode = curWindow.frameElement ;
+				prevNode = null ;
+				if ( curNode )
+					curWindow = FCKTools.GetElementWindow( curNode ) ;
+			}
+			else
+				curNode = null ;
+		}
+	}
+
+	// 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' )
+	{
+		x += w.document.body.offsetLeft ;
+		y += w.document.body.offsetTop ;
+	}
 	return { "x" : x, "y" : y } ;
 }
