Index: /CKEditor/branches/prototype/_source/lang/en.js
===================================================================
--- /CKEditor/branches/prototype/_source/lang/en.js	(revision 2775)
+++ /CKEditor/branches/prototype/_source/lang/en.js	(revision 2776)
@@ -77,4 +77,7 @@
 	find			: 'Find',
 	replace			: 'Replace',
+
+	// Common dialog messages.
+	dlgConfirmCancel: 'Some of the options have been changed. Are you sure to close the dialog?',
 
 	// Link dialog.
Index: /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2775)
+++ /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2776)
@@ -227,5 +227,5 @@
 						if ( item.isChanged() )
 						{
-							if ( !confirm( 'Some of the options have been changed. Are you sure to close the dialog?' ) )
+							if ( !confirm( editor.lang.dlgConfirmCancel ) )
 								evt.data.hide = false;
 							return true;
@@ -461,34 +461,51 @@
 
 	/**
-	 * Resets all input values in the dialog.
-	 * @example
-	 * dialogObj.reset();
-	 */
-	reset : function()
+	 * Executes a function for each UI element.
+	 * @param {Function} fn Function to execute for each UI element.
+	 * @returns {CKEDITOR.dialog} The current dialog object.
+	 */
+	foreach : function( fn )
 	{
 		for ( var i in this._.contents )
 			for ( var j in this._.contents[i] )
-			{
-				var c = this._.contents[i][j];
-				if ( c.reset )
-					c.reset();
-			}
-	},
-
-	/**
-	 * Set all the current values in the dialog as the default values.
-	 * @example
-	 * dialogObj.updateDefault();
-	 */
-	updateDefault : function()
-	{
-		for ( var i in this._.contents )
-			for ( var j in this._.contents[i] )
-			{
-				var c = this._.contents[i][j];
-				if ( c.updateDefault )
-					c.updateDefault();
-			}
-	},
+				fn( this._.contents[i][j]);
+		return this;
+	},
+
+	/**
+	 * Resets all input values in the dialog.
+	 * @example
+	 * dialogObj.reset();
+	 * @returns {CKEDITOR.dialog} The current dialog object.
+	 */
+	reset : (function()
+	{
+		var fn = function( widget ){ if ( widget.reset ) widget.reset(); };
+		return function(){ this.foreach( fn ); return this; };
+	})(),
+
+	/**
+	 * Pushes the current values of all inputs in the dialog into the default stack.
+	 * @example
+	 * dialogObj.pushDefault();
+	 * @returns {CKEDITOR.dialog} The current dialog object.
+	 */
+	pushDefault : (function()
+	{
+		var fn = function( widget ){ if ( widget.pushDefault ) widget.pushDefault(); };
+		return function(){ this.foreach( fn ); return this; };
+	})(),
+	
+	/**
+	 * Pops the current default values of all inputs in the dialog.
+	 * @example
+	 * dialogObj.popDefault();
+	 * @returns {CKEDITOR.dialog} The current dialog object.
+	 */
+	popDefault : (function()
+	{
+		var fn = function( widget ){ if ( widget.popDefault ) widget.popDefault(); };
+		return function(){ this.foreach( fn ); return this; };
+	})(),
 
 	/**
Index: /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js	(revision 2775)
+++ /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js	(revision 2776)
@@ -29,6 +29,5 @@
 	{
 		this._ || ( this._ = {} );
-		if ( 'default' in elementDefinition )
-			this._['default'] = elementDefinition['default'];
+		this._['default'] = [ elementDefinition['default'] || '' ];
 		var args = [ this._ ];
 		for ( var i = 1 ; i < arguments.length ; i++ )
@@ -56,5 +55,5 @@
 		isChanged : function()
 		{
-			return this.getValue() != this._['default'];
+			return this.getValue() != this.getDefault();
 		},
 
@@ -64,7 +63,18 @@
 		},
 
-		updateDefault : function()
+		getDefault : function()
 		{
-			this._['default'] = this.getValue();
+			var defs = this._['default'];
+			return defs[ defs.length - 1 ];
+		},
+
+		pushDefault : function()
+		{
+			this._['default'].push( this.getValue() );
+		},
+
+		popDefault : function()
+		{
+			this._['default'].pop();
 		}
 	},
@@ -205,10 +215,4 @@
 					i;
 
-				// Set the default value.
-				if ( !( 'default' in this._ ) )
-					this._['default'] = '';
-				if ( elementDefinition['default'] )
-					attributes.value = this._['default'];
-
 				// Set the validator, if any.
 				if ( elementDefinition.validate )
@@ -271,6 +275,7 @@
 					return;
 
-				var _ = initPrivateObject.call( this, elementDefinition ),
-					domId = _.inputId = CKEDITOR.tools.getNextNumber() + '_textarea',
+				initPrivateObject.call( this, elementDefinition );
+				var me = this,
+					domId = this._.inputId = CKEDITOR.tools.getNextNumber() + '_textarea',
 					attributes = {};
 
@@ -288,5 +293,5 @@
 					for ( var i in attributes )
 						html.push( i + '="' + CKEDITOR.tools.htmlEncode( attributes[i] ) + '" ' );
-					html.push( '>', CKEDITOR.tools.htmlEncode( _['default'] ), '</textarea></div>' );
+					html.push( '>', CKEDITOR.tools.htmlEncode( me.getDefault() ), '</textarea></div>' );
 					return html.join( '' );
 				}
@@ -317,5 +322,5 @@
 					return;
 
-				var _ = initPrivateObject.call( this, elementDefinition, { 'default' : elementDefinition.checked || false }  );
+				var _ = initPrivateObject.call( this, elementDefinition, { 'default' : [ elementDefinition.checked || false ] }  );
 
 				if ( elementDefinition.validate )
@@ -368,6 +373,6 @@
 
 				initPrivateObject.call( this, elementDefinition );
-				if ( !( 'default' in this._ ) )
-					this._['default'] = elementDefinition.items[0][1] ;
+				if ( this.getDefault() == '' )
+					this._['default'] = [ elementDefinition.items[0][1] ] ;
 				if ( elementDefinition.validate )
 					this.validate = elementDefinition.valdiate;
@@ -404,5 +409,5 @@
 								value : value
 							};
-						if ( elementDefinition['default'] == value )
+						if ( this.getDefault() == value )
 							inputAttributes.checked = 'checked';
 						cleanInnerDefinition( inputDefinition );
Index: /CKEditor/branches/prototype/_source/plugins/link/dialogs/link.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/link/dialogs/link.js	(revision 2775)
+++ /CKEditor/branches/prototype/_source/plugins/link/dialogs/link.js	(revision 2776)
@@ -678,6 +678,6 @@
 			}
 
-			// Update the default values of input widgets as the current values.
-			this.updateDefault();
+			// Push the current values into the dialog default value stack.
+			this.pushDefault();
 
 			// Put focus into the first most likely used input.
@@ -809,4 +809,9 @@
 				delete this._.selectedElement;
 			}
+		},
+		onHide : function()
+		{
+			// Pop the default values from default value set that are pushed in onShow().
+			this.popDefault();
 		}
 	};
