Index: /CKEditor/branches/prototype/_source/plugins/basicstyles/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/basicstyles/plugin.js	(revision 2858)
+++ /CKEditor/branches/prototype/_source/plugins/basicstyles/plugin.js	(revision 2859)
@@ -22,5 +22,5 @@
 CKEDITOR.plugins.add( 'basicstyles',
 {
-	requires : [ 'styles' ],
+	requires : [ 'styles', 'button' ],
 
 	init : function( editor, pluginPath )
Index: /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2858)
+++ /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2859)
@@ -827,8 +827,5 @@
 	{
 		if ( this._.editor.mode && this._.selectedRanges )
-		{
 			( new CKEDITOR.dom.selection( this._.editor.document ) ).selectRanges( this._.selectedRanges );
-			this._.selectedRanges = null;
-		}
 	}
 };
Index: /CKEditor/branches/prototype/_source/plugins/elementspath/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/elementspath/plugin.js	(revision 2858)
+++ /CKEditor/branches/prototype/_source/plugins/elementspath/plugin.js	(revision 2859)
@@ -79,5 +79,9 @@
 					while ( element )
 					{
-						var index = elementsList.push( element ) - 1,
+						var index = elementsList.push( element ) - 1;
+						var name;
+						if ( element.getAttribute( '_cke_real_element_type' ) )
+							name = element.getAttribute( '_cke_real_element_type' );
+						else
 							name = element.getName();
 
Index: /CKEditor/branches/prototype/_source/plugins/fakeobjects/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/fakeobjects/plugin.js	(revision 2858)
+++ /CKEditor/branches/prototype/_source/plugins/fakeobjects/plugin.js	(revision 2859)
@@ -41,4 +41,12 @@
 							},
 							cssClass : 'flash',
+							priority : 10
+						},
+						{
+							match : function( nodeName, attributes )
+							{
+								return ( nodeName == 'a' && attributes.name != null && attributes.name != '' );
+							},
+							cssClass : 'anchor',
 							priority : 10
 						},
@@ -130,9 +138,11 @@
 						// Get the fake element's CSS class.
 						var cssClass = 'unknown';
+						var realElementType = element.getName();
 						for ( var i = 0 ; i < objectTypes.length ; i++ )
 						{
 							if ( objectTypes[i].match( element.getName(), element.$ ) )
 							{
-								cssClass = '_cke_fakeobject' + ' ' + objectTypes[i].cssClass;
+								cssClass = 'cke_fakeobject' + ' ' + objectTypes[i].cssClass;
+								realElementType = objectTypes[i].cssClass;
 								break;
 							}
@@ -151,4 +161,5 @@
 							fakeRawElement.style.height = heightMatch[1] + 'px';
 						fakeRawElement.setAttribute( '_cke_protected_html', encodeURIComponent( html ) );
+						fakeRawElement.setAttribute( '_cke_real_element_type', realElementType );
 						return new CKEDITOR.dom.element( fakeRawElement );
 					},
@@ -196,4 +207,5 @@
 									inProtection = false;
 									processedHtml.push( encodeURIComponent( protectedHtml.join( '' ) ), '" />' );
+									protectedHtml = [];
 								}
 								return;
@@ -216,5 +228,6 @@
 										CKEDITOR.getUrl( 'images/spacer.gif' ),
 										'" ',
-										'class="_cke_fakeobject ' + objectTypes[i].cssClass + '" ' );
+										'class="cke_fakeobject ' + objectTypes[i].cssClass + '" ',
+										'_cke_real_element_type="' + objectTypes[i].cssClass + '"' );
 
 									if ( widthMatch || heightMatch )
@@ -256,4 +269,5 @@
 									inProtection = false;
 									processedHtml.push( encodeURIComponent( protectedHtml.join( '' ) ), '" />' );
+									protectedHtml = [];
 								}
 							}
@@ -265,5 +279,25 @@
 						return processedHtml.join( '' );
 					},
