Index: /FCKeditor/branches/developers/martinkou/editor/plugins/dragresizetable/fckplugin.js
===================================================================
--- /FCKeditor/branches/developers/martinkou/editor/plugins/dragresizetable/fckplugin.js	(revision 454)
+++ /FCKeditor/branches/developers/martinkou/editor/plugins/dragresizetable/fckplugin.js	(revision 455)
@@ -7,10 +7,32 @@
 	"_MouseMoveMode" : 0,	// 0 - find candidate cells for resizing, 1 - drag to resize
 	"_ResizeBar" : null,
-	"GetWindowPosition" : function( w, node )
+	"_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 )
+		while ( curNode && curNode != w.document.body )
 		{
 			x += curNode.offsetLeft - curNode.scrollLeft ;
@@ -18,15 +40,16 @@
 			curNode = curNode.offsetParent ;
 		}
-		if ( w.scrollX && w.document.documentElement.scrollLeft == 0 
-				&& w.document.body.scrollLeft == 0 )
-			x -= w.scrollX ;
-		if ( w.scrollY && w.document.documentElement.scrollTop == 0 
-				&& w.document.body.scrollTop == 0 )
-			y -= w.scrollY ;
 		return { "x" : x, "y" : y } ;
 	},
-	"IsInsideNode" : function( w, domNode, pos )
-	{
-		var myCoords = FCKDragTableHandler.GetWindowPosition( w, domNode ) ; 
+	"_GetWindowPosition" : function( w, node )
+	{
+		var pos = FCKDragTableHandler._GetDocumentPosition( w, node ) ;
+		pos.x -= FCKDragTableHandler._GetWindowScrollX( w ) ;
+		pos.y -= FCKDragTableHandler._GetWindowScrollY( w ) ;
+		return pos ;
+	},
+	"_IsInsideNode" : function( w, domNode, pos )
+	{
+		var myCoords = FCKDragTableHandler._GetWindowPosition( w, domNode ) ; 
 		var xMin = myCoords.x ;
 		var yMin = myCoords.y ;
@@ -37,5 +60,5 @@
 		return false;
 	},
-	"GetBorderCells" : function( w, tableNode, evt )
+	"_GetBorderCells" : function( w, tableNode, evt )
 	{
 		// Enumerate all the cells in the table.
@@ -59,5 +82,5 @@
 		for ( var i = 0 ; i < cells.length ; i++ )
 		{
-			var pos = FCKDragTableHandler.GetWindowPosition( w, cells[i] ) ;
+			var pos = FCKDragTableHandler._GetWindowPosition( w, cells[i] ) ;
 			var rightX = pos.x + parseInt( cells[i].offsetWidth ) ;
 			var rxDist = evt.clientX - rightX ;
@@ -90,5 +113,10 @@
 	{
 		if ( FCKDragTableHandler._LeftCell )
+		{
 			FCKDragTableHandler._MouseMoveMode = 1 ;
+			FCKDragTableHandler._CreateResizeBar( FCK.EditorWindow, 
+					FCKTools.GetElementAscensor( FCKDragTableHandler._LeftCell, "table" ),
+					evt ) ;
+		}
 	},
 	"MouseUpListener" : function( FCK, evt )
@@ -181,5 +209,5 @@
 		}
 		node = FCKTools.GetElementAscensor( node, "table" ) ;
-		var cellTuple = FCKDragTableHandler.GetBorderCells( FCK.EditorWindow, node, evt ) ;
+		var cellTuple = FCKDragTableHandler._GetBorderCells( FCK.EditorWindow, node, evt ) ;
 
 		if ( cellTuple == null )
@@ -203,4 +231,26 @@
 	"_CreateResizeBar" : function( w, table, evt )
 	{
+		if ( FCKDragTableHandler._ResizeBar == null )
+		{
+			FCKDragTableHandler._ResizeBar = w.document.createElement( "div" ) ;
+			var rb = FCKDragTableHandler._ResizeBar ;
+			rb.style.position = "absolute" ;
+			rb.style.backgroundColor = "blue" ;
+			w.document.body.appendChild( rb ) ;
+		}
+
+		var rb = FCKDragTableHandler._ResizeBar ;
+		rb.style.display = "" ;
+		rb.style.top = FCKDragTableHandler._GetDocumentPosition( w, table ).y + "px" ;
+		rb.style.left = evt.clientX + FCKDragTableHandler._GetWindowScrollX( w ) + "px" ;
+		rb.style.height = table.offsetHeight + "px" ;
+		var bw = parseInt( table.border ) ;
+		if ( bw != bw )
+			bw = 0 ;
+		var cs = parseInt( table.cellSpacing ) ;
+		if ( cs != cs )
+			cs = 0 ;
+		var barWidth = Math.max( bw, cs, 2 ) ;
+		rb.style.width = barWidth + "px" ;
 	}
 };
