Index: /CKEditor/branches/prototype/_source/lang/en.js
===================================================================
--- /CKEditor/branches/prototype/_source/lang/en.js	(revision 2681)
+++ /CKEditor/branches/prototype/_source/lang/en.js	(revision 2682)
@@ -100,4 +100,7 @@
 	linkCharset			: 'Linked Resource Charset',
 	linkStyles			: 'Style',
+	linkSelectAnchor	: 'Select an Anchor',
+	linkAnchorName		: 'By Anchor Name',
+	linkAnchorId		: 'By Element Id',
 	browseServer	: 'Browser Server',
 	url				: 'URL',
Index: /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js	(revision 2681)
+++ /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js	(revision 2682)
@@ -525,4 +525,9 @@
 						theirHtml = elementDefinition.html,
 						myMatch, theirMatch;
+
+					// If the HTML input doesn't contain any tags at the beginning, add a <span> tag around it.
+					if ( theirHtml.charAt( 0 ) != '<' )
+						theirHtml = '<span>' + theirHtml + '</span>';
+
 					CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, myHtmlList, 'span', null, null, '' );
 
Index: /CKEditor/branches/prototype/_source/plugins/link/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/link/plugin.js	(revision 2681)
+++ /CKEditor/branches/prototype/_source/plugins/link/plugin.js	(revision 2682)
@@ -62,6 +62,8 @@
 			linkTypeChanged = function()
 		{
-			var dialog = this.getDialog();
-			if ( this.getValue() == 'url' )
+			var dialog = this.getDialog(),
+				partIds = [ 'urlOptions', 'anchorOptions', 'emailOptions' ],
+				typeValue = this.getValue();
+			if ( typeValue == 'url' )
 			{
 				dialog.showPage( 'target' );
@@ -72,4 +74,13 @@
 				dialog.hidePage( 'target' );
 				dialog.hidePage( 'upload' );
+			}
+
+			for ( var i = 0 ; i < partIds.length ; i++ )
+			{
+				var element = dialog.getContentElement( 'info', partIds[i] ).getElement();
+				if ( partIds[i] == typeValue + 'Options' )
+					element.show();
+				else
+					element.hide();
 			}
 		};
@@ -100,34 +111,88 @@
 						},
 						{
-							type : 'hbox',
-							widths : [ '25%', '75%' ],
-							children : 
-							[
-								{
-									id : 'protocol',
-									type : 'select',
-									label : editor.lang.protocol,
-									'default' : 'http://',
-									style : 'width : 100%;',
-									items :
-									[
-										[ 'http://' ],
-										[ 'https//' ],
-										[ 'ftp://' ],
-										[ 'news://' ],
-										[ '<other>' ]
-									]
-								},
-								{
-									type : 'text',
-									id : 'url',
-									label : editor.lang.url
+							type : 'vbox',
+							id : 'urlOptions',
+							children :
+							[
+								{
+									type : 'hbox',
+									widths : [ '25%', '75%' ],
+									children : 
+									[
+										{
+											id : 'protocol',
+											type : 'select',
+											label : editor.lang.protocol,
+											'default' : 'http://',
+											style : 'width : 100%;',
+											items :
+											[
+												[ 'http://' ],
+												[ 'https//' ],
+												[ 'ftp://' ],
+												[ 'news://' ],
+												[ '<other>' ]
+											]
+										},
+										{
+											type : 'text',
+											id : 'url',
+											label : editor.lang.url
+										}
+									]
+								},
+								{
+									type : 'button',
+									id : 'browse',
+									label : editor.lang.browseServer
 								}
 							]
 						},
 						{
-							type : 'button',
-							id : 'browse',
-							label : editor.lang.browseServer
+							type : 'vbox',
+							id : 'anchorOptions',
+							width : 260,
+							align : 'center',
+							padding : 0,
+							children :
+							[
+								{
+									type : 'html',
+									html : CKEDITOR.tools.htmlEncode( editor.lang.linkSelectAnchor )
+								},
+								{
+									type : 'hbox',
+									children : 
+									[
+										{
+											type : 'select',
+											id : 'anchorName',
+											'default' : '',
+											label : editor.lang.linkAnchorName,
+											style : 'width: 100%;',
+											items :
+											[
+												[ '' ]
+											]
+										},
+										{
+											type : 'select',
+											id : 'anchorId',
+											'default' : '',
+											label : editor.lang.linkAnchorId,
+											style : 'width: 100%;',
+											items :
+											[
+												[ '' ]
+											]
+										}
+									]
+								}
+							]
+						},
+						{
+							'type' : 'vbox',
+							id : 'emailOptions',
+							children : []
 						}
 					]
@@ -179,5 +244,5 @@
 								{
 									type : 'html',
-									html : '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.linkPopupFeatures ) + '</div>'
+									html : CKEDITOR.tools.htmlEncode( editor.lang.linkPopupFeatures )
 								},
 								{
