Index: /FCKeditor/branches/features/div_container/editor/_source/commandclasses/fck_othercommands.js
===================================================================
--- /FCKeditor/branches/features/div_container/editor/_source/commandclasses/fck_othercommands.js	(revision 2198)
+++ /FCKeditor/branches/features/div_container/editor/_source/commandclasses/fck_othercommands.js	(revision 2199)
@@ -538,8 +538,6 @@
 		FCKUndo.SaveUndoStep() ;
 
-		// Find out the node to delete.
-		var node = FCKSelection.GetParentElement() ;
-		var path = new FCKElementPath( node ) ;
-		node = path.BlockLimit ;
+		// Find out the nodes to delete.
+		var nodes = FCKDomTools.GetSelectedDivContainers() ;
 		
 		// Remember the current selection position.
@@ -549,5 +547,6 @@
 
 		// Delete the container DIV node.
-		FCKDomTools.RemoveNode( node, true ) ;
+		for ( var i = 0 ; i < nodes.length ; i++)
+			FCKDomTools.RemoveNode( nodes[i], true ) ;
 
 		// Restore selection.
Index: /FCKeditor/branches/features/div_container/editor/_source/internals/fck_contextmenu.js
===================================================================
--- /FCKeditor/branches/features/div_container/editor/_source/internals/fck_contextmenu.js	(revision 2198)
+++ /FCKeditor/branches/features/div_container/editor/_source/internals/fck_contextmenu.js	(revision 2199)
@@ -298,38 +298,5 @@
 			AddItems : function( menu, tag, tagName )
 			{
-				var currentBlocks = [] ;
-				var range = new FCKDomRange( FCK.EditorWindow ) ;
-				range.MoveToSelection() ;
-
-				var startNode = range.StartNode ;
-				var endNode = range.EndNode ;
-				var elementMarkers = {} ;
-
-				var startPath = new FCKElementPath( startNode ) ;
-				if ( startPath.BlockLimit && startPath.BlockLimit.nodeName.IEquals( 'div' ) )
-					startNode = startPath.BlockLimit ;
-				var currentNode = startNode ;
-
-				do
-				{
-					if ( currentNode.nodeName.IEquals( 'div' ) && currentNode.firstChild &&
-							FCKListsLib.BlockElements[ currentNode.firstChild.nodeName.toLowerCase() ] )
-					{
-						currentBlocks.push( currentNode ) ;
-						if ( currentNode.parentNode.nodeName.IEquals( 'div' ) )
-							FCKDomTools.SetElementMarker( elementMarkers, currentNode.parentNode,
-									'_fckignorethisnode', true ) ;
-					}
-				}
-				while ( ( currentNode = FCKDomTools.GetNextSourceElement( currentNode ) ) && currentNode != endNode
-						&& currentNode != endNode.parentNode ) ;
-
-				for ( var i = currentBlocks.length - 1 ; i >= 0 ; i-- )
-				{
-					if ( currentBlocks[i]['_fckignorethisnode'] )
-						currentBlocks.splice( i, 1 ) ;
-				}
-
-				FCKDomTools.ClearAllMarkers( elementMarkers ) ;
+				var currentBlocks = FCKDomTools.GetSelectedDivContainers() ;
 
 				if ( currentBlocks.length > 0 )
Index: /FCKeditor/branches/features/div_container/editor/_source/internals/fckdomtools.js
===================================================================
--- /FCKeditor/branches/features/div_container/editor/_source/internals/fckdomtools.js	(revision 2198)
+++ /FCKeditor/branches/features/div_container/editor/_source/internals/fckdomtools.js	(revision 2199)
@@ -1022,4 +1022,44 @@
 		// In the DTD # == text node.
 		return ( childDTD['#'] && !FCKListsLib.NonEditableElements[ nodeName ] ) ;
+	},
+
+	GetSelectedDivContainers : function()
+	{
+		var currentBlocks = [] ;
+		var range = new FCKDomRange( FCK.EditorWindow ) ;
+		range.MoveToSelection() ;
+
+		var startNode = range.StartNode ;
+		var endNode = range.EndNode ;
+		var elementMarkers = {} ;
+
+		var startPath = new FCKElementPath( startNode ) ;
+		if ( startPath.BlockLimit && startPath.BlockLimit.nodeName.IEquals( 'div' ) )
+			startNode = startPath.BlockLimit ;
+		var currentNode = startNode ;
+
+		do
+		{
+			if ( currentNode.nodeName.IEquals( 'div' ) && currentNode.firstChild &&
+					FCKListsLib.BlockElements[ currentNode.firstChild.nodeName.toLowerCase() ] )
+			{
+				currentBlocks.push( currentNode ) ;
+				if ( currentNode.parentNode.nodeName.IEquals( 'div' ) )
+					FCKDomTools.SetElementMarker( elementMarkers, currentNode.parentNode,
+							'_fckignorethisnode', true ) ;
+			}
+		}
+		while ( ( currentNode = FCKDomTools.GetNextSourceElement( currentNode ) ) && currentNode != endNode
+				&& currentNode != endNode.parentNode ) ;
+
+		for ( var i = currentBlocks.length - 1 ; i >= 0 ; i-- )
+		{
+			if ( currentBlocks[i]['_fckignorethisnode'] )
+				currentBlocks.splice( i, 1 ) ;
+		}
+
+		FCKDomTools.ClearAllMarkers( elementMarkers ) ;
+
+		return currentBlocks ;
 	}
 } ;
Index: /FCKeditor/branches/features/div_container/editor/dialog/fck_div.html
===================================================================
--- /FCKeditor/branches/features/div_container/editor/dialog/fck_div.html	(revision 2198)
+++ /FCKeditor/branches/features/div_container/editor/dialog/fck_div.html	(revision 2199)
@@ -64,37 +64,5 @@
 {
 	dialog.Selection.EnsureSelection() ;
-	var range = new FCKDomRange( FCK.EditorWindow ) ;
-	range.MoveToSelection() ;
-
-	var startNode = range.StartNode ;
-	var endNode = range.EndNode ;
-	var elementMarkers = {} ;
-
-	var startPath = new FCKElementPath( startNode ) ;
-	if ( startPath.BlockLimit && startPath.BlockLimit.nodeName.IEquals( 'div' ) )
-		startNode = startPath.BlockLimit ;
-	var currentNode = startNode ;
-
-	do
-	{
-		if ( currentNode.nodeName.IEquals( 'div' ) && currentNode.firstChild &&
-				FCKListsLib.BlockElements[ currentNode.firstChild.nodeName.toLowerCase() ] )
-		{
-			CurrentContainers.push( currentNode ) ;
-			if ( currentNode.parentNode.nodeName.IEquals( 'div' ) )
-				FCKDomTools.SetElementMarker( elementMarkers, currentNode.parentNode,
-						'_fckignorethisnode', true ) ;
-		}
-	}
-	while ( ( currentNode = FCKDomTools.GetNextSourceElement( currentNode ) ) && currentNode != endNode
-			&& currentNode != endNode.parentNode ) ;
-
-	for ( var i = CurrentContainers.length - 1 ; i >= 0 ; i-- )
-	{
-		if ( CurrentContainers[i]['_fckignorethisnode'] )
-			CurrentContainers.splice( i, 1 ) ;
-	}
-
-	FCKDomTools.ClearAllMarkers( elementMarkers ) ;
+	CurrentContainers = FCKDomTools.GetSelectedDivContainers() ;
 }
 
