Index: /CKEditor/trunk/_source/core/tools.js
===================================================================
--- /CKEditor/trunk/_source/core/tools.js	(revision 5475)
+++ /CKEditor/trunk/_source/core/tools.js	(revision 5476)
@@ -692,4 +692,16 @@
 			}
 			return returnValue;
+		},
+
+		/**
+		 * Generate a combined key from a series of params.
+		 * @param {String} subKey One or more string used as sub keys.
+		 * @example
+		 * var key = CKEDITOR.tools.genKey( 'key1', 'key2', 'key3' );
+		 * alert( key );		// "key1-key2-key3".
+		 */
+		genKey : function()
+		{
+			return Array.prototype.slice.call( arguments ).join( '-' );
 		}
 	};
Index: /CKEditor/trunk/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/dialog/plugin.js	(revision 5475)
+++ /CKEditor/trunk/_source/plugins/dialog/plugin.js	(revision 5476)
@@ -546,4 +546,5 @@
 		destroy : function()
 		{
+			this.hide();
 			this._.element.remove();
 		},
@@ -699,5 +700,5 @@
 				CKEDITOR.dialog._.currentTop = this;
 				this._.parentDialog = null;
-				addCover( this._.editor );
+				showCover( this._.editor );
 
 				element.on( 'keydown', accessKeyDownHandler );
@@ -803,4 +804,7 @@
 		hide : function()
 		{
+			if ( !this.parts.dialog.isVisible() )
+				return;
+
 			this.fire( 'hide', {} );
 			this._.editor.fire( 'dialogHide', this );
@@ -811,7 +815,11 @@
 			unregisterAccessKey( this );
 
+			// Close any child(top) dialogs first.
+			while( CKEDITOR.dialog._.currentTop != this )
+				CKEDITOR.dialog._.currentTop.hide();
+
 			// Maintain dialog ordering and remove cover if needed.
 			if ( !this._.parentDialog )
-				removeCover();
+				hideCover();
 			else
 			{
@@ -846,5 +854,5 @@
 				CKEDITOR.dialog._.currentZIndex -= 10;
 
-
+			delete this._.parentDialog;
 			// Reset the initial values of the dialog.
 			this.foreach( function( contentObj ) { contentObj.resetInitValue && contentObj.resetInitValue(); } );
@@ -1750,22 +1758,30 @@
 
 	var resizeCover;
-	var coverElement;
-
-	var addCover = function( editor )
+	// Caching resuable covers and allowing only one cover
+	// on screen.
+	var covers = {},
+		currentCover;
+
+	function showCover( editor )
 	{
 		var win = CKEDITOR.document.getWindow();
+		var backgroundColorStyle = editor.config.dialog_backgroundCoverColor || 'white',
+			backgroundCoverOpacity = editor.config.dialog_backgroundCoverOpacity,
+			baseFloatZIndex = editor.config.baseFloatZIndex,
+			coverKey = CKEDITOR.tools.genKey(
+					backgroundColorStyle,
+					backgroundCoverOpacity,
+					baseFloatZIndex ),
+			coverElement = covers[ coverKey ];
 
 		if ( !coverElement )
 		{
-			var backgroundColorStyle = editor.config.dialog_backgroundCoverColor || 'white';
-
 			var html = [
 					'<div style="position: ', ( CKEDITOR.env.ie6Compat ? 'absolute' : 'fixed' ),
-					'; z-index: ', editor.config.baseFloatZIndex,
+					'; z-index: ', baseFloatZIndex,
 					'; top: 0px; left: 0px; ',
 					( !CKEDITOR.env.ie6Compat ? 'background-color: ' + backgroundColorStyle : '' ),
-					'" id="cke_dialog_background_cover">'
+					'" class="cke_dialog_background_cover">'
 				];
-
 
 			if ( CKEDITOR.env.ie6Compat )
@@ -1804,12 +1820,17 @@
 
 			coverElement = CKEDITOR.dom.element.createFromHtml( html.join( '' ) );
-		}
-
-		var element = coverElement;
-
+			coverElement.setOpacity( backgroundCoverOpacity != undefined ? backgroundCoverOpacity : 0.5 );
+
+			coverElement.appendTo( CKEDITOR.document.getBody() );
+			covers[ coverKey ] = coverElement;
+		}
+		else
+			coverElement.	show();
+
+		currentCover = coverElement;
 		var resizeFunc = function()
 		{
 			var size = win.getViewPaneSize();
-			element.setStyles(
+			coverElement.setStyles(
 				{
 					width : size.width + 'px',
@@ -1822,5 +1843,5 @@
 			var pos = win.getScrollPosition(),
 				cursor = CKEDITOR.dialog._.currentTop;
-			element.setStyles(
+			coverElement.setStyles(
 					{
 						left : pos.x + 'px',
@@ -1854,18 +1875,13 @@
 			scrollFunc();
 		}
-
-		var opacity = editor.config.dialog_backgroundCoverOpacity;
-		element.setOpacity( typeof opacity != 'undefined' ? opacity : 0.5 );
-
-		element.appendTo( CKEDITOR.document.getBody() );
 	};
 
-	var removeCover = function()
-	{
-		if ( !coverElement )
+	function hideCover()
+	{
+		if ( !currentCover )
 			return;
 
 		var win = CKEDITOR.document.getWindow();
-		coverElement.remove();
+		currentCover.hide();
 		win.removeListener( 'resize', resizeCover );
 
@@ -1880,4 +1896,11 @@
 		resizeCover = null;
 	};
+	
+	function removeCovers()
+	{
+		for ( var coverId in covers )
+			covers[ coverId ].remove();
+		covers = {};
+	}
 
 	var accessKeyProcessors = {};
@@ -2782,11 +2805,17 @@
 	CKEDITOR.on( 'instanceDestroyed', function( evt )
 	{
+		// Remove dialog cover on last instance destroy.
+		if ( CKEDITOR.tools.isEmpty( CKEDITOR.instances ) )
+		{
+			var currentTopDialog;
+			while ( currentTopDialog = CKEDITOR.dialog._.currentTop )
+				currentTopDialog.hide();
+			removeCovers();
+		}
+
 		var dialogs = evt.editor._.storedDialogs;
 		for ( var name in dialogs )
 			dialogs[ name ].destroy();
 
-		// Remove dialog cover on last instance destroy.
-		if ( CKEDITOR.tools.isEmpty( CKEDITOR.instances ) && coverElement )
-			coverElement.remove();
 	});
 