-
+					/**
+					 * Updates HTML into a placeholder
+					 * @param {CKEDITOR.dom.element} fakeImgElement The placeholder &lt;img&gt;.
+					 * @param {CKEDITOR.dom.element} element Input DOM element.
+					 * @returns {String} encoded HTML.
+					 * @example
+					 */
+					updateFakeElement : function( fakeElement, realElement )
+					{
+						var $ = realElement.$.cloneNode( true ),
+							doc = $.ownerDocument,
+							temp = doc.createElement( 'div' ),
+							html;
+
+						// Get the object's HTML code.
+						temp.appendChild( $ );
+						html = temp.innerHTML;
+						fakeElement.setAttribute( '_cke_protected_html', encodeURIComponent( html ) );
+						return html;
+					},
+					
 					/**
 					 * Restores placeholders in an HTML string back to their original elements.
Index: /CKEditor/branches/prototype/_source/plugins/find/dialogs/find.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/find/dialogs/find.js	(revision 2858)
+++ /CKEditor/branches/prototype/_source/plugins/find/dialogs/find.js	(revision 2859)
@@ -20,233 +20,251 @@
  */
 
-
-findDialog = function( editor, startupPage )
+(function()
 {
-	var characterWalker = function( cursorOrTextNode, offset )
-	{
-		if ( arguments.length < 2 )
-			return;
-
-		var isCursor = ( cursorOrTextNode instanceof characterWalker );
-		CKEDITOR.tools.extend( this._ || ( this._ = {} ),
+	var guardDomWalkerNonEmptyTextNode = function( evt )
+	{
+		if ( evt.to && evt.to.type == CKEDITOR.NODE_TEXT && evt.to.$.length > 0 )
+			this.stop();
+	};
+
+	var domWalkerEventBridge = function()
+	{
+		var me = this,
+			handler = function( evt ){ me.fire( evt.data.type, evt.data ); me._.actionEvents.push( evt.data ); };
+		this._.walker.on( 'up', handler );
+		this._.walker.on( 'down', handler );
+		this._.walker.on( 'sibling', handler );
+	};
+
+	var fireCharacterEvent = function()
+	{
+		var obj = { type : 'character', character : this._.textNode ? this._.textNode.getText().charAt( this._.offset ) : null };
+		this.fire( 'character', obj );
+		this._.actionEvents.push( obj );
+		return { character : obj.character, events : this._.actionEvents };
+	};
+
+	var findDialog = function( editor, startupPage )
+	{
+		var characterWalker = function( cursorOrTextNode, offset )
+		{
+			if ( arguments.length < 2 )
+				return;
+
+			var isCursor = ( cursorOrTextNode instanceof characterWalker );
+			CKEDITOR.tools.extend( this._ || ( this._ = {} ),
+				{
+					textNode : isCursor ? cursorOrTextNode._.textNode : cursorOrTextNode,
+					offset : isCursor ? cursorOrTextNode._.offset : offset,
+					actionEvents : null
+				} );
+			this._.walker = new CKEDITOR.dom.domWalker( this._.textNode );
+			CKEDITOR.event.implementOn( this );
+			domWalkerEventBridge.call( this );
+		};
+
+		characterWalker.prototype = {
+			next : function()
 			{
-				textNode : isCursor ? cursorOrTextNode._.textNode : cursorOrTextNode,
-				offset : isCursor ? cursorOrTextNode._.offset : offset,
-				stopFlag : false,
-				actionEvents : null
-			} );
-		this._.walker = new CKEDITOR.dom.domWalker( this._.textNode );
-		CKEDITOR.event.implementOn( this );
-		arguments.callee.domWalkerEventBridge( this );
-	};
-
-	CKEDITOR.tools.extend( characterWalker,
+				// Clear any previous action events.
+				this._.actionEvents = [];
+
+				// If there are more characters in the text node, get it and raise an event.
+				if ( this._.offset < this._.textNode.getLength() - 1 )
+				{
+					this._.offset++;
+					return fireCharacterEvent.call( this );
+				}
+
+				// If we are at the end of the text node, use dom walker to get the next text node.
+				var data = this._.walker.forward( guardDomWalkerNonEmptyTextNode );
+				this._.textNode = data.node;
+				this._.offset = 0;
+				return fireCharacterEvent.call( this );
+			},
+
+			back : function()
+			{
+				// Clear any previous action events.
+				this._.actionEvents = [];
+
+				// More characters -> decrement offset and return.
+				if ( this._.offset > 0 )
+				{
+					this._.offset--;
+					return fireCharacterEvent.call( this );
+				}
+
+				// Start of text node -> use dom walker to get the previous text node.
+				var data = this._.walker.reverse( guardDomWalkerNonEmptyTextNode );
+				this._.textNode = data.node;
+				this._.offset = data.node.length - 1;
+				return fireCharacterEvent.call( this );
+			}
+		};
+
+		var characterRange = function()
 		{
-			guardDomWalkerNonEmptyTextNode : function( evt )
+		};
+
+		characterRange.prototype = {
+		};
+
+		return {
+			title : editor.lang.findAndReplace.title,
+			resizable : CKEDITOR.DIALOG_RESIZE_NONE,
+			minWidth : 400,
+			minHeight : 245,
+			buttons : [ CKEDITOR.dialog.cancelButton ],		//Cancel button only.
+			contents : [
+				{
+					id : 'find',
+					label : editor.lang.findAndReplace.find,
+					title : editor.lang.findAndReplace.find,
+					accessKey : '',
+					elements : [
+						{
+							type : 'hbox',
+							widths : [ '230px', '90px' ],
+							children :
+							[
+								{
+									type : 'text',
+									id : 'txtFindFind',
+									label : editor.lang.findAndReplace.findWhat,
+									isChanged : false,
+									labelLayout : 'horizontal',
+									accessKey : 'F',
+								},
+								{
+									type : 'button',
+									align : 'left',
+									style : 'width:100%',
+									label : editor.lang.findAndReplace.find,
+									onClick : function()
+									{
+										alert( editor.lang.findAndReplace.notFoundMsg );
+									}
+								},
+							]
+						},
+						{
+							type : 'checkbox',
+							id : 'txtFindCaseChk',
+							isChanged : false,
+							style : 'margin-top:28px',
+							label : editor.lang.findAndReplace.matchCase,
+						},
+						{
+							type : 'checkbox',
+							id : 'txtFindWordChk',
+							isChanged : false,
+							label : editor.lang.findAndReplace.matchWord,
+						},
+						{
+							type : 'checkbox',
+							id : 'txtFindCyclic',
+							isChanged : false,
+							checked : true,
+							label : editor.lang.findAndReplace.matchCyclic,
+						},
+					]
+				},
+				{
+					id : 'replace',
+					label : editor.lang.findAndReplace.replace,
+					accessKey : 'M',
+					elements : [
+						{
+							type : 'hbox',
+							widths : [ '230px', '90px' ],
+							children :
+							[
+								{
+									type : 'text',
+									id : 'txtFindReplace',
+									label : editor.lang.findAndReplace.findWhat,
+									isChanged : false,
+									labelLayout : 'horizontal',
+									accessKey : 'F',
+								},
+								{
+									type : 'button',
+									align : 'left',
+									style : 'width:100%',
+									label : editor.lang.findAndReplace.replace,
+									onClick : function()
+									{
+										alert( editor.lang.findAndReplace.notFoundMsg );
+									}
+								},
+							]
+						},
+						{
+							type : 'hbox',
+							widths : [ '230px', '90px' ],
+							children :
+							[
+								{
+									type : 'text',
+									id : 'txtReplace',
+									label : editor.lang.findAndReplace.replaceWith,
+									isChanged : false,
+									labelLayout : 'horizontal',
+									accessKey : 'R',
+								},
+								{
+									type : 'button',
+									align : 'left',
+									style : 'width:100%',
+									label : editor.lang.findAndReplace.replaceAll,
+									isChanged : false,
+									onClick : function()
+									{
+										alert( editor.lang.findAndReplace.notFoundMsg );
+									}
+								},
+							]
+						},
+						{
+							type : 'checkbox',
+							id : 'txtReplaceCaseChk',
+							isChanged : false,
+							label : editor.lang.findAndReplace.matchCase,
+						},
+						{
+							type : 'checkbox',
+							id : 'txtReplaceWordChk',
+							isChanged : false,
+							label : editor.lang.findAndReplace.matchWord,
+						},
+						{
+							type : 'checkbox',
+							id : 'txtReplaceCyclic',
+							isChanged : false,
+							checked : true,
+							label : editor.lang.findAndReplace.matchCyclic,
+						},
+					]
+				}
+			],
+			onShow : function()
 			{
-				if ( evt.to && evt.to.type == CKEDITOR.NODE_TEXT && evt.to.$.length > 0 )
-					this.stop();
-			},
-
-			domWalkerEventBridge : function( me )
-			{
-				me._.walker.on( 'up', function( evt ){ me.fire( 'domUp', evt.data, evt.editor ); } );
-				me._.walker.on( 'down', function( evt ){ me.fire( 'domDown', evt.data, evt.editor ); } );
-				me._.walker.on( 'sibling', function( evt ){ me.fire( 'domSibling', evt.data, evt.editor ); } );
+				if ( startupPage == 'replace' )
+					this.getContentElement( 'replace', 'txtFindReplace' ).focus();
+				else
+					this.getContentElement( 'find', 'txtFindFind' ).focus();
 			}
-		} );
-
-	characterWalker.prototype = {
-		'next' : function()
-		{
-			// Clear any previous action events.
-			// If there are more characters in the text node, get it and raise an event.
-			// If we are at the end of the text node, use dom walker to get the next text node.
-		},
-
-		'back' : function()
-		{
-		},
-
-		'forward' : function()
-		{
-		},
-
-		'reverse' : function()
-		{
-		},
-
-		'stop' : function()
-		{
-		},
-
-		'stopped' : function()
-		{
-		},
-
-		'setPosition' : function( textNode, offset )
-		{
+		};
+	};
+
+	CKEDITOR.dialog.add( 'find', function( editor ){
+			return findDialog( editor, 'find' )
 		}
-	};
-
-	var characterRange = function()
-	{
-	};
-
-	return {
-		title : editor.lang.findAndReplace.title,
-		resizable : CKEDITOR.DIALOG_RESIZE_NONE,
-		minWidth : 400,
-		minHeight : 245,
-		buttons : [ CKEDITOR.dialog.cancelButton ],		//Cancel button only.
-		contents : [
-			{
-				id : 'find',
-				label : editor.lang.findAndReplace.find,
-				title : editor.lang.findAndReplace.find,
-				accessKey : '',
-				elements : [
-					{
-						type : 'hbox',
-						widths : [ '230px', '90px' ],
-						children :
-						[
-							{
-								type : 'text',
-								id : 'txtFindFind',
-								label : editor.lang.findAndReplace.findWhat,
-								isChanged : false,
-								labelLayout : 'horizontal',
-								accessKey : 'F',
-							},
-							{
-								type : 'button',
-								align : 'left',
-								style : 'width:100%',
-								label : editor.lang.findAndReplace.find,
-								onClick : function()
-								{
-									alert( editor.lang.findAndReplace.notFoundMsg );
-								}
-							},
-						]
-					},
-					{
-						type : 'checkbox',
-						id : 'txtFindCaseChk',
-						isChanged : false,
-						style : 'margin-top:28px',
-						label : editor.lang.findAndReplace.matchCase,
-					},
-					{
-						type : 'checkbox',
-						id : 'txtFindWordChk',
-						isChanged : false,
-						label : editor.lang.findAndReplace.matchWord,
-					},
-					{
-						type : 'checkbox',
-						id : 'txtFindCyclic',
-						isChanged : false,
-						checked : true,
-						label : editor.lang.findAndReplace.matchCyclic,
-					},
-				]
-			},
-			{
-				id : 'replace',
-				label : editor.lang.findAndReplace.replace,
-				accessKey : 'M',
-				elements : [
-					{
-						type : 'hbox',
-						widths : [ '230px', '90px' ],
-						children :
-						[
-							{
-								type : 'text',
-								id : 'txtFindReplace',
-								label : editor.lang.findAndReplace.findWhat,
-								isChanged : false,
-								labelLayout : 'horizontal',
-								accessKey : 'F',
-							},
-							{
-								type : 'button',
-								align : 'left',
-								style : 'width:100%',
-								label : editor.lang.findAndReplace.replace,
-								onClick : function()
-								{
-									alert( editor.lang.findAndReplace.notFoundMsg );
-								}
-							},
-						]
-					},
-					{
-						type : 'hbox',
-						widths : [ '230px', '90px' ],
-						children :
-						[
-							{
-								type : 'text',
-								id : 'txtReplace',
-								label : editor.lang.findAndReplace.replaceWith,
-								isChanged : false,
-								labelLayout : 'horizontal',
-								accessKey : 'R',
-							},
-							{
-								type : 'button',
-								align : 'left',
-								style : 'width:100%',
-								label : editor.lang.findAndReplace.replaceAll,
-								isChanged : false,
-								onClick : function()
-								{
-									alert( editor.lang.findAndReplace.notFoundMsg );
-								}
-							},
-						]
-					},
-					{
-						type : 'checkbox',
-						id : 'txtReplaceCaseChk',
-						isChanged : false,
-						label : editor.lang.findAndReplace.matchCase,
-					},
-					{
-						type : 'checkbox',
-						id : 'txtReplaceWordChk',
-						isChanged : false,
-						label : editor.lang.findAndReplace.matchWord,
-					},
-					{
-						type : 'checkbox',
-						id : 'txtReplaceCyclic',
-						isChanged : false,
-						checked : true,
-						label : editor.lang.findAndReplace.matchCyclic,
-					},
-				]
-			}
-		],
-		onShow : function()
-		{
-			if ( startupPage == 'replace' )
-				this.getContentElement( 'replace', 'txtFindReplace' ).focus();
-			else
-				this.getContentElement( 'find', 'txtFindFind' ).focus();
+	);
+
+	CKEDITOR.dialog.add( 'replace', function( editor ){
+			return findDialog( editor, 'replace' )
 		}
-	};
-};
-
-CKEDITOR.dialog.add( 'find', function( editor ){
-		return findDialog( editor, 'find' )
-	}
-);
-
-CKEDITOR.dialog.add( 'replace', function( editor ){
-		return findDialog( editor, 'replace' )
-	}
-);
+	);
+})();
Index: /CKEditor/branches/prototype/_source/plugins/link/dialogs/anchor.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/link/dialogs/anchor.js	(revision 2858)
+++ /CKEditor/branches/prototype/_source/plugins/link/dialogs/anchor.js	(revision 2859)
@@ -51,11 +51,15 @@
 
 			// Insert a new anchor.
