Index: /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2680)
+++ /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2681)
@@ -618,4 +618,32 @@
 		};
 		placeBridge();
+	},
+
+	/**
+	 * Hides a page's tab away from the dialog.
+	 * @param {String} id The page's Id.
+	 * @example
+	 * dialog.hidePage( 'tab_3' );
+	 */
+	hidePage : function( id )
+	{
+		var tab = this._.tabs[id] && this._.tabs[id][0];
+		if ( !tab )
+			return;
+		tab.hide();
+	},
+
+	/**
+	 * Unhides a page's tab.
+	 * @param {String} id The page's Id.
+	 * @example
+	 * dialog.showPage( 'tab_2' );
+	 */
+	showPage : function( id )
+	{
+		var tab = this._.tabs[id] && this._.tabs[id][0];
+		if ( !tab )
+			return;
+		tab.show();
 	},
 
Index: /CKEditor/branches/prototype/_source/plugins/link/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/link/plugin.js	(revision 2680)
+++ /CKEditor/branches/prototype/_source/plugins/link/plugin.js	(revision 2681)
@@ -58,4 +58,19 @@
 				targetName.setLabel( editor.lang.linkTargetFrameName );
 			}
+		},
+		// Handles the event when the "Type" selection box is changed.
+			linkTypeChanged = function()
+		{
+			var dialog = this.getDialog();
+			if ( this.getValue() == 'url' )
+			{
+				dialog.showPage( 'target' );
+				dialog.showPage( 'upload' );
+			}
+			else
+			{
+				dialog.hidePage( 'target' );
+				dialog.hidePage( 'upload' );
+			}
 		};
 
@@ -80,5 +95,7 @@
 								[ editor.lang.linkToAnchor, 'anchor' ],
 								[ editor.lang.linkToEmail, 'email' ]
-							]
+							],
+							onChange : linkTypeChanged,
+							onLoad : linkTypeChanged
 						},
 						{
@@ -273,5 +290,5 @@
 				},
 				{
-					id : 'Upload',
+					id : 'upload',
 					label : editor.lang.linkUpload,
 					elements : 
@@ -288,10 +305,10 @@
 							id : 'uploadButton',
 							label : editor.lang.uploadSubmit,
-							'for' : [ 'Upload', 'upload' ]
+							'for' : [ 'upload', 'upload' ]
 						}
 					]
 				},
 				{
-					id : 'Advanced',
+					id : 'advanced',
 					label : editor.lang.linkAdvanced,
 					elements : 
