Index: /CKEditor/branches/prototype/_source/core/dom/domobject.js
===================================================================
--- /CKEditor/branches/prototype/_source/core/dom/domobject.js	(revision 2510)
+++ /CKEditor/branches/prototype/_source/core/dom/domobject.js	(revision 2511)
@@ -112,5 +112,5 @@
 				{
 					if ( this.$.removeEventListener )
-						this.$.removeEventListener( eventName, listener );
+						this.$.removeEventListener( eventName, listener, false );
 					else if ( this.$.detachEvent )
 						this.$.detachEvent( eventName, listener );
Index: /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2510)
+++ /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2511)
@@ -80,4 +80,5 @@
 		'br' : [2,2],
 		'title' : [1,1,0],
+		'close' : [1,1,0,0],
 		'tabs' : [1,1,1],
 		'bridge' : [1,1,2],
@@ -106,5 +107,35 @@
 					if ( definition.onCancel.call( this, evt ) === false )
 						evt.data.hide = false;
-				}, this, null, 0 );
+				}, this, null, 0);
+
+	this.on( 'ok', function( evt )
+			{
+				for ( var i in this._.contents )
+				{
+					if ( this._.contents[i].validate && !this._.contents[i].validate( dialog ) )
+					{
+						evt.data.hide = false;
+						break;
+					}
+				}
+			}, this, null, 0 );
+	this.on( 'cancel', function( evt )
+			{
+				for ( var i in this._.contents )
+				{
+					if ( this._.contents[i].isChanged() )
+					{
+						if ( !confirm( 'Some of the options have been changed. Are you sure to close the dialog?' ) )
+							evt.data.hide = false;
+						break;
+					}
+				}
+			}, this, null, 0 );
+
+	this._.parts.close.on( 'click', function( evt )
+			{
+				if ( this.fire( 'cancel', { hide : true } ).hide !== false )
+					this.hide();
+			}, this );
 
 	// Insert the title.
@@ -363,12 +394,6 @@
 			onClick : function( evt )
 			{
-				var dialog = evt.data.dialog,
-					ret = dialog.fire( 'ok', { hide : true } ).hide;
-				for ( var i in dialog._.contents )
-				{
-					if ( dialog._.contents[i].validate && !dialog._.contents[i].validate( dialog ) )
-						ret = false;
-				}
-				if ( ret !== false )
+				var dialog = evt.data.dialog;
+				if ( dialog.fire( 'ok', { hide : true } ).hide !== false )
 					dialog.hide();
 			}
@@ -382,15 +407,6 @@
 			onClick : function( evt )
 			{
-				var dialog = evt.data.dialog,
-					ret = dialog.fire( 'cancel', { hide : true } ).hide;
-				for ( var i in dialog._.contents )
-				{
-					if ( dialog._.contents[i].isChanged() )
-					{
-						ret = ret && confirm( 'Some of the options have been changed. Are you sure to close the dialog?' );
-						break;
-					}
-				}
-				if ( ret !== false )
+				var dialog = evt.data.dialog;
+				if ( dialog.fire( 'cancel', { hide : true } ).hide !== false )
 					dialog.hide();
 			}
Index: /CKEditor/branches/prototype/_source/skins/default/dialog.css
===================================================================
--- /CKEditor/branches/prototype/_source/skins/default/dialog.css	(revision 2510)
+++ /CKEditor/branches/prototype/_source/skins/default/dialog.css	(revision 2511)
@@ -158,4 +158,5 @@
 	padding: 3px 10px 3px 10px;
 	overflow: hidden;
+	cursor: move;
 }
 
@@ -320,2 +321,22 @@
 	top: 7px;
 }
+
+.cke_skin_default .cke_dialog_close_button
+{
+	background-image: url(images/sprites.png);
+	/* IE6 does not support full color transparent PNG. */
+	_background-image: url(images/sprites.gif);
+	background-repeat: no-repeat;
+	background-position: -16px -651px;
+	position: absolute;
+	cursor: pointer;
+	height: 20px;
+	width: 20px;
+	right: 10px;
+	top: 5px;
+}
+
+.cke_skin_default .cke_dialog_close_button:hover
+{
+	background-position: -16px -687px;
+}
Index: /CKEditor/branches/prototype/_source/themes/default/theme.js
===================================================================
--- /CKEditor/branches/prototype/_source/themes/default/theme.js	(revision 2510)
+++ /CKEditor/branches/prototype/_source/themes/default/theme.js	(revision 2511)
@@ -114,5 +114,7 @@
 						'<div id="cke_dialog_l_%d" class="cke_dialog_l"></div>',
 						'<div id="cke_dialog_c_%d" class="cke_dialog_c">',
-							'<div id="cke_dialog_title_%d" class="cke_dialog_title"></div>',
+							'<div id="cke_dialog_title_%d" class="cke_dialog_title">',
+								'<div id="cke_dialog_close_button_%d" class="cke_dialog_close_button"></div>',
+							'</div>',
 							'<div id="cke_dialog_tabs_%d" class="cke_dialog_tabs"></div>',
 							'<div id="cke_dialog_tabs_bridge_%d" class="cke_dialog_tabs_bridge"></div>',