-			if ( !this.editMode)
+			if ( !this.editMode )
 			{
 				// It doesn't work with IE.
 				this.restoreSelection();
 				this.clearSavedSelection();
-				editor.insertElement( this.editObj );
+
+				var fakeElement = CKEDITOR.plugins.fakeobjects.protectElement( this.editObj );
+				editor.insertElement( fakeElement );
 			}
+			else
+				CKEDITOR.plugins.fakeobjects.updateFakeElement( this.fakeObj, this.editObj );
 			return true;
 		},
@@ -63,4 +67,5 @@
 		{
 			this.editObj = false;
+			this.fakeObj = false;
 			this.editMode = false;
 
@@ -76,9 +81,11 @@
 				ranges[0].enlarge( CKEDITOR.ENLARGE_ELEMENT );
 				rangeRoot = ranges[0].getCommonAncestor( true );
-				var element = rangeRoot.getAscendant( 'a', true );
-				if ( element && element.getAttribute( 'name' ) )
+				var element = rangeRoot.getAscendant( 'img', true );
+				if ( element && element.getAttribute( '_cke_real_element_type' ) && element.getAttribute( '_cke_real_element_type' ) == 'anchor' )
 				{
+					this.fakeObj = element;
+					element = CKEDITOR.plugins.fakeobjects.restoreElement( this.fakeObj );
 					loadElements.apply( this, [ editor, selection, ranges, element ] );
-					selection.selectElement( element );
+					selection.selectElement( this.fakeObj );
 					this.saveSelection();
 				}
Index: /CKEditor/branches/prototype/_source/skins/default/toolbar.css
===================================================================
--- /CKEditor/branches/prototype/_source/skins/default/toolbar.css	(revision 2858)
+++ /CKEditor/branches/prototype/_source/skins/default/toolbar.css	(revision 2859)
@@ -263,4 +263,9 @@
 }
 
+.cke_skin_default a.cke_button_pagebreak .cke_icon
+{
+	background-position: 0 -672px;
+}
+
 .cke_skin_default a.cke_button_form .cke_icon
 {
Index: /CKEditor/branches/prototype/contents.css
===================================================================
--- /CKEditor/branches/prototype/contents.css	(revision 2858)
+++ /CKEditor/branches/prototype/contents.css	(revision 2859)
@@ -30,5 +30,5 @@
 }
 
-img._cke_fakeobject
+img.cke_fakeobject
 {
 	background-position: center center;
@@ -39,11 +39,18 @@
 }
 
-img._cke_fakeobject.flash
+img.cke_fakeobject.flash
 {
 	background-image: url(images/flashlogo.gif);
 }
 
-img._cke_fakeobject.object
+img.cke_fakeobject.object
 {
 	background-image: url(images/plugin.gif);
 }
+
+img.cke_fakeobject.anchor
+{
+	background-image: url(images/anchor.gif);
+	width: 18px;
+	height: 18px;
+}
