Index: /FCKeditor/trunk/editor/_source/commandclasses/fckfitwindow.js
===================================================================
--- /FCKeditor/trunk/editor/_source/commandclasses/fckfitwindow.js	(revision 486)
+++ /FCKeditor/trunk/editor/_source/commandclasses/fckfitwindow.js	(revision 487)
@@ -103,4 +103,11 @@
 		eMainWindow.scrollTo(0, 0);
 
+		// Is the editor still not on the top left? Let's find out and fix that as well. (Bug #174)
+		var editorPos = FCKTools.GetWindowPosition( eMainWindow, eEditorFrame ) ;
+		if ( editorPos.x != 0 )
+			eEditorFrameStyle.left = ( -1 * editorPos.x ) + "px" ;
+		if ( editorPos.y != 0 )
+			eEditorFrameStyle.top = ( -1 * editorPos.y ) + "px" ;
+
 		this.IsMaximized = true ;
 	}
Index: /FCKeditor/trunk/editor/_source/internals/fcktools.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fcktools.js	(revision 486)
+++ /FCKeditor/trunk/editor/_source/internals/fcktools.js	(revision 487)
@@ -446,2 +446,25 @@
 	return output.join( "" ) ;
 }
+
+FCKTools.GetDocumentPosition = function( w, node )
+{
+	var x = 0 ;
+	var y = 0 ;
+	var curNode = node ;
+	while ( curNode && curNode != w.document.body )
+	{
+		x += curNode.offsetLeft - curNode.scrollLeft ;
+		y += curNode.offsetTop - curNode.scrollTop ;
+		curNode = curNode.offsetParent ;
+	}
+	return { "x" : x, "y" : y } ;
+}
+
+FCKTools.GetWindowPosition = function( w, node )
+{
+	var pos = this.GetDocumentPosition( w, node ) ;
+	var scroll = FCKTools.GetScrollPosition( w ) ;
+	pos.x -= scroll.X ;
+	pos.y -= scroll.Y ;
+	return pos ;
+}
Index: /FCKeditor/trunk/editor/plugins/dragresizetable/fckplugin.js
===================================================================
--- /FCKeditor/trunk/editor/plugins/dragresizetable/fckplugin.js	(revision 486)
+++ /FCKeditor/trunk/editor/plugins/dragresizetable/fckplugin.js	(revision 487)
@@ -10,49 +10,7 @@
 	"_MaximumX" : null,
 	"_LastX" : null,
-	"_GetWindowScrollX" : function( w )
-	{
-		var scrollX = 0 ;
-		if ( w.document.documentElement && w.document.documentElement.scrollLeft ) 
-			scrollX = w.document.documentElement.scrollLeft ;
-		else if ( w.document.body && w.document.body.scrollLeft )
-			scrollX = w.document.body.scrollLeft ;
-		else if ( w.scrollX )
-			scrollX = w.scrollX ;
-		return scrollX ;
-	},
-	"_GetWindowScrollY" : function( w )
-	{
-		var scrollY = 0 ;
-		if ( w.document.documentElement && w.document.documentElement.scrollTop )
-			scrollY = w.document.documentElement.scrollTop ;
-		else if ( w.document.body && w.document.body.scrollTop )
-			scrollY = w.document.body.scrollTop ;
-		else if ( w.scrollY )
-			scrollY = w.scrollY ;
-		return scrollY ;
-	},
-	"_GetDocumentPosition" : function( w, node )
-	{
-		var x = 0 ;
-		var y = 0 ;
-		var curNode = node ;
-		while ( curNode && curNode != w.document.body )
-		{
-			x += curNode.offsetLeft - curNode.scrollLeft ;
-			y += curNode.offsetTop - curNode.scrollTop ;
-			curNode = curNode.offsetParent ;
-		}
-		return { "x" : x, "y" : y } ;
-	},
-	"_GetWindowPosition" : function( w, node )
-	{
-		var pos = this._GetDocumentPosition( w, node ) ;
-		pos.x -= this._GetWindowScrollX( w ) ;
-		pos.y -= this._GetWindowScrollY( w ) ;
-		return pos ;
-	},
 	"_IsInsideNode" : function( w, domNode, pos )
 	{
-		var myCoords = this._GetWindowPosition( w, domNode ) ; 
+		var myCoords = FCKTools.GetWindowPosition( w, domNode ) ; 
 		var xMin = myCoords.x ;
 		var yMin = myCoords.y ;
@@ -85,5 +43,5 @@
 		for ( var i = 0 ; i < cells.length ; i++ )
 		{
-			var pos = this._GetWindowPosition( w, cells[i] ) ;
+			var pos = FCKTools.GetWindowPosition( w, cells[i] ) ;
 			var rightX = pos.x + parseInt( cells[i].clientWidth ) ;
 			var rxDist = mouse.x - rightX ;
@@ -105,5 +63,5 @@
 
 		// Abort if too far from the border.
-		lxDist = mouse.x - this._GetWindowPosition( w, lbCell ).x ;
+		lxDist = mouse.x - FCKTools.GetWindowPosition( w, lbCell ).x ;
 		if ( lxDist < 0 && minRxDist < 0 && minRxDist < -2 )
 			return null ; 
@@ -140,5 +98,5 @@
 		// Calculate maximum and minimum x-coordinate delta.
 		var borderIndex = FCKDragTableHandler._GetResizeBarPosition() ;
-		var offset = FCKDragTableHandler._GetDocumentPosition( window, FCK.EditingArea.IFrame ) ;
+		var offset = FCKTools.GetDocumentPosition( window, FCK.EditingArea.IFrame ) ;
 		var table = FCKTools.GetElementAscensor( FCKDragTableHandler._LeftCell, "table" );
 		var minX = null ;
@@ -151,5 +109,5 @@
 			{
 				var cell = row.cells.item( c ) ;
-				var cellPosition = FCKDragTableHandler._GetWindowPosition( FCK.EditorWindow, cell ) ;
+				var cellPosition = FCKTools.GetWindowPosition( FCK.EditorWindow, cell ) ;
 				var cellPadding = FCKDragTableHandler._GetCellPadding( table, cell ) ;
 				var cellMinX = cellPosition.x + cellPadding ;
@@ -365,5 +323,5 @@
 		if ( node.ownerDocument == document )
 		{
-			var offset = this._GetDocumentPosition( window, FCK.EditingArea.IFrame ) ;
+			var offset = FCKTools.GetDocumentPosition( window, FCK.EditingArea.IFrame ) ;
 			mouseX -= offset.x ;
 			mouseY -= offset.y ;
@@ -373,6 +331,6 @@
 		if ( this._ResizeBar && this._LeftCell )
 		{
-			var leftPos = this._GetWindowPosition( FCK.EditorWindow, this._LeftCell ) ;
-			var rightPos = this._GetWindowPosition( FCK.EditorWindow, this._RightCell ) ; 
+			var leftPos = FCKTools.GetWindowPosition( FCK.EditorWindow, this._LeftCell ) ;
+			var rightPos = FCKTools.GetWindowPosition( FCK.EditorWindow, this._RightCell ) ; 
 			var rxDist = mouseX - ( leftPos.x + this._LeftCell.clientWidth ) ;
 			var lxDist = mouseX - rightPos.x ;
@@ -427,5 +385,5 @@
 		if ( node.ownerDocument == FCK.EditorDocument )
 		{
-			var offset = this._GetDocumentPosition( window, FCK.EditingArea.IFrame ) ;
+			var offset = FCKTools.GetDocumentPosition( window, FCK.EditingArea.IFrame ) ;
 			mouse.x += offset.x ;
 			mouse.y += offset.y ;
@@ -438,5 +396,5 @@
 			mouse.x = this._MinimumX + 5 ;
 
-		var docX = mouse.x + this._GetWindowScrollX( window ) ;
+		var docX = mouse.x + FCKTools.GetScrollPosition( window ).X ;
 		this._ResizeBar.style.left = ( docX - this._ResizeBar.offsetWidth / 2 ) + "px" ;
 		this._LastX = mouse.x ;
@@ -487,6 +445,6 @@
 		else
 			paddingBar.style.opacity = 0.1 ;
-		var offset = this._GetDocumentPosition( window, FCK.EditingArea.IFrame ) ;
-		var tablePos = this._GetWindowPosition( w, table ) ;
+		var offset = FCKTools.GetDocumentPosition( window, FCK.EditingArea.IFrame ) ;
+		var tablePos = FCKTools.GetWindowPosition( w, table ) ;
 		var barHeight = table.offsetHeight ;
 		var barTop = offset.y + tablePos.y ;
@@ -507,5 +465,5 @@
 		var barWidth = Math.max( bw+100, cs+100 ) ;
 		paddingBar.style.width = barWidth + "px" ;
-		paddingBar.style.left = ( offset.x + mouse.x + this._GetWindowScrollX( w ) - barWidth / 2 ) +  "px" ;
+		paddingBar.style.left = ( offset.x + mouse.x + FCKTools.GetScrollPosition( w ).X - barWidth / 2 ) +  "px" ;
 		var filler = paddingBar.getElementsByTagName( "img" )[0] ;
 		filler.style.width = paddingBar.offsetWidth + "px" ;
