Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 4773)
+++ /CKEditor/trunk/CHANGES.html	(revision 4774)
@@ -40,4 +40,18 @@
 		New features:</p>
 	<ul>
+		<li><a href="http://dev.fckeditor.net/ticket/4729">#4729</a> : Added support to fake elements for comments.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4463">#4463</a> : Added inline CSS support in all places where custom stylesheet could apply.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/3881">#3881</a> : Added color dialog for 'more color' option in color buttons.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/2885">#2885</a> : Added 'div' dialog and corresponding context menu options.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4341">#4341</a> : Added the 'showborder' plugin.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4549">#4549</a> : Make the anti-cache query string configurable.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4708">#4708</a> : Added the 'htmlEncodeOutput' config option.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4574">#4574</a> : Added the table merging tools and corresponding context menu options.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4340">#4340</a> : Added the email protection option for link dialog.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4210">#4210</a> : Added CKEditor plugin for jQuery.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4067">#4067</a> : Introduced the full page editing support (from &lt;html&gt; to &lt;/html&gt;).</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4342">#4342</a> : Introduced the bodyId and bodyClass settings to specify the id and class. to be used in the editing area at runtime.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/3401">#3401</a> : Introduced the baseHref setting so it's possible to set the URL to be used to resolve absolute and relative URLs in the contents.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4228">#4228</a> : Introduced the Shared Spaces feature.</li>
 		<li></li>
 	</ul>
@@ -45,5 +59,11 @@
 		Fixed issues:</p>	
 	<ul>
-		<li></li>
+		<li><a href="http://dev.fckeditor.net/ticket/4707">#4707</a> : Fixed invalid link is requested in image preview.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4461">#4461</a> : Fixed toolbar separator line along side combo penetrate toolbar height.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4596">#4596</a> : Fixed image re-size lock buttons aren't accessible in high-contrast mode.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4676">#4676</a> : Fixed editing tables using table properties dialog overwrites original style values.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4714">#4714</a> : Fixed IE6 JavaScript error when editing flash by commit 'Flash' dialog.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/3905">#3905</a> : Fixed 'wysiwyg' mode causes unauthenticated content warnings over SSL in FF 3.5.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/4768">#4768</a> : Fixed open context menu in IE throws js error when focus is not inside document.</li>
 	</ul>
 	<h3>
Index: /CKEditor/trunk/_dev/releaser/ckreleaser.release
===================================================================
--- /CKEditor/trunk/_dev/releaser/ckreleaser.release	(revision 4773)
+++ /CKEditor/trunk/_dev/releaser/ckreleaser.release	(revision 4774)
@@ -30,8 +30,9 @@
 		target : 'plugins',
 		minify : true,
-		ignore : {
+		ignore :
+		{
 			sourcePackage : 'ckeditor.pack',
 			files : 'packages[1].files'
-		}	
+		}
 	},
 
Index: /CKEditor/trunk/_samples/fullpage.html
===================================================================
--- /CKEditor/trunk/_samples/fullpage.html	(revision 4774)
+++ /CKEditor/trunk/_samples/fullpage.html	(revision 4774)
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Full Page Editing - CKEditor Sample</title>
+	<script type="text/javascript" src="sample.js"></script>
+</head>
+<body>
+	<div id="html">
+		<form action="sample_posteddata.php" method="post">
+			<p>
+				In this sample the editor is configured to edit entire HTML pages, from the 
+				&lt;html&gt; tag to &lt;/html&gt;.</p>
+			<p>
+				<label for="editor1">
+					Editor 1:</label><br />
+				<textarea id="editor1" name="editor1" rows="10" cols="80">&lt;html&gt;&lt;head&gt;&lt;title&gt;CKEditor Sample&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</textarea>
+				<script type="text/javascript">
+				//<![CDATA[
+
+					CKEDITOR.replace( 'editor1',
+						{
+							fullPage : true
+						});
+
+				//]]>
+				</script>
+			</p>
+			<p>
+				<input type="submit" value="Submit" />
+			</p>
+		</form>
+	</div>
+	<div id="code">
+		<pre></pre>
+	</div>
+</body>
+</html>
Index: /CKEditor/trunk/_samples/index.html
===================================================================
--- /CKEditor/trunk/_samples/index.html	(revision 4773)
+++ /CKEditor/trunk/_samples/index.html	(revision 4774)
@@ -19,4 +19,5 @@
 		<li><a href="replacebyclass.html">Replace textareas by class name</a></li>
 		<li><a href="replacebycode.html">Replace textareas by code</a></li>
+		<li><a href="fullpage.html">Full page support (editing from &lt;html&gt; to &lt;/html&gt;)</a></li>
 	</ul>
 	<h2>
@@ -37,4 +38,6 @@
 		<li><a href="api_dialog.html">Using the JavaScript API to customize dialogs</a></li>
 		<li><a href="enterkey.html">Using the "Enter" key in CKEditor</a></li>
+		<li><a href="sharedspaces.html">Shared toolbars</a></li>
+		<li><a href="jqueryadapter.html">jQuery adapter example</a></li>
 	</ul>
 	<div id="footer">
Index: /CKEditor/trunk/_samples/jqueryadapter.html
===================================================================
--- /CKEditor/trunk/_samples/jqueryadapter.html	(revision 4774)
+++ /CKEditor/trunk/_samples/jqueryadapter.html	(revision 4774)
@@ -0,0 +1,68 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>jQuery adapter - CKEditor Sample</title>
+	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
+<!-- CKReleaser %REMOVE_LINE%
+	<script type="text/javascript" src="../ckeditor.js"></script>
+	<script type="text/javascript" src="../adapters/jquery.js"></script>
+CKReleaser %REMOVE_START% -->
+	<script type="text/javascript" src="../ckeditor_source.js"></script>
+	<script type="text/javascript" src="../_source/adapters/jquery.js"></script>
+<!-- CKReleaser %REMOVE_END% -->
+	<script type="text/javascript">
+		$( function()
+		{
+			var config = {
+				toolbar :
+				[
+					[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
+					[ 'UIColor' ]
+				]
+			};
+
+			// Initialize the editor.
+			// Callback function can be passed and executed after full instance creation.
+			$( '.jquery_ckeditor' ).ckeditor( config );
+		} );
+	</script>
+</head>
+<body>
+	<div id="html">
+		<form action="sample_posteddata.php" method="post">
+			<p>
+				<label for="editor1">
+					Editor 1:</label><br />
+				<textarea id="editor1" name="editor1" class="jquery_ckeditor" rows="10" cols="80">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+			</p>
+			<p>
+				<input type="submit" value="Submit" />
+			</p>
+		</form>
+	</div>
+	<div id="code">
+		<pre>
+&lt;script type=&quot;text/javascript&quot;&gt;
+	$( function()
+	{
+		$( '.jquery_ckeditor' ).<b>ckeditor()</b>;
+	} );
+&lt;/script&gt;
+		</pre>
+		<pre>
+&lt;form action=""&gt;
+  &lt;p&gt;
+    &lt;label for="editor1"&gt;
+      Editor 1:&lt;/label&gt;&lt;br /&gt;
+    &lt;textarea id="editor1" name="editor1" <b>class="jquery_ckeditor"</b> rows="10" cols="80"&gt;&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;&lt;/textarea&gt;
+  &lt;/p&gt;
+  &lt;p&gt;
+&lt;/form&gt;
+</pre>
+	</div>
+</body>
+</html>
Index: /CKEditor/trunk/_samples/php/advanced.php
===================================================================
--- /CKEditor/trunk/_samples/php/advanced.php	(revision 4774)
+++ /CKEditor/trunk/_samples/php/advanced.php	(revision 4774)
@@ -0,0 +1,91 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Sample - CKEditor</title>
+	<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
+	<link href="../sample.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+	<h1>
+		CKEditor Sample
+	</h1>
+	<!-- This <div> holds alert messages to be display in the sample page. -->
+	<div id="alerts">
+		<noscript>
+			<p>
+				<strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
+				support, like yours, you should still see the contents (HTML data) and you should
+				be able to edit it normally, without a rich editor interface.
+			</p>
+		</noscript>
+	</div>
+	<!-- This <fieldset> holds the HTML that you will usually find in your pages. -->
+	<fieldset title="Output">
+		<legend>Output</legend>
+		<form action="../sample_posteddata.php" method="post">
+			<p>
+				<label>Editor 1:</label><br/>
+			</p>
+<?php
+// Include CKEditor class.
+include("../../ckeditor.php");
+
+// Create class instance. 
+$CKEditor = new CKEditor();
+
+// Do not print the code directly to the browser, return it instead
+$CKEditor->returnOutput = true;
+
+// Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
+//   $CKEditor->basePath = '/ckeditor/'
+// If not set, CKEditor will try to detect the correct path.
+$CKEditor->basePath = '../../';
+
+// Set global configuration (will be used by all instances of CKEditor).
+$CKEditor->config['width'] = 600;
+
+// Change default textarea attributes
+$CKEditor->textareaAttributes = array("cols" => 80, "rows" => 10);
+
+// The initial value to be displayed in the editor.
+$initialValue = '<p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>';
+
+// Create first instance.
+$code = $CKEditor->editor("editor1", $initialValue);
+
+echo $code;
+?>
+			<p>
+				<label>Editor 2:</label><br/>
+			</p>
+<?php
+// Configuration that will be used only by the second editor.
+$config['toolbar'] = array(
+	array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ),
+	array( 'Image', 'Link', 'Unlink', 'Anchor' )
+);
+
+$config['skin'] = 'v2';
+
+// Create second instance.
+echo $CKEditor->editor("editor2", $initialValue, $config);
+?>
+				<input type="submit" value="Submit"/>
+			</p>
+		</form>
+	</fieldset>
+	<div id="footer">
+		<hr/>
+		<p>
+			CKEditor - The text editor for Internet - <a href="http://ckeditor.com/" shape="rect">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright © 2003-2009, <a href="http://cksource.com/" shape="rect">CKSource</a> - Frederico Knabben. All rights reserved.
+		</p>
+	</div>
+</body>
+</html>
Index: /CKEditor/trunk/_samples/php/events.php
===================================================================
--- /CKEditor/trunk/_samples/php/events.php	(revision 4774)
+++ /CKEditor/trunk/_samples/php/events.php	(revision 4774)
@@ -0,0 +1,128 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Sample - CKEditor</title>
+	<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
+	<link href="../sample.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+	<h1>
+		CKEditor Sample
+	</h1>
+	<!-- This <div> holds alert messages to be display in the sample page. -->
+	<div id="alerts">
+		<noscript>
+			<p>
+				<strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
+				support, like yours, you should still see the contents (HTML data) and you should
+				be able to edit it normally, without a rich editor interface.
+			</p>
+		</noscript>
+	</div>
+	<!-- This <fieldset> holds the HTML that you will usually find in your pages. -->
+	<fieldset title="Output">
+		<legend>Output</legend>
+		<form action="../sample_posteddata.php" method="post">
+			<p>
+				<label>Editor 1:</label><br/>
+			</p>
+<?php
+
+/**
+ * Adds global event, will hide "Target" tab in Link dialog in all instances.
+ */
+function CKEditorHideLinkTargetTab(&$CKEditor) {
+
+	$function = 'function (ev) {
+		// Take the dialog name and its definition from the event data
+		var dialogName = ev.data.name;
+		var dialogDefinition = ev.data.definition;
+
+		// Check if the definition is from the Link dialog.
+		if ( dialogName == "link" )
+			dialogDefinition.removeContents("target")
+	}';
+
+	$CKEditor->addGlobalEventHandler('dialogDefinition', $function);
+}
+
+/**
+ * Adds global event, will notify about opened dialog.
+ */
+function CKEditorNotifyAboutOpenedDialog(&$CKEditor) {
+	$function = 'function (evt) {
+		alert("Loading dialog: " + evt.data.name);
+	}';
+
+	$CKEditor->addGlobalEventHandler('dialogDefinition', $function);
+}
+
+// Include CKEditor class.
+include("../../ckeditor.php");
+
+// Create class instance. 
+$CKEditor = new CKEditor();
+
+// Set configuration option for all editors.
+$CKEditor->config['width'] = 750;
+
+// Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
+//   $CKEditor->basePath = '/ckeditor/'
+// If not set, CKEditor will try to detect the correct path.
+$CKEditor->basePath = '../../';
+
+// The initial value to be displayed in the editor.
+$initialValue = '<p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>';
+
+// Event that will be handled only by the first editor.
+$CKEditor->addEventHandler('instanceReady', 'function (evt) {
+	alert("Loaded editor: " + evt.editor.name);
+}');
+
+// Create first instance.
+$CKEditor->editor("editor1", $initialValue);
+
+// Clear event handlers, instances that will be created later will not have
+// the 'instanceReady' listener defined a couple of lines above.
+$CKEditor->clearEventHandlers();
+?>
+			<p>
+				<label>Editor 2:</label><br/>
+			</p>
+<?php
+// Configuration that will be used only by the second editor.
+$config['width'] = '600';
+$config['toolbar'] = 'Basic';
+
+// Add some global event handlers (for all editors).
+CKEditorHideLinkTargetTab($CKEditor);
+CKEditorNotifyAboutOpenedDialog($CKEditor);
+
+// Event that will be handled only by the second editor.
+// Instead of calling addEventHandler(), events may be passed as an argument.
+$events['instanceReady'] = 'function (evt) {
+	alert("Loaded second editor: " + evt.editor.name);
+}';
+
+// Create second instance.
+$CKEditor->editor("editor2", $initialValue, $config, $events);
+?>
+				<input type="submit" value="Submit"/>
+			</p>
+		</form>
+	</fieldset>
+	<div id="footer">
+		<hr/>
+		<p>
+			CKEditor - The text editor for Internet - <a href="http://ckeditor.com/" shape="rect">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright © 2003-2009, <a href="http://cksource.com/" shape="rect">CKSource</a> - Frederico Knabben. All rights reserved.
+		</p>
+	</div>
+</body>
+</html>
Index: /CKEditor/trunk/_samples/php/replace.php
===================================================================
--- /CKEditor/trunk/_samples/php/replace.php	(revision 4774)
+++ /CKEditor/trunk/_samples/php/replace.php	(revision 4774)
@@ -0,0 +1,62 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Sample - CKEditor</title>
+	<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
+	<link href="../sample.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+	<h1>
+		CKEditor Sample
+	</h1>
+	<!-- This <div> holds alert messages to be display in the sample page. -->
+	<div id="alerts">
+		<noscript>
+			<p>
+				<strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
+				support, like yours, you should still see the contents (HTML data) and you should
+				be able to edit it normally, without a rich editor interface.
+			</p>
+		</noscript>
+	</div>
+	<!-- This <fieldset> holds the HTML that you will usually find in your pages. -->
+	<fieldset title="Output">
+		<legend>Output</legend>
+		<form action="../sample_posteddata.php" method="post">
+			<p>
+				<label for="editor1">
+					Editor 1:</label><br/>
+				<textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+			</p>
+			<p>
+				<input type="submit" value="Submit"/>
+			</p>
+		</form>
+	</fieldset>
+	<div id="footer">
+		<hr/>
+		<p>
+			CKEditor - The text editor for Internet - <a href="http://ckeditor.com/" shape="rect">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright © 2003-2009, <a href="http://cksource.com/" shape="rect">CKSource</a> - Frederico Knabben. All rights reserved.
+		</p>
+	</div>
+	<?php
+	// Include CKEditor class.
+	include_once "../../ckeditor.php";
+	// Create class instance.
+	$CKEditor = new CKEditor();
+	// Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
+	//   $CKEditor->basePath = '/ckeditor/'
+	// If not set, CKEditor will try to detect the correct path.
+	$CKEditor->basePath = '../../';
+	// Replace textarea with id (or name) "editor1".
+	$CKEditor->replace("editor1");
+	?>
+</body>
+</html>
Index: /CKEditor/trunk/_samples/php/replaceall.php
===================================================================
--- /CKEditor/trunk/_samples/php/replaceall.php	(revision 4774)
+++ /CKEditor/trunk/_samples/php/replaceall.php	(revision 4774)
@@ -0,0 +1,67 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Sample - CKEditor</title>
+	<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
+	<link href="../sample.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+	<h1>
+		CKEditor Sample
+	</h1>
+	<!-- This <div> holds alert messages to be display in the sample page. -->
+	<div id="alerts">
+		<noscript>
+			<p>
+				<strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
+				support, like yours, you should still see the contents (HTML data) and you should
+				be able to edit it normally, without a rich editor interface.
+			</p>
+		</noscript>
+	</div>
+	<!-- This <fieldset> holds the HTML that you will usually find in your pages. -->
+	<fieldset title="Output">
+		<legend>Output</legend>
+		<form action="../sample_posteddata.php" method="post">
+			<p>
+				<label for="editor1">
+					Editor 1:</label><br/>
+				<textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+			</p>
+			<p>
+				<label for="editor2">
+					Editor 2:</label><br/>
+				<textarea cols="80" id="editor2" name="editor2" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+			</p>
+			<p>
+				<input type="submit" value="Submit"/>
+			</p>
+		</form>
+	</fieldset>
+	<div id="footer">
+		<hr/>
+		<p>
+			CKEditor - The text editor for Internet - <a href="http://ckeditor.com/" shape="rect">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright © 2003-2009, <a href="http://cksource.com/" shape="rect">CKSource</a> - Frederico Knabben. All rights reserved.
+		</p>
+	</div>
+	<?php
+	// Include CKEditor class.
+	include("../../ckeditor.php");
+	// Create class instance.
+	$CKEditor = new CKEditor();
+	// Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
+	//   $CKEditor->basePath = '/ckeditor/'
+	// If not set, CKEditor will try to detect the correct path.
+	$CKEditor->basePath = '../../';
+	// Replace all textareas with CKEditor.
+	$CKEditor->replaceAll();
+	?>
+</body>
+</html>
Index: /CKEditor/trunk/_samples/php/standalone.php
===================================================================
--- /CKEditor/trunk/_samples/php/standalone.php	(revision 4774)
+++ /CKEditor/trunk/_samples/php/standalone.php	(revision 4774)
@@ -0,0 +1,63 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Sample - CKEditor</title>
+	<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
+	<link href="../sample.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+	<h1>
+		CKEditor Sample
+	</h1>
+	<!-- This <div> holds alert messages to be display in the sample page. -->
+	<div id="alerts">
+		<noscript>
+			<p>
+				<strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
+				support, like yours, you should still see the contents (HTML data) and you should
+				be able to edit it normally, without a rich editor interface.
+			</p>
+		</noscript>
+	</div>
+	<!-- This <fieldset> holds the HTML that you will usually find in your pages. -->
+	<fieldset title="Output">
+		<legend>Output</legend>
+		<form action="../sample_posteddata.php" method="post">
+			<p>
+				<label for="editor1">
+					Editor 1:</label><br/>
+			</p>
+			<p>
+			<?php
+				// Include CKEditor class.
+				include_once "../../ckeditor.php";
+				// The initial value to be displayed in the editor.
+				$initialValue = '<p>This is some <strong>sample text</strong>.</p>';
+				// Create class instance.
+				$CKEditor = new CKEditor();
+				// Path to CKEditor directory, ideally instead of relative dir, use an absolute path:
+				//   $CKEditor->basePath = '/ckeditor/'
+				// If not set, CKEditor will try to detect the correct path.
+				$CKEditor->basePath = '../../';
+				// Create textarea element and attach CKEditor to it.
+				$CKEditor->editor("editor1", $initialValue);
+			?>
+				<input type="submit" value="Submit"/>
+			</p>
+		</form>
+	</fieldset>
+	<div id="footer">
+		<hr/>
+		<p>
+			CKEditor - The text editor for Internet - <a href="http://ckeditor.com/" shape="rect">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright © 2003-2009, <a href="http://cksource.com/" shape="rect">CKSource</a> - Frederico Knabben. All rights reserved.
+		</p>
+	</div>
+</body>
+</html>
Index: /CKEditor/trunk/_samples/sharedspaces.html
===================================================================
--- /CKEditor/trunk/_samples/sharedspaces.html	(revision 4774)
+++ /CKEditor/trunk/_samples/sharedspaces.html	(revision 4774)
@@ -0,0 +1,115 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Replace Textarea by Code - CKEditor Sample</title>
+	<script type="text/javascript" src="sample.js"></script>
+	<style id="styles" type="text/css">
+
+#editorsForm
+{
+	height: 400px;
+	overflow: auto;
+	border: solid 1px #555;
+	margin: 10px 0;
+	padding: 0 10px;
+}
+
+	</style>
+</head>
+<body>
+	<div id="html">
+		<div id="topSpace">
+		</div>
+		<form id="editorsForm" action="sample_posteddata.php" method="post">
+			<p>
+				<label for="editor1">
+					Editor 1 (uses the shared toolbar and element path):</label><br />
+				<textarea id="editor1" name="editor1" rows="10" cols="80">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+				<script type="text/javascript">
+				//<![CDATA[
+					CKEDITOR.replace( 'editor1',
+						{
+							sharedSpaces :
+							{
+								top : 'topSpace',
+								bottom : 'bottomSpace'
+							},
+
+							// Removes the maximize plugin as it's not usable
+							// in a shared toolbar.
+							// Removes the resizer as it's not usable in a
+							// shared elements path.
+							removePlugins : 'maximize,resize'
+						} );
+				//]]>
+				</script>
+			</p>
+			<p>
+				<label for="editor2">
+					Editor 2 (uses the shared toolbar and element path):</label><br />
+				<textarea id="editor2" name="editor2" rows="10" cols="80">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+				<script type="text/javascript">
+				//<![CDATA[
+					CKEDITOR.replace( 'editor2',
+						{
+							sharedSpaces :
+							{
+								top : 'topSpace',
+								bottom : 'bottomSpace'
+							},
+
+							// Removes the maximize plugin as it's not usable
+							// in a shared toolbar.
+							// Removes the resizer as it's not usable in a
+							// shared elements path.
+							removePlugins : 'maximize,resize'
+						} );
+				//]]>
+				</script>
+			</p>
+			<p>
+				<label for="editor3">
+					Editor 3 (uses the shared toolbar only):</label><br />
+				<textarea id="editor3" name="editor3" rows="10" cols="80">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+				<script type="text/javascript">
+				//<![CDATA[
+					CKEDITOR.replace( 'editor3',
+						{
+							sharedSpaces :
+							{
+								top : 'topSpace'
+							},
+							
+							// Removes the maximize plugin as it's not usable
+							// in a shared toolbar.
+							removePlugins : 'maximize'
+						} );
+				//]]>
+				</script>
+			</p>
+			<p>
+				<label for="editor4">
+					Editor 4 (no shared spaces):</label><br />
+				<textarea id="editor4" name="editor4" rows="10" cols="80">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+				<script type="text/javascript">
+				//<![CDATA[
+					CKEDITOR.replace( 'editor4' );
+				//]]>
+				</script>
+			</p>
+			<p>
+				<input type="submit" value="Submit" />
+			</p>
+		</form>
+		<div id="bottomSpace">
+		</div>
+	</div>
+	<div id="code">
+		<pre></pre>
+	</div>
+</body>
+</html>
Index: /CKEditor/trunk/_source/adapters/jquery.js
===================================================================
--- /CKEditor/trunk/_source/adapters/jquery.js	(revision 4774)
+++ /CKEditor/trunk/_source/adapters/jquery.js	(revision 4774)
@@ -0,0 +1,283 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview jQuery adapter provides easy use of basic CKEditor functions
+ *   and access to internal API. It also integrates some aspects of CKEditor with
+ *   jQuery framework.
+ *
+ * Every TEXTAREA, DIV and P elements can be converted to working editor.
+ *
+ * Plugin exposes some of editor's event to jQuery event system. All of those are namespaces inside
+ * ".ckeditor" namespace and can be binded/listened on supported textarea, div and p nodes.
+ *
+ * Available jQuery events:
+ * - instanceReady.ckeditor( editor, rootNode )
+ *   Triggered when new instance is ready.
+ * - destroy.ckeditor( editor )
+ *   Triggered when instance is destroyed.
+ * - getData.ckeditor( editor, eventData )
+ *   Triggered when getData event is fired inside editor. It can change returned data using eventData reference.
+ * - setData.ckeditor( editor )
+ *   Triggered when getData event is fired inside editor.
+ * 
+ * @example
+ * <script src="jquery.js"></script>
+ * <script src="ckeditor.js"></script>
+ * <script src="adapters/jquery/adapter.js"></script>
+ */
+
+(function()
+{
+	/**
+	 * Allow CKEditor to override jQuery.fn.val(). This results in ability to use val()
+	 * function on textareas as usual and having those calls synchronized with CKEditor
+	 * Rich Text Editor component.
+	 *
+	 * This config option is global and executed during plugin load.
+	 * Can't be customized across editor instances.
+	 *
+	 * @type Boolean
+	 * @example
+	 * $( 'textarea' ).ckeditor();
+	 * // ...
+	 * $( 'textarea' ).val( 'New content' );
+	 */
+	CKEDITOR.config.jqueryOverrideVal = typeof CKEDITOR.config.jqueryOverrideVal == 'undefined'
+		? true : CKEDITOR.config.jqueryOverrideVal;
+
+	if ( typeof jQuery == 'undefined' )
+		return;
+
+	// jQuery object methods.
+	jQuery.extend( jQuery.fn,
+	/** @lends jQuery.fn */
+	{
+		/**
+		 * Return existing CKEditor instance for first matched element.
+		 * Allows to easily use internal API. Doesn't return jQuery object.
+		 *
+		 * Raised exception if editor doesn't exist or isn't ready yet.
+		 *
+		 * @name jQuery.ckeditorGet
+		 * @return CKEDITOR.editor
+		 * @see CKEDITOR.editor
+		 */
+		ckeditorGet: function()
+		{
+			var instance = this.eq( 0 ).data( 'ckeditorInstance' );
+			if ( !instance )
+				throw "CKEditor not yet initialized, use ckeditor() with callback.";
+			return instance;
+		},
+		/**
+		 * Triggers creation of CKEditor in all matched elements (reduced to DIV, P and TEXTAREAs).
+		 * Binds callback to instanceReady event of all instances. If editor is already created, than
+		 * callback is fired right away.
+		 *
+		 * Mixed parameter order allowed.
+		 *
+		 * @param callback Function to be run on editor instance. Passed parameters: [ textarea ].
+		 * Callback is fiered in "this" scope being ckeditor instance and having source textarea as first param.
+		 *
+		 * @param config Configuration options for new instance(s) if not already created.
+		 * See URL
+		 *
+		 * @example
+		 * $( 'textarea' ).ckeditor( function( textarea ) {
+		 *   $( textarea ).val( this.getData() )
+		 * } );
+		 *
+		 * @name jQuery.fn.ckeditor
+		 * @return jQuery.fn
+		 */
+		ckeditor: function( callback, config )
+		{
+			if ( !jQuery.isFunction( callback ))
+			{
+				var tmp = config;
+				config = callback;
+				callback = tmp;
+			}
+			config = config || {};
+
+			this.filter( 'textarea, div, p' ).each( function()
+			{
+				var $element = jQuery( this ),
+					editor = $element.data( 'ckeditorInstance' ),
+					instanceLock = $element.data( '_ckeditorInstanceLock' ),
+					element = this;
+
+				if ( editor && !instanceLock )
+				{
+					if ( callback )
+						callback.apply( editor, [ this ] );
+				}
+				else if ( !instanceLock )
+				{
+					// CREATE NEW INSTANCE
+
+					// Handle config.autoUpdateElement inside this plugin if desired.
+					if ( config.autoUpdateElement
+						|| ( typeof config.autoUpdateElement == 'undefined' && CKEDITOR.config.autoUpdateElement ) )
+					{
+						config.autoUpdateElementJquery = true;
+					}
+
+					// Always disable config.autoUpdateElement.
+					config.autoUpdateElement = false;
+					$element.data( '_ckeditorInstanceLock', true );
+
+					// Set instance reference in element's data.
+					editor = CKEDITOR.replace( element, config );
+					$element.data( 'ckeditorInstance', editor );
+
+					// Register callback.
+					editor.on( 'instanceReady', function( event )
+					{
+						var editor = event.editor;
+						setTimeout( function()
+						{
+							// Delay bit more if editor is still not ready.
+							if ( !editor.element )
+								return setTimeout( arguments.callee, 100 );
+
+							// Remove this listener.
+							event.removeListener( 'instanceReady', this.callee );
+
+							// Forward setData on dataReady.
+							editor.on( 'dataReady', function()
+							{
+								$element.trigger( 'setData' + '.ckeditor', [ editor ] );
+							});
+
+							// Forward getData.
+							editor.on( 'getData', function( event ) {
+								$element.trigger( 'getData' + '.ckeditor', [ editor, event.data ] );
+							}, 999 );
+
+							// Forward destroy event.
+							editor.on( 'destroy', function()
+							{
+								$element.trigger( 'destroy.ckeditor', [ editor ] );
+							});
+
+							// Integrate with form submit.
+							if ( editor.config.autoUpdateElementJquery && $element.is( 'textarea' ) && $element.parents( 'form' ).length )
+							{
+								var onSubmit = function()
+								{
+									$element.ckeditor( function()
+									{
+										editor.updateElement();
+									});
+								};
+
+								// Bind to submit event.
+								$element.parents( 'form' ).submit( onSubmit );
+
+								// Unbind when editor destroyed.
+								$element.bind( 'destroy.ckeditor', function()
+								{
+									$element.parents( 'form' ).unbind( 'submit', onSubmit );
+								});
+							}
+
+							// Garbage collect on destroy.
+							editor.on( 'destroy', function()
+							{
+								$element.data( 'ckeditorInstance', null );
+							});
+
+							// Remove lock.
+							$element.data( '_ckeditorInstanceLock', null );
+
+							// Fire instanceReady event.
+							$element.trigger( 'instanceReady.ckeditor', [ editor ] );
+
+							// Run given (first) code.
+							if ( callback )
+								callback.apply( editor, [ element ] );
+						}, 0 );
+					}, null, null, 9999);
+				}
+				else
+				{
+					// Editor is already during creation process, bind our code to the event.
+					CKEDITOR.on( 'instanceReady', function( event )
+					{
+						var editor = event.editor;
+						setTimeout( function()
+						{
+							// Delay bit more if editor is still not ready.
+							if ( !editor.element )
+								return setTimeout( arguments.callee, 100 );
+
+							if ( editor.element.$ == element )
+							{
+								// Run given code.
+								if ( callback )
+									callback.apply( editor, [ element ] );
+							}
+						}, 0 );
+					}, null, null, 9999);
+				}
+			});
+			return this;
+		}
+	});
+
+	// New val() method for objects.
+	if ( CKEDITOR.config.jqueryOverrideVal )
+	{
+		jQuery.fn.val = CKEDITOR.tools.override( jQuery.fn.val, function( oldValMethod )
+		{
+			/**
+			 * CKEditor-aware val() method.
+			 *
+			 * Acts same as original jQuery val(), but for textareas which have CKEditor instances binded to them, method
+			 * returns editor's content. It also works for settings values.
+			 *
+			 * @param oldValMethod
+			 * @name jQuery.fn.val
+			 */
+			return function( newValue, forceNative )
+			{
+				var isSetter = typeof newValue != 'undefined',
+					result;
+
+				this.each( function()
+				{
+					var $this = jQuery( this ),
+						editor = $this.data( 'ckeditorInstance' );
+
+					if ( !forceNative && $this.is( 'textarea' ) && editor )
+					{
+						if ( isSetter )
+							editor.setData( newValue );
+						else
+						{
+							result = editor.getData();
+							// break;
+							return null;
+						}
+					}
+					else
+					{
+						if ( isSetter )
+							oldValMethod.call( $this, newValue );
+						else
+						{
+							result = oldValMethod.call( $this );
+							// break;
+							return null;
+						}
+					}
+				});
+				return isSetter ? this : result;
+			};
+		});
+	}
+})();
Index: /CKEditor/trunk/_source/core/_bootstrap.js
===================================================================
--- /CKEditor/trunk/_source/core/_bootstrap.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/_bootstrap.js	(revision 4774)
@@ -13,10 +13,15 @@
 	// background image.
 
-	var testImage = ( CKEDITOR.env.ie && CKEDITOR.env.version < 7 ) ? ( CKEDITOR.basePath + 'images/spacer.gif' ) : 'about:blank';
+	var useSpacer = CKEDITOR.env.ie && CKEDITOR.env.version < 7,
+		useBlank = CKEDITOR.env.ie && CKEDITOR.env.version == 7;
+
+
+	var backgroundImageUrl = useSpacer ? ( CKEDITOR.basePath + 'images/spacer.gif' ) :
+							 useBlank ? 'about:blank' : 'data:image/png;base64,';
 
 	var hcDetect = CKEDITOR.dom.element.createFromHtml(
 		'<div style="width:0px;height:0px;' +
 			'position:absolute;left:-10000px;' +
-			'background-image:url(' + testImage + ')"></div>', CKEDITOR.document );
+			'background-image:url(' + backgroundImageUrl + ')"></div>', CKEDITOR.document );
 
 	hcDetect.appendTo( CKEDITOR.document.getHead() );
Index: /CKEditor/trunk/_source/core/config.js
===================================================================
--- /CKEditor/trunk/_source/core/config.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/config.js	(revision 4774)
@@ -41,5 +41,5 @@
 	 * CKEDITOR.replace( 'myfiled', { customConfig : '' } );
 	 */
-	customConfig : CKEDITOR.getUrl( 'config.js' ),
+	customConfig : 'config.js',
 
 	/**
@@ -168,4 +168,18 @@
 
 	/**
+	 * Sets the 'id' attribute to be used on body if it doesn't have one.
+	 * @type String
+	 * @default ''
+	 */
+	bodyId : '',
+
+	/**
+	 * Sets the 'class' attribute to be used on body if it doesn't have one.  
+	 * @type String
+	 * @default ''
+	 */
+	bodyClass : '',
+
+	/**
 	 * Indicates whether the contents to be edited are being inputted as a full
 	 * HTML page. A full page includes the &lt;html&gt;, &lt;head&gt; and
@@ -199,5 +213,5 @@
 	 * @example
 	 */
-	plugins : 'about,basicstyles,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,smiley,showblocks,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',
+	plugins : 'about,basicstyles,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,div,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,smiley,showblocks,showborders,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',
 
 	/**
@@ -284,5 +298,4 @@
 	 */
 	baseFloatZIndex : 10000
-
 };
 
Index: /CKEditor/trunk/_source/core/dom/comment.js
===================================================================
--- /CKEditor/trunk/_source/core/dom/comment.js	(revision 4774)
+++ /CKEditor/trunk/_source/core/dom/comment.js	(revision 4774)
@@ -0,0 +1,32 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview Defines the {@link CKEDITOR.dom.comment} class, which represents
+ *		a DOM comment node.
+ */
+
+CKEDITOR.dom.comment = CKEDITOR.tools.createClass(
+{
+	base : CKEDITOR.dom.node,
+
+	$ : function( text, ownerDocument )
+	{
+		if ( typeof text == 'string' )
+			text = ( ownerDocument ? ownerDocument.$ : document ).createComment( text );
+
+		this.base( text );
+	},
+	
+	proto :
+	{
+		type : CKEDITOR.NODE_COMMENT,
+		
+		getOuterHtml : function()
+		{
+			return '<!--' + this.$.nodeValue + '-->';
+		}
+	}
+});
Index: /CKEditor/trunk/_source/core/dom/document.js
===================================================================
--- /CKEditor/trunk/_source/core/dom/document.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/dom/document.js	(revision 4774)
@@ -53,4 +53,19 @@
 		},
 
+		appendStyleText : function( cssStyleText )
+		{
+			if ( this.$.createStyleSheet )
+			{
+				var styleSheet = this.$.createStyleSheet( "" );
+				styleSheet.cssText = cssStyleText ;
+			}
+			else
+			{
+				var style = new CKEDITOR.dom.element( 'style', this );
+				style.append( new CKEDITOR.dom.text( cssStyleText, this ) );
+				this.getHead().append( style );
+			}
+		},
+
 		createElement : function( name, attribsAndStyles )
 		{
Index: /CKEditor/trunk/_source/core/dom/element.js
===================================================================
--- /CKEditor/trunk/_source/core/dom/element.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/dom/element.js	(revision 4774)
@@ -329,5 +329,7 @@
 		getHtml : function()
 		{
-			return this.$.innerHTML;
+			var retval = this.$.innerHTML;
+			// Strip <?xml:namespace> tags in IE. (#3341).
+			return CKEDITOR.env.ie ? retval.replace( /<\?[^>]*>/g, '' ) : retval;
 		},
 
Index: /CKEditor/trunk/_source/core/dom/range.js
===================================================================
--- /CKEditor/trunk/_source/core/dom/range.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/dom/range.js	(revision 4774)
@@ -1469,4 +1469,5 @@
 				{
 					endBlock = this.splitElement( startBlock );
+
 					// In Gecko, the last child node must be a bogus <br>.
 					// Note: bogus <br> added under <ul> or <ol> would cause
@@ -1605,5 +1606,5 @@
 
 		/**
-		 * Moves the range boundaries to the first editing point inside an
+		 * Moves the range boundaries to the first/end editing point inside an
 		 * element. For example, in an element tree like
 		 * "&lt;p&gt;&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt; Text&lt;/p&gt;", the start editing point is
@@ -1611,6 +1612,7 @@
 		 * @param {CKEDITOR.dom.element} el The element into which look for the
 		 *		editing spot.
+		 * @param {Boolean} isMoveToEnd Whether move to the end editable position.
 		 */
-		moveToElementEditStart : function( el )
+		moveToElementEditablePosition : function( el, isMoveToEnd )
 		{
 			var isEditable;
@@ -1622,9 +1624,13 @@
 				// If an editable element is found, move inside it.
 				if ( isEditable )
-					this.moveToPosition( el, CKEDITOR.POSITION_AFTER_START );
+					this.moveToPosition( el, isMoveToEnd ?
+					                         CKEDITOR.POSITION_BEFORE_END :
+					                         CKEDITOR.POSITION_AFTER_START );
 				// Stop immediately if we've found a non editable inline element (e.g <img>).
 				else if ( CKEDITOR.dtd.$inline[ el.getName() ] )
 				{
-					this.moveToPosition( el, CKEDITOR.POSITION_BEFORE_START );
+					this.moveToPosition( el, isMoveToEnd ?
+					                         CKEDITOR.POSITION_AFTER_END :
+					                         CKEDITOR.POSITION_BEFORE_START );
 					return true;
 				}
@@ -1632,12 +1638,14 @@
 				// Non-editable non-inline elements are to be bypassed, getting the next one.
 				if ( CKEDITOR.dtd.$empty[ el.getName() ] )
-					el = el.getNext( nonWhitespaceOrBookmarkEval );
+					el = el[ isMoveToEnd ? 'getPrevious' : 'getNext' ]( nonWhitespaceOrBookmarkEval );
 				else
-					el = el.getFirst( nonWhitespaceOrBookmarkEval );
+					el = el[ isMoveToEnd ? 'getLast' : 'getFirst' ]( nonWhitespaceOrBookmarkEval );
 
 				// Stop immediately if we've found a text node.
 				if ( el && el.type == CKEDITOR.NODE_TEXT )
 				{
-					this.moveToPosition( el, CKEDITOR.POSITION_BEFORE_START );
+					this.moveToPosition( el, isMoveToEnd ?
+					                         CKEDITOR.POSITION_AFTER_END :
+					                         CKEDITOR.POSITION_BEFORE_START );
 					return true;
 				}
@@ -1645,4 +1653,20 @@
 
 			return isEditable;
+		},
+
+		/**
+		 *@see {CKEDITOR.dom.range.moveToElementEditablePosition}
+		 */
+		moveToElementEditStart : function( target )
+		{
+			return this.moveToElementEditablePosition( target );
+		},
+
+		/**
+		 *@see {CKEDITOR.dom.range.moveToElementEditablePosition}
+		 */
+		moveToElementEditEnd : function( target )
+		{
+			return this.moveToElementEditablePosition( target, true );
 		},
 
Index: /CKEditor/trunk/_source/core/dom/walker.js
===================================================================
--- /CKEditor/trunk/_source/core/dom/walker.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/dom/walker.js	(revision 4774)
@@ -429,3 +429,23 @@
 	};
 
+	var tailNbspRegex = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
+		isNotWhitespaces = CKEDITOR.dom.walker.whitespaces( true ),
+		isNotBookmark = CKEDITOR.dom.walker.bookmark( false, true ),
+		fillerEvaluator = function( element )
+		{
+			return isNotBookmark( element ) && isNotWhitespaces( element );
+		};
+
+	// Check if there's a filler node at the end of an element, and return it.
+	CKEDITOR.dom.element.prototype.getBogus = function ()
+	{
+		var tail = this.getLast( fillerEvaluator );
+		if ( tail && ( !CKEDITOR.env.ie ? tail.is && tail.is( 'br' )
+				: tail.getText && tailNbspRegex.test( tail.getText() ) ) )
+		{
+			return tail;
+		}
+		return false;
+	};
+
 })();
Index: /CKEditor/trunk/_source/core/dtd.js
===================================================================
--- /CKEditor/trunk/_source/core/dtd.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/dtd.js	(revision 4774)
@@ -1,3 +1,3 @@
-﻿/*
+﻿﻿/*
 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
@@ -33,5 +33,5 @@
 CKEDITOR.dtd = (function()
 {
-    var X = CKEDITOR.tools.extend,
+	var X = CKEDITOR.tools.extend,
 
 		A = {isindex:1,fieldset:1},
@@ -52,12 +52,20 @@
 		O = X({param:1},K),
 		P = X({form:1},A,D,E,I),
-		Q = {li:1};
+		Q = {li:1},
+		R = {style:1,script:1},
+		S = {base:1,link:1,meta:1,title:1},
+		T = X(S,R),
+		U = {head:1,body:1},
+		V = {html:1};
 
 	var block = {address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1};
 
-    return /** @lends CKEDITOR.dtd */ {
+	return /** @lends CKEDITOR.dtd */ {
 
 		// The "$" items have been added manually.
 
+		// List of elements living outside body.
+		$nonBodyContent: X(V,U,S),
+
 		/**
 		 * List of block elements, like "p" or "div".
@@ -67,7 +75,14 @@
 		$block : block,
 
+		/**
+		 * List of block limit elements.
+		 * @type Object
+		 * @example
+		 */
+		$blockLimit : { body:1,div:1,td:1,th:1,caption:1,form:1 },
+
 		$inline : L,	// Just like span.
 
-		$body : X({script:1}, block),
+		$body : X({script:1,style:1}, block),
 
 		$cdata : {script:1,style:1},
@@ -123,4 +138,13 @@
 		$tableContent : {caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},
 
+        html: U,
+        head: T,
+        style: N,
+        script: N,
+        body: P,
+        base: {},
+        link: {},
+        meta: {},
+        title: N,
         col : {},
         tr : {td:1,th:1},
Index: /CKEditor/trunk/_source/core/editor.js
===================================================================
--- /CKEditor/trunk/_source/core/editor.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/editor.js	(revision 4774)
@@ -28,5 +28,5 @@
 	var loadConfig = function( editor )
 	{
-		var customConfig = editor.config.customConfig;
+		var customConfig = CKEDITOR.getUrl( editor.config.customConfig );
 
 		// Check if there is a custom config to load.
@@ -45,5 +45,5 @@
 			// If there is no other customConfig in the chain, fire the
 			// "configLoaded" event.
-			if ( editor.config.customConfig == customConfig || !loadConfig( editor ) )
+			if ( CKEDITOR.getUrl( editor.config.customConfig ) == customConfig || !loadConfig( editor ) )
 				editor.fireOnce( 'customConfigLoaded' );
 		}
@@ -125,5 +125,5 @@
 
 		// Load language file.
-		loadLang( editor );
+		loadSkin( editor );
 	};
 
@@ -247,5 +247,5 @@
 						// Load the editor skin.
 						editor.fire( 'pluginsLoaded' );
-						loadSkin( editor );
+						loadTheme( editor );
 					});
 			});
@@ -256,5 +256,5 @@
 		CKEDITOR.skins.load( editor, 'editor', function()
 			{
-				loadTheme( editor );
+				loadLang( editor );
 			});
 	};
@@ -651,8 +651,13 @@
 			if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
 			{
+				var data = this.getData();
+
+				if( this.config.htmlEncodeOutput )
+					data = CKEDITOR.tools.htmlEncode( data );
+
 				if ( element.is( 'textarea' ) )
-					element.setValue( this.getData() );
+					element.setValue( data );
 				else
-					element.setHtml( this.getData() );
+					element.setHtml( data );
 			}
 		}
@@ -671,2 +676,12 @@
 		}
 	});
+
+/**
+ * Whether escape HTML when editor update original input element.
+ * @name CKEDITOR.config.htmlEncodeOutput
+ * @type {Boolean}
+ * @default false
+ * @example
+ * config.htmlEncodeOutput = true;
+ */
+
Index: /CKEditor/trunk/_source/core/htmlparser/basicwriter.js
===================================================================
--- /CKEditor/trunk/_source/core/htmlparser/basicwriter.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/htmlparser/basicwriter.js	(revision 4774)
@@ -118,4 +118,5 @@
 		{
 			this._.output = [];
+			this._.indent = false;
 		},
 
Index: /CKEditor/trunk/_source/core/htmlparser/cdata.js
===================================================================
--- /CKEditor/trunk/_source/core/htmlparser/cdata.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/htmlparser/cdata.js	(revision 4774)
@@ -20,5 +20,4 @@
 		 */
 		this.value = value;
-
 	};
 
Index: /CKEditor/trunk/_source/core/htmlparser/comment.js
===================================================================
--- /CKEditor/trunk/_source/core/htmlparser/comment.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/htmlparser/comment.js	(revision 4774)
@@ -1,3 +1,3 @@
-﻿/*
+/*
 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
@@ -45,9 +45,10 @@
 		if ( filter )
 		{
-			if ( !( comment = filter.onComment( comment ) ) )
+			if ( !( comment = filter.onComment( comment, this ) ) )
 				return;
 
 			if ( typeof comment != 'string' )
 			{
+				comment.parent = this.parent;
 				comment.writeHtml( writer, filter );
 				return;
Index: /CKEditor/trunk/_source/core/htmlparser/element.js
===================================================================
--- /CKEditor/trunk/_source/core/htmlparser/element.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/htmlparser/element.js	(revision 4774)
@@ -1,3 +1,3 @@
-﻿/*
+/*
 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
@@ -26,5 +26,5 @@
 	 * @example
 	 */
-	this.attributes = attributes;
+	this.attributes = attributes || ( attributes = {} );
 
 	/**
@@ -35,6 +35,8 @@
 	this.children = [];
 
+	var tagName = attributes._cke_real_element_type || name;
+
 	var dtd			= CKEDITOR.dtd,
-		isBlockLike	= !!( dtd.$block[ name ] || dtd.$listItem[ name ] || dtd.$tableContent[ name ] || dtd.$nonEditable[ name ] || name == 'br' ),
+		isBlockLike	= !!( dtd.$nonBodyContent[ tagName ] || dtd.$block[ tagName ] || dtd.$listItem[ tagName ] || dtd.$tableContent[ tagName ] || dtd.$nonEditable[ tagName ] || tagName == 'br' ),
 		isEmpty		= !!dtd.$empty[ name ];
 
@@ -100,16 +102,25 @@
 			var attributes = this.attributes;
 
-			// The "_cke_replacedata" indicates that this element is replacing
-			// a data snippet, which should be outputted as is.
-			if ( attributes._cke_replacedata )
-			{
-				writer.write( attributes._cke_replacedata );
-				return;
-			}
-
 			// Ignore cke: prefixes when writing HTML.
 			var element = this,
 				writeName = element.name,
-				a, value;
+				a, newAttrName, value;
+
+			var isChildrenFiltered;
+
+			/**
+			 * Providing an option for bottom-up filtering order ( element
+			 * children to be pre-filtered before the element itself ).
+			 */
+			element.filterChildren = function()
+			{
+				if( !isChildrenFiltered )
+				{
+					var writer = new CKEDITOR.htmlParser.basicWriter();
+					CKEDITOR.htmlParser.fragment.prototype.writeChildrenHtml.call( element, writer, filter );
+					element.children = new CKEDITOR.htmlParser.fragment.fromHtml( writer.getHtml() ).children;
+					isChildrenFiltered = 1;
+				}
+			};
 
 			if ( filter )
@@ -125,11 +136,24 @@
 						return;
 
+					element.parent = this.parent;
+
 					if ( element.name == writeName )
 						break;
 
+					// If the element has been replaced with something of a
+					// different type, then make the replacement write itself.
+					if ( element.type != CKEDITOR.NODE_ELEMENT )
+					{
+						element.writeHtml( writer, filter );
+						return;
+					}
+
 					writeName = element.name;
-					if ( !writeName )	// Send children.
+
+					// This indicate that the element has been dropped by
+					// filter but not the children.
+					if ( !writeName )
 					{
-						CKEDITOR.htmlParser.fragment.prototype.writeHtml.apply( element, arguments );
+						this.writeChildrenHtml.call( element, writer, isChildrenFiltered ? null : filter );
 						return;
 					}
@@ -144,39 +168,53 @@
 			writer.openTag( writeName, attributes );
 
-			if ( writer.sortAttributes )
-			{
-				// Copy all attributes to an array.
-				var attribsArray = [];
+			// Copy all attributes to an array.
+			var attribsArray = [];
+			// Iterate over the attributes twice since filters may alter
+			// other attributes.
+			for( var i = 0 ; i < 2; i++ )
+			{
 				for ( a in attributes )
 				{
+					newAttrName = a;
 					value = attributes[ a ];
-
-					if ( filter && ( !( a = filter.onAttributeName( a ) ) || ( value = filter.onAttribute( element, a, value ) ) === false ) )
-						continue;
-
-					attribsArray.push( [ a, value ] );
+					if( i == 1 )
+						attribsArray.push( [ a, value ] );
+					else if ( filter )
+					{
+						while ( true )
+						{
+							if ( !( newAttrName = filter.onAttributeName( a ) ) )
+							{
+								delete attributes[ a ];
+								break;
+							}
+							else if( newAttrName != a )
+							{
+								delete attributes[ a ];
+								a = newAttrName; 
+								continue;
+							}
+							else
+								break;
+						}
+						if( newAttrName )
+						{
+							if( ( value = filter.onAttribute( element, newAttrName, value ) ) === false )
+								delete attributes[ newAttrName ];
+							else
+								attributes [ newAttrName ] = value;
+						}
+					}
 				}
-
-				// Sort the attributes by name.
+			}
+			// Sort the attributes by name.
+			if ( writer.sortAttributes )
 				attribsArray.sort( sortAttribs );
 
-				// Send the attributes.
-				for ( var i = 0, len = attribsArray.length ; i < len ; i++ )
-				{
-					var attrib = attribsArray[ i ];
-					writer.attribute( attrib[0], attrib[1] );
-				}
-			}
-			else
-			{
-				for ( a in attributes )
-				{
-					value = attributes[ a ];
-
-					if ( filter && ( !( a = filter.onAttributeName( a ) ) || ( value = filter.onAttribute( element, a, value ) ) === false ) )
-						continue;
-
-					writer.attribute( a, value );
-				}
+			// Send the attributes.
+			for ( i = 0, len = attribsArray.length ; i < len ; i++ )
+			{
+				var attrib = attribsArray[ i ];
+				writer.attribute( attrib[0], attrib[1] );
 			}
 
@@ -186,10 +224,15 @@
 			if ( !element.isEmpty )
 			{
-				// Send children.
-				CKEDITOR.htmlParser.fragment.prototype.writeHtml.apply( element, arguments );
-
+				this.writeChildrenHtml.call( element, writer, isChildrenFiltered ? null : filter );
 				// Close the element.
 				writer.closeTag( writeName );
 			}
+		},
+
+		writeChildrenHtml : function( writer, filter )
+		{
+			// Send children.
+			CKEDITOR.htmlParser.fragment.prototype.writeChildrenHtml.apply( this, arguments );
+
 		}
 	};
Index: /CKEditor/trunk/_source/core/htmlparser/filter.js
===================================================================
--- /CKEditor/trunk/_source/core/htmlparser/filter.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/htmlparser/filter.js	(revision 4774)
@@ -46,4 +46,7 @@
 				// Add the comment.
 				this._.comment = transformNamedItem( this._.comment, rules.comment, priority ) || this._.comment;
+
+				// Add root fragment.
+				this._.root = transformNamedItem( this._.root, rules.root, priority ) || this._.root;
 			},
 
@@ -64,8 +67,14 @@
 			},
 
-			onComment : function( commentText )
+			onComment : function( commentText, comment )
 			{
 				var textFilter = this._.comment;
-				return textFilter ? textFilter.filter( commentText ) : commentText;
+				return textFilter ? textFilter.filter( commentText, comment ) : commentText;
+			},
+
+			onFragment : function( element )
+			{
+				var rootFilter = this._.root;
+				return rootFilter ? rootFilter.filter( element ) : element;
 			},
 
@@ -75,8 +84,8 @@
 				// well as those set to the generic $ name. So, add both to an
 				// array and process them in a small loop.
-				var filters = [ this._.elements[ element.name ], this._.elements.$ ],
+				var filters = [ this._.elements[ '^' ], this._.elements[ element.name ], this._.elements.$ ],
 					filter, ret;
 
-				for ( var i = 0 ; i < 2 ; i++ )
+				for ( var i = 0 ; i < 3 ; i++ )
 				{
 					filter = filters[ i ];
@@ -89,9 +98,23 @@
 
 						if ( ret && ret != element )
-							return this.onElement( ret );
+							return this.onNode( ret );
+
+						// The non-root element has been dismissed by one of the filters.
+						if ( element.parent && !element.name )
+							break;
 					}
 				}
 
 				return element;
+			},
+
+			onNode : function( node )
+			{
+				var type = node.type;
+				
+				return type == CKEDITOR.NODE_ELEMENT ? this.onElement( node ) :
+					type == CKEDITOR.NODE_TEXT ? new CKEDITOR.htmlParser.text( this.onText( node.value ) ) :
+					type == CKEDITOR.NODE_COMMENT ? new CKEDITOR.htmlParser.comment( this.onComment( node.value ) ):
+					null;
 			},
 
@@ -145,6 +168,9 @@
 			{
 				var item = items[ j ];
-				item.pri = priority;
-				list.splice( i, 0, item );
+				if ( item )
+				{
+					item.pri = priority;
+					list.splice( i, 0, item );
+				}
 			}
 		}
Index: /CKEditor/trunk/_source/core/htmlparser/fragment.js
===================================================================
--- /CKEditor/trunk/_source/core/htmlparser/fragment.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/htmlparser/fragment.js	(revision 4774)
@@ -115,5 +115,7 @@
 				else
 					elementName =  element.name;
-				if ( !( elementName in CKEDITOR.dtd.$body ) )
+				if ( elementName
+						&& !( elementName in CKEDITOR.dtd.$body )
+						&& !( elementName in CKEDITOR.dtd.$nonBodyContent )  )
 				{
 					var savedCurrent = currentNode;
@@ -180,19 +182,19 @@
 			}
 
-			var currentName = currentNode.name,
-				currentDtd = ( currentName && CKEDITOR.dtd[ currentName ] ) || ( currentNode._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span );
+			var currentName = currentNode.name;
+
+			var currentDtd = currentName
+				&& ( CKEDITOR.dtd[ currentName ]
+					|| ( currentNode._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span ) );
 
 			// If the element cannot be child of the current element.
-			if ( !element.isUnknown && !currentNode.isUnknown && !currentDtd[ tagName ] )
-			{
-				// If this is the fragment node, just ignore this tag and add
-				// its children.
-				if ( !currentName )
-					return;
+			if ( currentDtd   // Fragment could receive any elements.
+				 && !element.isUnknown && !currentNode.isUnknown && !currentDtd[ tagName ] )
+			{
 
 				var reApply = false,
 					addPoint;   // New position to start adding nodes.
 
-				// Fixing malformed nested lists(#3828).
+				// Fixing malformed nested lists by moving it into a previous list item. (#3828)
 				if( tagName in listBlocks
 					&& currentName in listBlocks )
@@ -200,10 +202,10 @@
 					var children = currentNode.children,
 						lastChild = children[ children.length - 1 ];
-					// Move inner list into to previous list item if any.
-					if( lastChild && lastChild.name in listItems )
-						returnPoint = currentNode, addPoint = lastChild;
-					// Move inner list outside in the worst case.
-					else
-						addElement( currentNode, currentNode.parent );
+
+					// Establish the list item if it's not existed.
+					if ( !( lastChild && lastChild.name in listItems ) )
+						addElement( ( lastChild = new CKEDITOR.htmlParser.element( 'li' ) ), currentNode );
+
+					returnPoint = currentNode, addPoint = lastChild;
 				}
 				// If the element name is the same as the current element name,
@@ -277,12 +279,14 @@
 
 			var pendingAdd = [],
+				newPendingInline = [],
 				candidate = currentNode;
 
 			while ( candidate.type && candidate.name != tagName )
 			{
-				// If this is an inline element, add it to the pending list, so
-				// it will continue after the closing tag.
+				// If this is an inline element, add it to the pending list, if we're
+				// really closing one of the parents element later, they will continue
+				// after it.
 				if ( !candidate._.isBlockLike )
-					pendingInline.unshift( candidate );
+					newPendingInline.unshift( candidate );
 
 				// This node should be added to it's parent at this point. But,
@@ -314,5 +318,10 @@
 				if ( candidate == currentNode )
 					currentNode = currentNode.parent;
-			}
+
+				pendingInline = pendingInline.concat( newPendingInline );
+			}
+
+			if( tagName == 'body' )
+				fixForBody = false;
 		};
 
@@ -330,6 +339,10 @@
 			checkPending();
 
-			if ( fixForBody && !currentNode.type )
+			if ( fixForBody
+				 && ( !currentNode.type || currentNode.name == 'body' )
+				 && CKEDITOR.tools.trim( text ) )
+			{
 				this.onTagOpen( fixForBody, {} );
+			}
 
 			// Shrinking consequential spaces into one single for all elements
@@ -360,5 +373,7 @@
 				node = currentNode;
 
-			if ( fixForBody && !parent.type && !CKEDITOR.dtd.$body[ node.name ] )
+			if ( fixForBody
+				 && ( !parent.type || parent.name == 'body' )
+				 && !CKEDITOR.dtd.$body[ node.name ] )
 			{
 				currentNode = parent;
@@ -429,5 +444,23 @@
 		writeHtml : function( writer, filter )
 		{
-			for ( var i = 0, len = this.children.length ; i < len ; i++ )
+			var isChildrenFiltered;
+			this.filterChildren = function()
+			{
+				var writer = new CKEDITOR.htmlParser.basicWriter();
+				this.writeChildrenHtml.call( this, writer, filter, true );
+				var html = writer.getHtml();
+				this.children = new CKEDITOR.htmlParser.fragment.fromHtml( html ).children;
+				isChildrenFiltered = 1;
+			};
+
+			// Filtering the root fragment before anything else.
+			!this.name && filter && filter.onFragment( this );
+
+			this.writeChildrenHtml( writer, isChildrenFiltered ? null : filter );
+		},
+
+		writeChildrenHtml : function( writer, filter )
+		{
+			for ( var i = 0 ; i < this.children.length ; i++ )
 				this.children[i].writeHtml( writer, filter );
 		}
Index: /CKEditor/trunk/_source/core/loader.js
===================================================================
--- /CKEditor/trunk/_source/core/loader.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/loader.js	(revision 4774)
@@ -24,5 +24,5 @@
 		var scripts =
 		{
-			'core/_bootstrap'		: [ 'core/config', 'core/ckeditor', 'core/plugins', 'core/scriptloader', 'core/tools', /* The following are entries that we want to force loading at the end to avoid dependence recursion */ 'core/dom/elementpath', 'core/dom/text', 'core/dom/range' ],
+			'core/_bootstrap'		: [ 'core/config', 'core/ckeditor', 'core/plugins', 'core/scriptloader', 'core/tools', /* The following are entries that we want to force loading at the end to avoid dependence recursion */ 'core/dom/comment', 'core/dom/elementpath', 'core/dom/text', 'core/dom/range' ],
 			'core/ajax'				: [ 'core/xml' ],
 			'core/ckeditor'			: [ 'core/ckeditor_basic', 'core/dom', 'core/dtd', 'core/dom/document', 'core/dom/element', 'core/editor', 'core/event', 'core/htmlparser', 'core/htmlparser/element', 'core/htmlparser/fragment', 'core/htmlparser/filter', 'core/htmlparser/basicwriter', 'core/tools' ],
@@ -32,4 +32,5 @@
 			'core/config'			: [ 'core/ckeditor_base' ],
 			'core/dom'				: [],
+			'core/dom/comment'		: [ 'core/dom/node' ],
 			'core/dom/document'		: [ 'core/dom', 'core/dom/domobject', 'core/dom/window' ],
 			'core/dom/documentfragment'	: [ 'core/dom/element' ],
Index: /CKEditor/trunk/_source/core/resourcemanager.js
===================================================================
--- /CKEditor/trunk/_source/core/resourcemanager.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/resourcemanager.js	(revision 4774)
@@ -87,5 +87,6 @@
 			throw '[CKEDITOR.resourceManager.add] The resource name "' + name + '" is already registered.';
 
-		this.registered[ name ] = definition || {};
+		CKEDITOR.fire( name + CKEDITOR.tools.capitalize( this.fileName ) + 'Ready',
+				this.registered[ name ] = definition || {} );
 	},
 
Index: /CKEditor/trunk/_source/core/scriptloader.js
===================================================================
--- /CKEditor/trunk/_source/core/scriptloader.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/scriptloader.js	(revision 4774)
@@ -1,3 +1,3 @@
-﻿/*
+/*
 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
@@ -52,5 +52,5 @@
 		 *     });
 		 */
-		load : function( scriptUrl, callback, scope, noCheck )
+		load : function( scriptUrl, callback, scope, noCheck, showBusy )
 		{
 			var isString = ( typeof scriptUrl == 'string' );
@@ -88,5 +88,8 @@
 
 				if ( --scriptCount <= 0 )
+				{
+					showBusy && CKEDITOR.document.getDocumentElement().removeStyle( 'cursor' );
 					doCallback( success );
+				}
 			};
 
@@ -168,4 +171,5 @@
 			};
 
+			showBusy && CKEDITOR.document.getDocumentElement().setStyle( 'cursor', 'wait' );
 			for ( var i = 0 ; i < scriptCount ; i++ )
 			{
Index: /CKEditor/trunk/_source/core/skins.js
===================================================================
--- /CKEditor/trunk/_source/core/skins.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/skins.js	(revision 4774)
@@ -21,9 +21,18 @@
 	var paths = {};
 
-	var loadedPart = function( skinName, part, callback )
+	var loadPart = function( editor, skinName, part, callback )
 	{
 		// Get the skin definition.
 		var skinDefinition = loaded[ skinName ];
 
+		if ( !editor.skin )
+		{
+			editor.skin = skinDefinition;
+
+			// Trigger init function if any.
+			if ( skinDefinition.init )
+				skinDefinition.init( editor );
+		}
+
 		var appendSkinPath = function( fileNames )
 		{
@@ -34,4 +43,16 @@
 		};
 
+		function fixCSSTextRelativePath( cssStyleText, baseUrl )
+		{
+			return cssStyleText.replace( /url\s*\(([\s'"]*)(.*?)([\s"']*)\)/g,
+					function( match, opener, path, closer )
+					{
+						if ( /^\/|^\w?:/.test( path ) )
+							return match;
+						else
+							return 'url(' + baseUrl + opener +  path + closer + ')';
+					} );
+		}
+		
 		// Check if we need to preload images from it.
 		if ( !preloaded[ skinName ] )
@@ -44,5 +65,5 @@
 					{
 						preloaded[ skinName ] = 1;
-						loadedPart( skinName, part, callback );
+						loadPart( editor, skinName, part, callback );
 					} );
 				return;
@@ -97,9 +118,22 @@
 			if ( !cssIsLoaded )
 			{
-				appendSkinPath( part.css );
-
-				for ( var c = 0 ; c < part.css.length ; c++ )
-					CKEDITOR.document.appendStyleSheet( part.css[ c ] );
-
+				var cssPart = part.css;
+
+				if ( CKEDITOR.tools.isArray( cssPart ) )
+				{
+					appendSkinPath( cssPart );
+					for ( var c = 0 ; c < cssPart.length ; c++ )
+						CKEDITOR.document.appendStyleSheet( cssPart[ c ] );
+				}
+				else
+				{
+					cssPart = fixCSSTextRelativePath(
+								cssPart, CKEDITOR.getUrl( paths[ skinName ] ) );
+					// Processing Inline CSS part.
+					CKEDITOR.document.appendStyleText( cssPart );
+				}
+
+				part.css = cssPart;
+				
 				cssIsLoaded = 1;
 			}
@@ -157,14 +191,5 @@
 
 			if ( loaded[ skinName ] )
-			{
-				loadedPart( skinName, skinPart, callback );
-
-				// Get the skin definition.
-				var skinDefinition = loaded[ skinName ];
-
-				// Trigger init function if any.
-				if ( skinDefinition.init )
-					skinDefinition.init( editor );
-			}
+				loadPart( editor, skinName, skinPart, callback );
 			else
 			{
@@ -172,12 +197,5 @@
 				CKEDITOR.scriptLoader.load( skinPath + 'skin.js', function()
 						{
-							loadedPart( skinName, skinPart, callback );
-
-							// Get the skin definition.
-							var skinDefinition = loaded[ skinName ];
-
-							// Trigger init function if any.
-							if ( skinDefinition.init )
-								skinDefinition.init( editor );
+							 loadPart( editor, skinName, skinPart, callback );
 						});
 			}
Index: /CKEditor/trunk/_source/core/tools.js
===================================================================
--- /CKEditor/trunk/_source/core/tools.js	(revision 4773)
+++ /CKEditor/trunk/_source/core/tools.js	(revision 4774)
@@ -1,3 +1,3 @@
-﻿/*
+/*
 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
@@ -97,5 +97,6 @@
 				|| ( obj instanceof Number )
 				|| ( obj instanceof Boolean )
-				|| ( obj instanceof Date ) )
+				|| ( obj instanceof Date )
+				|| ( obj instanceof RegExp) )
 			{
 				return obj;
@@ -112,4 +113,13 @@
 
 			return clone;
+		},
+
+		/**
+		 * Turn the first letter of string to upper-case.
+		 * @param {String} str
+		 */
+		capitalize: function( str )
+		{
+			return str.charAt( 0 ).toUpperCase() + str.substring( 1 ).toLowerCase();
 		},
 
@@ -246,4 +256,25 @@
 
 		/**
+		 * Build the HTML snippet of a set of <style>/<link>.
+		 * @param css {String|Array} Each of which are url (absolute) of a CSS file or
+		 * a trunk of style text.
+		 */
+		buildStyleHtml : function ( css )
+		{
+			css = [].concat( css );
+			var item, retval = [];
+			for ( var i = 0; i < css.length; i++ )
+			{
+				item = css[ i ];
+				// Is CSS style text ?
+				if ( /@import|[{}]/.test(item) )
+					retval.push('<style>' + item + '</style>');
+				else
+					retval.push('<link type="text/css" rel=stylesheet href="' + item + '">');
+			}
+			return retval.join( '' );
+		},
+
+		/**
 		 * Replace special HTML characters in a string with their relative HTML
 		 * entity values.
@@ -622,4 +653,20 @@
 		{
 			return new Array( times + 1 ).join( str );
+		},
+
+		tryThese : function()
+		{
+			var returnValue;
+			for ( var i = 0, length = arguments.length; i < length; i++ )
+			{
+				var lambda = arguments[i];
+				try
+				{
+					returnValue = lambda();
+					break;
+				}
+				catch (e) {}
+			}
+			return returnValue;
 		}
 	};
Index: /CKEditor/trunk/_source/lang/_translationstatus.txt
===================================================================
--- /CKEditor/trunk/_source/lang/_translationstatus.txt	(revision 4773)
+++ /CKEditor/trunk/_source/lang/_translationstatus.txt	(revision 4774)
@@ -2,58 +2,58 @@
 For licensing, see LICENSE.html or http://ckeditor.com/license
 
-af.js      Found: 305 Missing: 172
-ar.js      Found: 475 Missing: 2
-bg.js      Found: 298 Missing: 179
-bn.js      Found: 300 Missing: 177
-bs.js      Found: 203 Missing: 274
-ca.js      Found: 428 Missing: 49
-cs.js      Found: 435 Missing: 42
-da.js      Found: 428 Missing: 49
-de.js      Found: 468 Missing: 9
-el.js      Found: 304 Missing: 173
-en-au.js   Found: 388 Missing: 89
-en-ca.js   Found: 388 Missing: 89
-en-uk.js   Found: 388 Missing: 89
-eo.js      Found: 275 Missing: 202
-es.js      Found: 428 Missing: 49
-et.js      Found: 319 Missing: 158
-eu.js      Found: 428 Missing: 49
-fa.js      Found: 320 Missing: 157
-fi.js      Found: 435 Missing: 42
-fo.js      Found: 319 Missing: 158
-fr-ca.js   Found: 320 Missing: 157
-fr.js      Found: 427 Missing: 50
-gl.js      Found: 301 Missing: 176
-gu.js      Found: 319 Missing: 158
-he.js      Found: 437 Missing: 40
-hi.js      Found: 320 Missing: 157
-hr.js      Found: 428 Missing: 49
-hu.js      Found: 319 Missing: 158
-is.js      Found: 325 Missing: 152
-it.js      Found: 427 Missing: 50
-ja.js      Found: 437 Missing: 40
-km.js      Found: 294 Missing: 183
-ko.js      Found: 311 Missing: 166
-lt.js      Found: 324 Missing: 153
-lv.js      Found: 301 Missing: 176
-mn.js      Found: 319 Missing: 158
-ms.js      Found: 280 Missing: 197
-nb.js      Found: 435 Missing: 42
-nl.js      Found: 435 Missing: 42
-no.js      Found: 435 Missing: 42
-pl.js      Found: 435 Missing: 42
-pt-br.js   Found: 427 Missing: 50
-pt.js      Found: 300 Missing: 177
-ro.js      Found: 319 Missing: 158
-ru.js      Found: 325 Missing: 152
-sk.js      Found: 320 Missing: 157
-sl.js      Found: 318 Missing: 159
-sr-latn.js Found: 294 Missing: 183
-sr.js      Found: 294 Missing: 183
-sv.js      Found: 317 Missing: 160
-th.js      Found: 305 Missing: 172
-tr.js      Found: 325 Missing: 152
-uk.js      Found: 428 Missing: 49
-vi.js      Found: 428 Missing: 49
-zh-cn.js   Found: 428 Missing: 49
-zh.js      Found: 428 Missing: 49
+af.js      Found: 302 Missing: 187
+ar.js      Found: 473 Missing: 16
+bg.js      Found: 295 Missing: 194
+bn.js      Found: 297 Missing: 192
+bs.js      Found: 203 Missing: 286
+ca.js      Found: 426 Missing: 63
+cs.js      Found: 433 Missing: 56
+da.js      Found: 426 Missing: 63
+de.js      Found: 466 Missing: 23
+el.js      Found: 301 Missing: 188
+en-au.js   Found: 385 Missing: 104
+en-ca.js   Found: 385 Missing: 104
+en-uk.js   Found: 385 Missing: 104
+eo.js      Found: 275 Missing: 214
+es.js      Found: 426 Missing: 63
+et.js      Found: 316 Missing: 173
+eu.js      Found: 426 Missing: 63
+fa.js      Found: 317 Missing: 172
+fi.js      Found: 432 Missing: 57
+fo.js      Found: 316 Missing: 173
+fr-ca.js   Found: 317 Missing: 172
+fr.js      Found: 425 Missing: 64
+gl.js      Found: 298 Missing: 191
+gu.js      Found: 316 Missing: 173
+he.js      Found: 435 Missing: 54
+hi.js      Found: 317 Missing: 172
+hr.js      Found: 426 Missing: 63
+hu.js      Found: 316 Missing: 173
+is.js      Found: 322 Missing: 167
+it.js      Found: 425 Missing: 64
+ja.js      Found: 435 Missing: 54
+km.js      Found: 291 Missing: 198
+ko.js      Found: 308 Missing: 181
+lt.js      Found: 321 Missing: 168
+lv.js      Found: 298 Missing: 191
+mn.js      Found: 316 Missing: 173
+ms.js      Found: 280 Missing: 209
+nb.js      Found: 432 Missing: 57
+nl.js      Found: 433 Missing: 56
+no.js      Found: 432 Missing: 57
+pl.js      Found: 433 Missing: 56
+pt-br.js   Found: 425 Missing: 64
+pt.js      Found: 297 Missing: 192
+ro.js      Found: 316 Missing: 173
+ru.js      Found: 322 Missing: 167
+sk.js      Found: 317 Missing: 172
+sl.js      Found: 315 Missing: 174
+sr-latn.js Found: 291 Missing: 198
+sr.js      Found: 291 Missing: 198
+sv.js      Found: 314 Missing: 175
+th.js      Found: 302 Missing: 187
+tr.js      Found: 322 Missing: 167
+uk.js      Found: 426 Missing: 63
+vi.js      Found: 426 Missing: 63
+zh-cn.js   Found: 426 Missing: 63
+zh.js      Found: 426 Missing: 63
Index: /CKEditor/trunk/_source/lang/af.js
===================================================================
--- /CKEditor/trunk/_source/lang/af.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/af.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Van Word af byvoeg',
 		title : 'Van Word af byvoeg',
-		advice : 'Voeg asseblief die inhoud in die gegewe box by met sleutel kombenasie(<STRONG>Ctrl+V</STRONG>) en druk <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignoreer karakter soort defenisies',
-		removeStyle : 'Verweider Styl defenisies'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normaal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/ar.js
===================================================================
--- /CKEditor/trunk/_source/lang/ar.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/ar.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'يبدو أن النص المراد لصقه منسوخ من برنامج وورد. هل تود تنظيفه قبل الشروع في عملية اللصق؟',
 		toolbar : 'لصق من وورد',
 		title : 'لصق من وورد',
-		advice : 'الصق داخل الصندوق بإستخدام مفاتيح (<STRONG>Ctrl+V</STRONG>) في لوحة المفاتيح، ثم اضغط مفتاح <STRONG>موافق</STRONG>.',
-		ignoreFontFace : 'تجاهل تعريفات أسماء الخطوط',
-		removeStyle : 'إزالة تعريفات الأنماط'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'عادي (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/bg.js
===================================================================
--- /CKEditor/trunk/_source/lang/bg.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/bg.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Вмъкни от MS Word',
 		title : 'Вмъкни от MS Word',
-		advice : 'Вмъкнете тук съдъжанието с клавиатуарата (<STRONG>Ctrl+V</STRONG>) и натиснете <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Игнорирай шрифтовите дефиниции',
-		removeStyle : 'Изтрий стиловите дефиниции'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Параграф (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/bn.js
===================================================================
--- /CKEditor/trunk/_source/lang/bn.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/bn.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'পেস্ট (শব্দ)',
 		title : 'পেস্ট (শব্দ)',
-		advice : 'অনুগ্রহ করে নীচের বাক্সে কিবোর্ড ব্যবহার করে (<STRONG>Ctrl+V</STRONG>) পেস্ট করুন এবং <STRONG>OK</STRONG> চাপ দিন',
-		ignoreFontFace : 'ফন্ট ফেস ডেফিনেশন ইগনোর করুন',
-		removeStyle : 'স্টাইল ডেফিনেশন সরিয়ে দিন'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'শীর্ষক (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/bs.js
===================================================================
--- /CKEditor/trunk/_source/lang/bs.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/bs.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Zalijepi iz Word-a',
 		title : 'Zalijepi iz Word-a',
-		advice : 'Please paste inside the following box using the keyboard (<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.', // MISSING
-		ignoreFontFace : 'Ignore Font Face definitions', // MISSING
-		removeStyle : 'Remove Styles definitions' // MISSING
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)' // MISSING
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/ca.js
===================================================================
--- /CKEditor/trunk/_source/lang/ca.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/ca.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'El text que voleu enganxar sembla provenir de Word. Voleu netejar aquest text abans que sigui enganxat?',
 		toolbar : 'Enganxa des del Word',
 		title : 'Enganxa des del Word',
-		advice : 'Si us plau, enganxeu dins del següent camp utilitzant el teclat (<STRONG>Ctrl+V</STRONG>) i premeu <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignora definicions de font',
-		removeStyle : 'Elimina definicions d\'estil'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/cs.js
===================================================================
--- /CKEditor/trunk/_source/lang/cs.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/cs.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'Jak je vidět, vkládaný text je kopírován z Wordu. Chcete jej před vložením vyčistit?',
 		toolbar : 'Vložit z Wordu',
 		title : 'Vložit z Wordu',
-		advice : 'Do následujícího pole vložte požadovaný obsah pomocí klávesnice (<STRONG>Ctrl+V</STRONG>) a stiskněte <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignorovat písmo',
-		removeStyle : 'Odstranit styly'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normální (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/da.js
===================================================================
--- /CKEditor/trunk/_source/lang/da.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/da.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'Den tekst du forsøger at indsætte ser ud til at komme fra Word. Vil du rense teksten før den indsættes?',
 		toolbar : 'Indsæt fra Word',
 		title : 'Indsæt fra Word',
-		advice : 'Indsæt i feltet herunder (<STRONG>Ctrl+V</STRONG>) og klik på <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignorér skrifttypedefinitioner',
-		removeStyle : 'Ignorér typografi'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/de.js
===================================================================
--- /CKEditor/trunk/_source/lang/de.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/de.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'Der Text, den Sie einfügen möchten, scheint aus MS-Word kopiert zu sein. Möchten Sie ihn zuvor bereinigen lassen?',
 		toolbar : 'aus MS-Word einfügen',
 		title : 'aus MS-Word einfügen',
-		advice : 'Bitte fügen Sie den Text in der folgenden Box über die Tastatur (mit <STRONG>Strg+V</STRONG>) ein und bestätigen Sie mit <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignoriere Schriftart-Definitionen',
-		removeStyle : 'Entferne Style-Definitionen'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/el.js
===================================================================
--- /CKEditor/trunk/_source/lang/el.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/el.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Επικόλληση από το Word',
 		title : 'Επικόλληση από το Word',
-		advice : 'Παρακαλώ επικολήστε στο ακόλουθο κουτί χρησιμοποιόντας το πληκτρολόγιο (<STRONG>Ctrl+V</STRONG>) και πατήστε <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Αγνόηση προδιαγραφών γραμματοσειράς',
-		removeStyle : 'Αφαίρεση προδιαγραφών στύλ'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)' // MISSING
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/en-au.js
===================================================================
--- /CKEditor/trunk/_source/lang/en-au.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/en-au.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Paste from Word',
 		title : 'Paste from Word',
-		advice : 'Please paste inside the following box using the keyboard (<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.',
-		ignoreFontFace : 'Ignore Font Face definitions',
-		removeStyle : 'Remove Styles definitions'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/en-ca.js
===================================================================
--- /CKEditor/trunk/_source/lang/en-ca.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/en-ca.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Paste from Word',
 		title : 'Paste from Word',
-		advice : 'Please paste inside the following box using the keyboard (<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.',
-		ignoreFontFace : 'Ignore Font Face definitions',
-		removeStyle : 'Remove Styles definitions'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/en-uk.js
===================================================================
--- /CKEditor/trunk/_source/lang/en-uk.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/en-uk.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Paste from Word',
 		title : 'Paste from Word',
-		advice : 'Please paste inside the following box using the keyboard (<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.',
-		ignoreFontFace : 'Ignore Font Face definitions',
-		removeStyle : 'Remove Styles definitions'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/en.js
===================================================================
--- /CKEditor/trunk/_source/lang/en.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/en.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?',
 		toolbar : 'Paste from Word',
 		title : 'Paste from Word',
-		advice : 'Please paste inside the following box using the keyboard (<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.',
-		ignoreFontFace : 'Ignore Font Face definitions',
-		removeStyle : 'Remove Styles definitions'
+		error : 'It was not possible to clean up the pasted data due to an internal error'
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container',
+		toolbar				: 'Create Div Container',
+		cssClassInputLabel	: 'Stylesheet Classes',
+		styleSelectLabel	: 'Style',
+		IdInputLabel		: 'Id',
+		languageCodeInputLabel	: ' Language Code',
+		inlineStyleInputLabel	: 'Inline Style',
+		advisoryTitleInputLabel	: 'Advisory Title',
+		langDirLabel		: 'Language Direction',
+		langDirLTRLabel		: 'Left to Right (LTR)',
+		langDirRTLLabel		: 'Right to Left (RTL)',
+		edit				: 'Edit Div',
+		remove				: 'Remove Div'
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/eo.js
===================================================================
--- /CKEditor/trunk/_source/lang/eo.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/eo.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Interglui el Word',
 		title : 'Interglui el Word',
-		advice : 'Please paste inside the following box using the keyboard (<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.', // MISSING
-		ignoreFontFace : 'Ignore Font Face definitions', // MISSING
-		removeStyle : 'Remove Styles definitions' // MISSING
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Paragrafo (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/es.js
===================================================================
--- /CKEditor/trunk/_source/lang/es.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/es.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'El texto que desea parece provenir de Word. Desea depurarlo antes de pegarlo?',
 		toolbar : 'Pegar desde Word',
 		title : 'Pegar desde Word',
-		advice : 'Por favor pegue dentro del cuadro utilizando el teclado (<STRONG>Ctrl+V</STRONG>); luego presione <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignorar definiciones de fuentes',
-		removeStyle : 'Remover definiciones de estilo'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/et.js
===================================================================
--- /CKEditor/trunk/_source/lang/et.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/et.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Kleebi Wordist',
 		title : 'Kleebi Wordist',
-		advice : 'Palun kleebi järgnevasse kasti kasutades klaviatuuri klahvikombinatsiooni (<STRONG>Ctrl+V</STRONG>) ja vajuta seejärel <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignoreeri kirja definitsioone',
-		removeStyle : 'Eemalda stiilide definitsioonid'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Tavaline (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/eu.js
===================================================================
--- /CKEditor/trunk/_source/lang/eu.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/eu.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'Itsatsi nahi duzun testua Wordetik hartua dela dirudi. Itsatsi baino lehen garbitu nahi duzu?',
 		toolbar : 'Itsatsi Word-etik',
 		title : 'Itsatsi Word-etik',
-		advice : 'Mesedez teklatua erabilita (<STRONG>Ctrl+V</STRONG>) ondorego eremuan testua itsatsi eta <STRONG>OK</STRONG> sakatu.',
-		ignoreFontFace : 'Letra Motaren definizioa ezikusi',
-		removeStyle : 'Estilo definizioak kendu'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Paragrafoa (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/fa.js
===================================================================
--- /CKEditor/trunk/_source/lang/fa.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/fa.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'چسباندن از Word',
 		title : 'چسباندن از Word',
-		advice : 'لطفا متن را با کلیدهای (<STRONG>Ctrl+V</STRONG>) در این جعبهٴ متنی بچسبانید و <STRONG>پذیرش</STRONG> را بزنید.',
-		ignoreFontFace : 'چشمپوشی از تعاریف نوع قلم',
-		removeStyle : 'چشمپوشی از تعاریف سبک (style)'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'بند'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/fi.js
===================================================================
--- /CKEditor/trunk/_source/lang/fi.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/fi.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Liitä Wordista',
 		title : 'Liitä Wordista',
-		advice : 'Liitä painamalla (<STRONG>Ctrl+V</STRONG>) ja painamalla <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Jätä huomioimatta fonttimääritykset',
-		removeStyle : 'Poista tyylimääritykset'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normaali (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/fo.js
===================================================================
--- /CKEditor/trunk/_source/lang/fo.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/fo.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Innrita frá Word',
 		title : 'Innrita frá Word',
-		advice : 'Vinarliga koyr tekstin í hendan rútin við knappaborðinum (<strong>CTRL+V</strong>) og klikk á <strong>Góðtak</strong>.',
-		ignoreFontFace : 'Forfjóna Font definitiónirnar',
-		removeStyle : 'Strika typografi definitiónir'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)' // MISSING
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/fr-ca.js
===================================================================
--- /CKEditor/trunk/_source/lang/fr-ca.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/fr-ca.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Coller en tant que Word (formaté)',
 		title : 'Coller en tant que Word (formaté)',
-		advice : 'Veuillez coller dans la zone ci-dessous en utilisant le clavier (<STRONG>Ctrl+V</STRONG>) et appuyer sur <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignorer les polices de caractères',
-		removeStyle : 'Supprimer les styles'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/fr.js
===================================================================
--- /CKEditor/trunk/_source/lang/fr.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/fr.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'Le texte à coller semble provenir de Word. Désirez-vous le nettoyer avant de coller?',
 		toolbar : 'Coller depuis Word',
 		title : 'Coller depuis Word',
-		advice : 'Veuillez coller le texte dans la zone suivante, en utilisant le raccourci clavier (<strong>Ctrl+V</strong>) et cliquez sur OK.',
-		ignoreFontFace : 'Supprimer la définition des polices',
-		removeStyle : 'Supprimer la définition des styles'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/gl.js
===================================================================
--- /CKEditor/trunk/_source/lang/gl.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/gl.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Pegar dende Word',
 		title : 'Pegar dende Word',
-		advice : 'Por favor, pegue dentro do seguinte cadro usando o teclado (<STRONG>Ctrl+V</STRONG>) e pulse <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignorar as definicións de Tipografía',
-		removeStyle : 'Eliminar as definicións de Estilos'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Paragraph (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/gu.js
===================================================================
--- /CKEditor/trunk/_source/lang/gu.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/gu.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'પેસ્ટ (વડૅ ટેક્સ્ટ)',
 		title : 'પેસ્ટ (વડૅ ટેક્સ્ટ)',
-		advice : 'Ctrl+V નો પ્રયોગ કરી પેસ્ટ કરો',
-		ignoreFontFace : 'ફૉન્ટફેસ વ્યાખ્યાની અવગણના',
-		removeStyle : 'સ્ટાઇલ વ્યાખ્યા કાઢી નાખવી'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'શીર્ષક (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/he.js
===================================================================
--- /CKEditor/trunk/_source/lang/he.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/he.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'נראה הטקסט שבכוונתך להדביק מקורו בקובץ וורד. האם ברצונך לנקות אותו טרם ההדבקה?',
 		toolbar : 'הדבקה מ-Word',
 		title : 'הדבקה מ-Word',
-		advice : 'נא להדביק בתוך הקופסה באמצעות (<STRONG>Ctrl+V</STRONG>) ולחץ על <STRONG>אישור</STRONG>.',
-		ignoreFontFace : 'התעלמות מהגדרות סוג פונט',
-		removeStyle : 'הסרת הגדרות סגנון'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'נורמלי (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/hi.js
===================================================================
--- /CKEditor/trunk/_source/lang/hi.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/hi.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'पेस्ट (वर्ड से)',
 		title : 'पेस्ट (वर्ड से)',
-		advice : 'Ctrl+V का प्रयोग करके पेस्ट करें और ठीक है करें.',
-		ignoreFontFace : 'फ़ॉन्ट परिभाषा निकालें',
-		removeStyle : 'स्टाइल परिभाषा निकालें'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'शीर्षक (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/hr.js
===================================================================
--- /CKEditor/trunk/_source/lang/hr.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/hr.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'Tekst koji želite zalijepiti čini se da je kopiran iz Worda. Želite li prije očistiti tekst?',
 		toolbar : 'Zalijepi iz Worda',
 		title : 'Zalijepi iz Worda',
-		advice : 'Molimo zaljepite unutar doljnjeg okvira koristeći tipkovnicu (<STRONG>Ctrl+V</STRONG>) i kliknite <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Zanemari definiciju vrste fonta',
-		removeStyle : 'Ukloni definicije stilova'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/hu.js
===================================================================
--- /CKEditor/trunk/_source/lang/hu.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/hu.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Beillesztés Word-ből',
 		title : 'Beillesztés Word-ből',
-		advice : 'Másolja be az alábbi mezőbe a <STRONG>Ctrl+V</STRONG> billentyűk lenyomásával, majd nyomjon <STRONG>Rendben</STRONG>-t.',
-		ignoreFontFace : 'Betű formázások megszüntetése',
-		removeStyle : 'Stílusok eltávolítása'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Bekezdés (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/is.js
===================================================================
--- /CKEditor/trunk/_source/lang/is.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/is.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Líma úr Word',
 		title : 'Líma úr Word',
-		advice : 'Límdu í svæðið hér að neðan og (<STRONG>Ctrl+V</STRONG>) og smelltu á <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Hunsa leturskilgreiningar',
-		removeStyle : 'Hunsa letureigindi'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Venjulegt (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/it.js
===================================================================
--- /CKEditor/trunk/_source/lang/it.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/it.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'Il testo da incollare sembra provenire da Word. Desideri pulirlo prima di incollare?',
 		toolbar : 'Incolla da Word',
 		title : 'Incolla da Word',
-		advice : 'Incolla il testo all\'interno dell\'area sottostante usando la scorciatoia di tastiere (<STRONG>Ctrl+V</STRONG>) e premi <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignora le definizioni di Font',
-		removeStyle : 'Rimuovi le definizioni di Stile'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Paragrafo (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/ja.js
===================================================================
--- /CKEditor/trunk/_source/lang/ja.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/ja.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : '貼り付けを行うテキストは、ワード文章からコピーされようとしています。貼り付ける前にクリーニングを行いますか？',
 		toolbar : 'ワード文章から貼り付け',
 		title : 'ワード文章から貼り付け',
-		advice : 'キーボード(<STRONG>Ctrl+V</STRONG>)を使用して、次の入力エリア内で貼って、<STRONG>OK</STRONG>を押してください。',
-		ignoreFontFace : 'FontタグのFace属性を無視します。',
-		removeStyle : 'スタイル定義を削除します。'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : '標準 (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/km.js
===================================================================
--- /CKEditor/trunk/_source/lang/km.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/km.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'ចំលងដាក់ពី Word',
 		title : 'ចំលងដាក់ពី Word',
-		advice : 'សូមចំលងអត្ថបទទៅដាក់ក្នុងប្រអប់ដូចខាងក្រោមដោយប្រើប្រាស់ ឃី \u200b(<STRONG>Ctrl+V</STRONG>) ហើយចុច <STRONG>OK</STRONG> ។',
-		ignoreFontFace : 'មិនគិតអំពីប្រភេទពុម្ភអក្សរ',
-		removeStyle : 'លប់ម៉ូត'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/ko.js
===================================================================
--- /CKEditor/trunk/_source/lang/ko.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/ko.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'MS Word 형식에서 붙여넣기',
 		title : 'MS Word 형식에서 붙여넣기',
-		advice : '키보드의 (<STRONG>Ctrl+V</STRONG>) 를 이용해서 상자안에 붙여넣고 <STRONG>OK</STRONG> 를 누르세요.',
-		ignoreFontFace : '폰트 설정 무시',
-		removeStyle : '스타일 정의 제거'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)' // MISSING
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/lt.js
===================================================================
--- /CKEditor/trunk/_source/lang/lt.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/lt.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Įdėti iš Word',
 		title : 'Įdėti iš Word',
-		advice : 'Žemiau esančiame įvedimo lauke įdėkite tekstą, naudodami klaviatūrą (<STRONG>Ctrl+V</STRONG>) ir paspauskite mygtuką <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignoruoti šriftų nustatymus',
-		removeStyle : 'Pašalinti stilių nustatymus'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)' // MISSING
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/lv.js
===================================================================
--- /CKEditor/trunk/_source/lang/lv.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/lv.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Ievietot no Worda',
 		title : 'Ievietot no Worda',
-		advice : 'Lūdzu, ievietojiet tekstu šajā laukumā, izmantojot klaviatūru (<STRONG>Ctrl+V</STRONG>) un apstipriniet ar <STRONG>Darīts!</STRONG>.',
-		ignoreFontFace : 'Ignorēt iepriekš norādītos fontus',
-		removeStyle : 'Noņemt norādītos stilus'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Rindkopa (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/mn.js
===================================================================
--- /CKEditor/trunk/_source/lang/mn.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/mn.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Word-оос буулгах',
 		title : 'Word-оос буулгах',
-		advice : '(<strong>Ctrl+V</strong>) товчийг ашиглан paste хийнэ үү. Мөн <strong>OK</strong> дар.',
-		ignoreFontFace : 'Тодорхойлогдсон Font Face зөвшөөрнө',
-		removeStyle : 'Тодорхойлогдсон загварыг авах'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Paragraph (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/ms.js
===================================================================
--- /CKEditor/trunk/_source/lang/ms.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/ms.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Tampal dari Word',
 		title : 'Tampal dari Word',
-		advice : 'Please paste inside the following box using the keyboard (<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.', // MISSING
-		ignoreFontFace : 'Ignore Font Face definitions', // MISSING
-		removeStyle : 'Remove Styles definitions' // MISSING
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Perenggan (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/nb.js
===================================================================
--- /CKEditor/trunk/_source/lang/nb.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/nb.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Lim inn fra Word',
 		title : 'Lim inn fra Word',
-		advice : 'Vennligst lim inn i den følgende boksen med tastaturet (<STRONG>Ctrl+V</STRONG>) og trykk <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Fjern skrifttyper',
-		removeStyle : 'Fjern stildefinisjoner'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/nl.js
===================================================================
--- /CKEditor/trunk/_source/lang/nl.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/nl.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'De tekst die u plakte lijkt gekopieerd te zijn vanuit Word. Wilt u de tekst opschonen voordat deze geplakt wordt?',
 		toolbar : 'Plakken als Word-gegevens',
 		title : 'Plakken als Word-gegevens',
-		advice : 'Plak de tekst in het volgende vak gebruik makend van uw toetsenbord (<strong>Ctrl+V</strong>) en klik op <strong>OK</strong>.',
-		ignoreFontFace : 'Negeer "Font Face"-definities',
-		removeStyle : 'Verwijder "Style"-definities'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normaal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/no.js
===================================================================
--- /CKEditor/trunk/_source/lang/no.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/no.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Lim inn fra Word',
 		title : 'Lim inn fra Word',
-		advice : 'Vennligst lim inn i den følgende boksen med tastaturet (<STRONG>Ctrl+V</STRONG>) og trykk <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Fjern skrifttyper',
-		removeStyle : 'Fjern stildefinisjoner'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/pl.js
===================================================================
--- /CKEditor/trunk/_source/lang/pl.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/pl.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'Tekst, który chcesz wkleić, prawdopodobnie pochodzi z programu Word. Czy chcesz go wyczyścic przed wklejeniem?',
 		toolbar : 'Wklej z Worda',
 		title : 'Wklej z Worda',
-		advice : 'Proszę wkleić w poniższym polu używając klawiaturowego skrótu (<STRONG>Ctrl+V</STRONG>) i kliknąć <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignoruj definicje \'Font Face\'',
-		removeStyle : 'Usuń definicje Stylów'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normalny (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/pt-br.js
===================================================================
--- /CKEditor/trunk/_source/lang/pt-br.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/pt-br.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'O texto que você deseja colar parece ter sido copiado do Word. Você gostaria de remover a formatação antes de colar?',
 		toolbar : 'Colar do Word',
 		title : 'Colar do Word',
-		advice : 'Transfira o link usado no box usando o teclado com (<STRONG>Ctrl+V</STRONG>) e <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignorar definições de fonte',
-		removeStyle : 'Remove definições de estilo'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/pt.js
===================================================================
--- /CKEditor/trunk/_source/lang/pt.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/pt.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Colar do Word',
 		title : 'Colar do Word',
-		advice : 'Por favor, cole dentro da seguinte caixa usando o teclado (<STRONG>Ctrl+V</STRONG>) e prima <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignorar da definições do Tipo de Letra ',
-		removeStyle : 'Remover as definições de Estilos'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)' // MISSING
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/ro.js
===================================================================
--- /CKEditor/trunk/_source/lang/ro.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/ro.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Adaugă din Word',
 		title : 'Adaugă din Word',
-		advice : 'Vă rugăm adăugaţi în căsuţa următoare folosind tastatura (<STRONG>Ctrl+V</STRONG>) şi apăsaţi <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignoră definiţiile Font Face',
-		removeStyle : 'Şterge definiţiile stilurilor'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/ru.js
===================================================================
--- /CKEditor/trunk/_source/lang/ru.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/ru.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Вставить из Word',
 		title : 'Вставить из Word',
-		advice : 'Пожалуйста, вставьте текст в прямоугольник, используя сочетание клавиш (<STRONG>Ctrl+V</STRONG>), и нажмите <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Игнорировать определения гарнитуры',
-		removeStyle : 'Убрать определения стилей'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Нормальный (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/sk.js
===================================================================
--- /CKEditor/trunk/_source/lang/sk.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/sk.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Vložiť z Wordu',
 		title : 'Vložiť z Wordu',
-		advice : 'Prosím vložte nasledovný rámček použitím klávesnice (<STRONG>Ctrl+V</STRONG>) a stlačte <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignorovať nastavenia typu písma',
-		removeStyle : 'Odstrániť formátovanie'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Odsek (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/sl.js
===================================================================
--- /CKEditor/trunk/_source/lang/sl.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/sl.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Prilepi iz Worda',
 		title : 'Prilepi iz Worda',
-		advice : 'Prosim prilepite v sleči okvir s pomočjo tipkovnice (<STRONG>Ctrl+V</STRONG>) in pritisnite <STRONG>V redu</STRONG>.',
-		ignoreFontFace : 'Prezri obliko pisave',
-		removeStyle : 'Odstrani nastavitve stila'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)' // MISSING
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/sr-latn.js
===================================================================
--- /CKEditor/trunk/_source/lang/sr-latn.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/sr-latn.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Zalepi iz Worda',
 		title : 'Zalepi iz Worda',
-		advice : 'Molimo Vas da zalepite unutar donje povrine koristeći tastaturnu prečicu (<STRONG>Ctrl+V</STRONG>) i da pritisnete <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignoriši definicije fontova',
-		removeStyle : 'Ukloni definicije stilova'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)' // MISSING
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/sr.js
===================================================================
--- /CKEditor/trunk/_source/lang/sr.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/sr.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Залепи из Worda',
 		title : 'Залепи из Worda',
-		advice : 'Молимо Вас да залепите унутар доње површине користећи тастатурну пречицу (<STRONG>Ctrl+V</STRONG>) и да притиснете <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Игнориши Font Face дефиниције',
-		removeStyle : 'Уклони дефиниције стилова'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)' // MISSING
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/sv.js
===================================================================
--- /CKEditor/trunk/_source/lang/sv.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/sv.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Klistra in från Word',
 		title : 'Klistra in från Word',
-		advice : 'Var god och klistra in Er text i rutan nedan genom att använda (<STRONG>Ctrl+V</STRONG>) klicka sen på <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ignorera typsnittsdefinitioner',
-		removeStyle : 'Radera Stildefinitioner'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/th.js
===================================================================
--- /CKEditor/trunk/_source/lang/th.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/th.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'วางสำเนาจากตัวอักษรเวิร์ด',
 		title : 'วางสำเนาจากตัวอักษรเวิร์ด',
-		advice : 'กรุณาใช้คีย์บอร์ดเท่านั้น โดยกดปุ๋ม (<strong>Ctrl และ V</strong>)พร้อมๆกัน และกด <strong>OK</strong>.',
-		ignoreFontFace : 'ไม่สนใจ Font Face definitions',
-		removeStyle : 'ลบ Styles definitions'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Paragraph (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/tr.js
===================================================================
--- /CKEditor/trunk/_source/lang/tr.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/tr.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING
 		toolbar : 'Word\'den Yapıştır',
 		title : 'Word\'den Yapıştır',
-		advice : 'Lütfen aşağıdaki kutunun içine yapıştırın. (<STRONG>Ctrl+V</STRONG>) ve <STRONG>Tamam</STRONG> butonunu tıklayın.',
-		ignoreFontFace : 'Yazı Tipi tanımlarını yoksay',
-		removeStyle : 'Biçem Tanımlarını çıkar'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Paragraf (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/uk.js
===================================================================
--- /CKEditor/trunk/_source/lang/uk.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/uk.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'Текст, що ви хочете вставити, схожий на копійований з Word. Ви хочете очистити його перед вставкою?',
 		toolbar : 'Вставити з Word',
 		title : 'Вставити з Word',
-		advice : 'Будь-ласка, вставте з буфера обміну в цю область, користуючись комбінацією клавіш (<STRONG>Ctrl+V</STRONG>) та натисніть <STRONG>OK</STRONG>.',
-		ignoreFontFace : 'Ігнорувати налаштування шрифтів',
-		removeStyle : 'Видалити налаштування стилів'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Нормальний (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/vi.js
===================================================================
--- /CKEditor/trunk/_source/lang/vi.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/vi.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : 'Văn bản bạn muốn dán có kèm định dạng của Word. Bạn có muốn loại bỏ định dạng Word trước khi dán?',
 		toolbar : 'Dán với định dạng Word',
 		title : 'Dán với định dạng Word',
-		advice : 'Hãy dán nội dung vào trong khung bên dưới, sử dụng tổ hợp phím (<STRONG>Ctrl+V</STRONG>) và nhấn vào nút <STRONG>Đồng ý</STRONG>.',
-		ignoreFontFace : 'Chấp nhận các định dạng phông',
-		removeStyle : 'Gỡ bỏ các định dạng Styles'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : 'Normal (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/zh-cn.js
===================================================================
--- /CKEditor/trunk/_source/lang/zh-cn.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/zh-cn.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : '您要粘贴的内容好像是来自 MS Word，是否要清除 MS Word 格式后再粘贴？',
 		toolbar : '从 MS Word 粘贴',
 		title : '从 MS Word 粘贴',
-		advice : '请使用键盘快捷键(<STRONG>Ctrl+V</STRONG>)把内容粘贴到下面的方框里，再按 <STRONG>确定</STRONG>',
-		ignoreFontFace : '忽略 Font 标签',
-		removeStyle : '清理 CSS 样式'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : '段落(DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/lang/zh.js
===================================================================
--- /CKEditor/trunk/_source/lang/zh.js	(revision 4773)
+++ /CKEditor/trunk/_source/lang/zh.js	(revision 4774)
@@ -507,9 +507,8 @@
 	pastefromword :
 	{
+		confirmCleanup : '您想貼上的文字似乎是自 Word 複製而來，請問您是否要先清除 Word 的格式後再行貼上？',
 		toolbar : '自 Word 貼上',
 		title : '自 Word 貼上',
-		advice : '請使用快捷鍵 (<strong>Ctrl+V</strong>) 貼到下方區域中並按下 <strong>確定</strong>',
-		ignoreFontFace : '移除字型設定',
-		removeStyle : '移除樣式設定'
+		error : 'It was not possible to clean up the pasted data due to an internal error' // MISSING
 	},
 
@@ -559,4 +558,21 @@
 		tag_div : '一般 (DIV)'
 	},
+
+	div :
+	{
+		title				: 'Create Div Container', // MISSING
+		toolbar				: 'Create Div Container', // MISSING
+		cssClassInputLabel	: 'Stylesheet Classes', // MISSING
+		styleSelectLabel	: 'Style', // MISSING
+		IdInputLabel		: 'Id', // MISSING
+		languageCodeInputLabel	: ' Language Code', // MISSING
+		inlineStyleInputLabel	: 'Inline Style', // MISSING
+		advisoryTitleInputLabel	: 'Advisory Title', // MISSING
+		langDirLabel		: 'Language Direction', // MISSING
+		langDirLTRLabel		: 'Left to Right (LTR)', // MISSING
+		langDirRTLLabel		: 'Right to Left (RTL)', // MISSING
+		edit				: 'Edit Div', // MISSING
+		remove				: 'Remove Div' // MISSING
+  	},
 
 	font :
Index: /CKEditor/trunk/_source/plugins/clipboard/dialogs/paste.js
===================================================================
--- /CKEditor/trunk/_source/plugins/clipboard/dialogs/paste.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/clipboard/dialogs/paste.js	(revision 4774)
@@ -119,5 +119,5 @@
 
 			setTimeout( function(){
-				editor.insertHtml( html );
+				editor.fire( 'paste', { 'html' : html } );
 			}, 0 );
 
Index: /CKEditor/trunk/_source/plugins/clipboard/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/clipboard/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/clipboard/plugin.js	(revision 4774)
@@ -79,26 +79,28 @@
 	// Paste command.
 	var pasteCmd =
-		CKEDITOR.env.ie ?
-			{
-				exec : function( editor, data )
+	{ 
+		canUndo : false,
+
+		exec : 
+			CKEDITOR.env.ie ?
+				function( editor )
 				{
 					// Prevent IE from pasting at the begining of the document.
 					editor.focus();
 
-					if ( !editor.fire( 'beforePaste' )
-						&& !execIECommand( editor, 'paste' ) )
-					{
-							editor.openDialog( 'paste' );
-					}
-				}
-			}
-		:
-			{
-				exec : function( editor )
+					if ( !editor.document.getBody().fire( 'beforepaste' )
+						 && !execIECommand( editor, 'paste' ) )
+					{
+						editor.fire( 'pasteDialog' );
+						return false;
+					}
+				}
+			:
+				function( editor )
 				{
 					try
 					{
-						if ( !editor.fire( 'beforePaste' )
-							&& !editor.document.$.execCommand( 'Paste', false, null ) )
+						if ( !editor.document.getBody().fire( 'beforepaste' )
+							 && !editor.document.$.execCommand( 'Paste', false, null ) )
 						{
 							throw 0;
@@ -107,13 +109,19 @@
 					catch ( e )
 					{
-						// Open the paste dialog.
-						editor.openDialog( 'paste' );
-					}
-				}
-			};
+						setTimeout( function()
+							{
+								editor.fire( 'pasteDialog' );
+							}, 0 );
+						return false;
+					}
+				}
+	};
 
 	// Listens for some clipboard related keystrokes, so they get customized.
 	var onKey = function( event )
 	{
+		if ( this.mode != 'wysiwyg' )
+			return;
+
 		switch ( event.data.keyCode )
 		{
@@ -122,14 +130,13 @@
 			case CKEDITOR.SHIFT + 45 :		// SHIFT+INS
 
-				var editor = this;
-				editor.fire( 'saveSnapshot' );		// Save before paste
-
-				if ( editor.fire( 'beforePaste' ) )
+				var body = this.document.getBody();
+
+				// Simulate 'beforepaste' event for all none-IEs.
+				if ( !CKEDITOR.env.ie && body.fire( 'beforepaste' ) )
 					event.cancel();
-
-				setTimeout( function()
-					{
-						editor.fire( 'saveSnapshot' );		// Save after paste
-					}, 0 );
+				// Simulate 'paste' event for Opera/Firefox2.
+				else if ( CKEDITOR.env.opera
+						 || CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 )
+					body.fire( 'paste' );
 				return;
 
@@ -139,6 +146,6 @@
 
 				// Save Undo snapshot.
-				editor = this;
-				editor.fire( 'saveSnapshot' );		// Save before paste
+				var editor = this;
+				this.fire( 'saveSnapshot' );		// Save before paste
 				setTimeout( function()
 					{
@@ -148,9 +155,110 @@
 	};
 
+	// Allow to peek clipboard content by redirecting the
+	// pasting content into a temporary bin and grab the content of it.
+	function getClipboardData( evt, mode, callback )
+	{
+		var doc = this.document;
+
+		// Avoid recursions on 'paste' event for IE.
+		if ( CKEDITOR.env.ie && doc.getById( 'cke_pastebin' ) )
+			return;
+
+		var sel = this.getSelection(),
+			range = new CKEDITOR.dom.range( doc );
+
+		// Create container to paste into
+		var pastebin = new CKEDITOR.dom.element( mode == 'text' ? 'textarea' : 'div', doc );
+		pastebin.setAttribute( 'id', 'cke_pastebin' );
+		doc.getBody().append( pastebin );
+
+		// It's definitely a better user experience if we make the paste-bin pretty unnoticed
+		// by pulling it off the screen, while this hack will make the paste-bin a control type element
+		// and that become a selection plain later. 
+		if ( !CKEDITOR.env.ie && mode != 'html' )
+		{
+			pastebin.setStyles(
+				{
+					position : 'absolute',
+					left : '-1000px',
+					// Position the bin exactly at the position of the selected element
+					// to avoid any subsequent document scroll.
+					top : sel.getStartElement().getDocumentPosition().y + 'px',
+					width : '1px',
+					height : '1px',
+					overflow : 'hidden'
+				});
+		}
+
+		var bms = sel.createBookmarks();
+
+		// Turn off design mode temporarily before give focus to the paste bin.
+		if ( mode == 'text' )
+		{
+			if ( CKEDITOR.env.ie )
+			{
+				var ieRange = doc.getBody().$.createTextRange();
+				ieRange.moveToElementText( pastebin.$ );
+				ieRange.execCommand( 'Paste' );
+				evt.data.preventDefault();
+			}
+			else
+			{
+				doc.$.designMode = 'off';
+				pastebin.$.focus();
+			}
+		}
+		else
+		{
+			range.setStartAt( pastebin, CKEDITOR.POSITION_AFTER_START );
+			range.setEndAt( pastebin, CKEDITOR.POSITION_BEFORE_END );
+			range.select( true );
+		}
+
+		// Wait a while and grab the pasted contents
+		window.setTimeout( function()
+		{
+			mode == 'text' && !CKEDITOR.env.ie && ( doc.$.designMode = 'on' );
+			pastebin.remove();
+
+			// Grab the HTML contents.
+			// We need to look for a apple style wrapper on webkit it also adds
+			// a div wrapper if you copy/paste the body of the editor.
+			// Remove hidden div and restore selection.
+			var bogusSpan;
+			pastebin = ( CKEDITOR.env.webkit
+						 && ( bogusSpan = pastebin.getFirst() )
+						 && ( bogusSpan.is && bogusSpan.hasClass( 'Apple-style-span' ) ) ?
+							bogusSpan : pastebin );
+
+			sel.selectBookmarks( bms );
+			callback( pastebin[ 'get' + ( mode == 'text' ? 'Value' : 'Html' ) ]() );
+		}, 0 );
+	};
+
 	// Register the plugin.
 	CKEDITOR.plugins.add( 'clipboard',
 		{
+			requires : [ 'htmldataprocessor' ],
 			init : function( editor )
 			{
+				// Inserts processed data into the editor at the end of the
+				// events chain.
+				editor.on( 'paste', function( evt )
+					{
+						var data = evt.data;
+						if ( data[ 'html' ] )
+							editor.insertHtml( data[ 'html' ] );
+						else if ( data[ 'text' ] )
+							editor.insertText( data[ 'text' ] );
+
+					}, null, null, 1000 );
+
+				editor.on( 'pasteDialog', function( evt )
+					{
+						// Open default paste dialog. 
+						editor.openDialog( 'paste' );
+					});
+
 				function addButtonCommand( buttonName, commandName, command, ctxMenuOrder )
 				{
@@ -185,4 +293,30 @@
 				editor.on( 'key', onKey, editor );
 
+				var mode = editor.config.forcePasteAsPlainText ? 'text' : 'html';
+
+				// We'll be catching all pasted content in one line, regardless of whether the
+				// it's introduced by a document command execution (e.g. toolbar buttons) or
+				// user paste behaviors. (e.g. Ctrl-V)
+				editor.on( 'contentDom', function()
+				{
+					var body = editor.document.getBody();
+					body.on( ( mode == 'text' && CKEDITOR.env.ie ) ? 'paste' : 'beforepaste',
+						function( evt )
+						{
+							getClipboardData.call( editor, evt, mode, function ( data )
+							{
+								// The very last guard to make sure the
+								// paste has successfully happened.
+								if ( !data )
+									return;
+
+								var dataTransfer = {};
+								dataTransfer[ mode ] = data;
+								editor.fire( 'paste', dataTransfer );
+							} );
+						});
+
+				});
+
 				// If the "contextmenu" plugin is loaded, register the listeners.
 				if ( editor.contextMenu )
Index: /CKEditor/trunk/_source/plugins/colorbutton/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/colorbutton/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/colorbutton/plugin.js	(revision 4774)
@@ -32,5 +32,5 @@
 					panel :
 					{
-						css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ]
+						css : editor.skin.editor.css
 					},
 
@@ -62,6 +62,19 @@
 					if ( color == '?' )
 					{
-						// TODO : Implement the colors dialog.
-						// editor.openDialog( '' );
+						var applyColorStyle = arguments.callee;
+						function onColorDialogClose( evt )
+						{
+							this.removeListener( 'ok', onColorDialogClose );
+							this.removeListener( 'cancel', onColorDialogClose );
+
+							evt.name == 'ok' && applyColorStyle( this.getContentElement( 'picker', 'selectedColor' ).getValue(), type );
+						}
+						
+						editor.openDialog( 'colordialog', function()
+						{
+							this.on( 'ok', onColorDialogClose );
+							this.on( 'cancel', onColorDialogClose );
+						} );
+
 						return;
 					}
@@ -149,5 +162,5 @@
  * config.colorButton_enableMore = false;
  */
-CKEDITOR.config.colorButton_enableMore = false;
+CKEDITOR.config.colorButton_enableMore = true;
 
 /**
Index: /CKEditor/trunk/_source/plugins/contextmenu/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/contextmenu/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/contextmenu/plugin.js	(revision 4774)
@@ -84,9 +84,4 @@
 				element = selection && selection.getStartElement();
 
-			// Lock the selection in IE, so it can be restored when closing the
-			// menu.
-			if ( CKEDITOR.env.ie )
-				selection.lock();
-
 			menu.onHide = CKEDITOR.tools.bind( function()
 				{
@@ -94,5 +89,8 @@
 
 					if ( CKEDITOR.env.ie )
-						editor.getSelection().unlock();
+					{
+						var selection = editor.getSelection();
+						selection && selection.unlock();
+					}
 
 					this.onHide && this.onHide();
@@ -178,4 +176,18 @@
 					}
 				} );
+			}
+
+			// Certain forms of IE selection changes on 'contextmenu' event,
+			// lock the selection before that.(#4041)
+			if ( CKEDITOR.env.ie )
+			{
+				element.on( 'mousedown', function( event )
+				{
+					if ( event.data.$.button == 2 )
+					{
+						var selection = this.editor.getSelection();
+						selection && selection.lock();
+					}
+				}, this );
 			}
 
Index: /CKEditor/trunk/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/dialog/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/dialog/plugin.js	(revision 4774)
@@ -7,9 +7,4 @@
  * @fileOverview The floating dialog plugin.
  */
-
-CKEDITOR.plugins.add( 'dialog',
-	{
-		requires : [ 'dialogui' ]
-	});
 
 /**
@@ -73,7 +68,4 @@
 		return null;
 	}
-
-	// Stores dialog related data from skin definitions. e.g. margin sizes.
-	var skinData = {};
 
 	/**
@@ -680,4 +672,5 @@
 					this.fireOnce( 'load', {} );
 					this.fire( 'show', {} );
+					this._.editor.fire( 'dialogShow', this );
 
 					// Save the initial values of the dialog.
@@ -743,4 +736,5 @@
 		{
 			this.fire( 'hide', {} );
+			this._.editor.fire( 'dialogHide', this );
 
 			// Remove the dialog's element from the root document.
@@ -1455,5 +1449,5 @@
 			editor = dialog.getParentEditor(),
 			magnetDistance = editor.config.dialog_magnetDistance,
-			margins = skinData[ editor.skinName ].margins || [ 0, 0, 0, 0 ];
+			margins = editor.skin.margins || [ 0, 0, 0, 0 ];
 
 		if ( typeof magnetDistance == 'undefined' )
@@ -1533,5 +1527,5 @@
 			minHeight = definition.minHeight || 0,
 			resizable = definition.resizable,
-			margins = skinData[ dialog.getParentEditor().skinName ].margins || [ 0, 0, 0, 0 ];
+			margins = dialog.getParentEditor().skin.margins || [ 0, 0, 0, 0 ];
 
 		function topSizer( coords, dy )
@@ -2693,15 +2687,4 @@
 		};
 	})();
-
-	// Grab the margin data from skin definition and store it away.
-	CKEDITOR.skins.add = ( function()
-	{
-		var original = CKEDITOR.skins.add;
-		return function( skinName, skinDefinition )
-		{
-			skinData[ skinName ] = { margins : skinDefinition.margins };
-			return original.apply( this, arguments );
-		};
-	} )();
 })();
 
@@ -2713,4 +2696,5 @@
 		 * Loads and opens a registered dialog.
 		 * @param {String} dialogName The registered name of the dialog.
+		 * @param {Function} callback The function to be invoked after dialog instance created.  
 		 * @see CKEDITOR.dialog.add
 		 * @example
@@ -2718,5 +2702,5 @@
 		 * @returns {CKEDITOR.dialog} The dialog object corresponding to the dialog displayed. null if the dialog name is not registered.
 		 */
-		openDialog : function( dialogName )
+		openDialog : function( dialogName, callback )
 		{
 			var dialogDefinitions = CKEDITOR.dialog._.dialogDefinitions[ dialogName ];
@@ -2731,4 +2715,5 @@
 					( storedDialogs[ dialogName ] = new CKEDITOR.dialog( this, dialogName ) );
 
+				callback && callback.call( dialog, dialog );
 				dialog.show();
 
@@ -2749,5 +2734,5 @@
 					if ( typeof CKEDITOR.dialog._.dialogDefinitions[ dialogName ] != 'function' )
 							CKEDITOR.dialog._.dialogDefinitions[ dialogName ] =  'failed';
-					me.openDialog( dialogName );
+					me.openDialog( dialogName, callback );
 					body.setStyle( 'cursor', cursor );
 				} );
@@ -2755,4 +2740,9 @@
 			return null;
 		}
+	});
+
+CKEDITOR.plugins.add( 'dialog',
+	{
+		requires : [ 'dialogui' ]
 	});
 
Index: /CKEditor/trunk/_source/plugins/div/dialogs/div.js
===================================================================
--- /CKEditor/trunk/_source/plugins/div/dialogs/div.js	(revision 4774)
+++ /CKEditor/trunk/_source/plugins/div/dialogs/div.js	(revision 4774)
@@ -0,0 +1,441 @@
+/*
+ * Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
+
+(function()
+{
+	
+	/**
+	 * Add to collection with DUP examination.
+	 * @param {Object} collection
+	 * @param {Object} element
+	 * @param {Object} database
+	 */
+	function addSafely( collection, element, database )
+	{
+		// 1. IE doesn't support customData on text nodes;
+		// 2. Text nodes never get chance to appear twice;
+		if ( !element.is || !element.getCustomData( 'block_processed' ) )
+		{
+			element.is && CKEDITOR.dom.element.setMarker( database, element, 'block_processed', true );
+			collection.push( element );
+		}
+	}
+	
+	function getNonEmptyChildren( element )
+	{
+		var retval = [];
+		var children = element.getChildren();
+		for( var i = 0 ; i < children.count() ; i++ )
+		{
+			var child = children.getItem( i );
+			if( ! ( child.type === CKEDITOR.NODE_TEXT 
+				&& /^[ \t\n\r]+$/.test( child.getText() ) ) )
+				retval.push( child );
+		}
+		return retval;
+	}
+
+
+	/**
+	 * Dialog reused by both 'creatediv' and 'editdiv' commands.
+	 * @param {Object} editor
+	 * @param {String} command	The command name which indicate what the current command is.
+	 */
+	function divDialog( editor, command )
+	{
+		// Definition of elements at which div operation should stopped.
+		var divLimitDefinition = ( function(){
+			
+			// Customzie from specialize blockLimit elements
+			var definition = CKEDITOR.tools.extend( {}, CKEDITOR.dtd.$blockLimit );
+
+			// Exclude 'div' itself.
+			delete definition.div;
+
+			// Exclude 'td' and 'th' when 'wrapping table' 
+			if( editor.config.div_wrapTable )
+			{
+				delete definition.td;
+				delete definition.th;
+			}
+			return definition;
+		})();
+		
+		// DTD of 'div' element
+		var dtd = CKEDITOR.dtd.div;
+		
+		/**
+		 * Get the first div limit element on the element's path.
+		 * @param {Object} element
+		 */
+		function getDivLimitElement( element )
+		{
+			var pathElements = new CKEDITOR.dom.elementPath( element ).elements;
+			var divLimit;
+			for ( var i = 0; i < pathElements.length ; i++ ) 
+			{
+				if ( pathElements[ i ].getName() in divLimitDefinition ) 
+				{
+					divLimit = pathElements[ i ];
+					break;
+				}
+			}
+			return divLimit;
+		}
+		
+		/**
+		 * Init all fields' setup/commit function.
+		 * @memberof divDialog
+		 */
+		function setupFields()
+		{
+			this.foreach( function( field )
+			{
+				// Exclude layout container elements
+				if( /^(?!vbox|hbox)/.test( field.type ) )
+				{
+					if ( !field.setup )
+					{
+						// Read the dialog fields values from the specified
+						// element attributes.
+						field.setup = function( element )
+						{
+							field.setValue( element.getAttribute( field.id ) || '' );
+						};
+					}
+					if ( !field.commit )
+					{
+						// Set element attributes assigned by the dialog
+						// fields.
+						field.commit = function( element )
+						{
+							var fieldValue = this.getValue();
+							// ignore default element attribute values
+							if ( 'dir' == field.id && element.getComputedStyle( 'direction' ) == fieldValue )
+								return true;
+							if ( fieldValue )
+								element.setAttribute( field.id, fieldValue );
+							else
+								element.removeAttribute( field.id );
+						};
+					}
+				}
+			} );
+		}
+		
+		/**
+		 * Wrapping 'div' element around appropriate blocks among the selected ranges.
+		 * @param {Object} editor
+		 */
+		function createDiv( editor )
+		{
+			// new adding containers OR detected pre-existed containers.
+			var containers = [];
+			// node markers store.
+			var database = {};
+			// All block level elements which contained by the ranges.
+			var containedBlocks = [], block;
+
+			// Get all ranges from the selection.
+			var selection = editor.document.getSelection();
+			var ranges = selection.getRanges();
+			var bookmarks = selection.createBookmarks();
+			var i, iterator;
+
+			// Calcualte a default block tag if we need to create blocks.
+			var blockTag = editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p';
+
+			// collect all included elements from dom-iterator
+			for( i = 0 ; i < ranges.length ; i++ )
+			{
+				iterator = ranges[ i ].createIterator();
+				while( ( block = iterator.getNextParagraph() ) )
+				{
+					// include contents of blockLimit elements.
+					if( block.getName() in divLimitDefinition )
+					{
+						var j, childNodes = block.getChildren();
+						for ( j = 0 ; j < childNodes.count() ; j++ )
+							addSafely( containedBlocks, childNodes.getItem( j ) , database );
+					}
+					else
+					{
+						// Bypass dtd disallowed elements.
+						while( !dtd[ block.getName() ] && block.getName() != 'body' )
+							block = block.getParent();
+						addSafely( containedBlocks, block, database );
+					}
+				}
+			}
+
+			CKEDITOR.dom.element.clearAllMarkers( database );
+
+			var blockGroups = groupByDivLimit( containedBlocks );
+			var ancestor, blockEl, divElement;
+
+			for( i = 0 ; i < blockGroups.length ; i++ )
+			{
+				var currentNode = blockGroups[ i ][ 0 ];
+
+				// Calculate the common parent node of all contained elements.
+				ancestor = currentNode.getParent();
+				for ( var j = 1 ; j < blockGroups[ i ].length; j++ )
+					ancestor = ancestor.getCommonAncestor( blockGroups[ i ][ j ] );
+
+				divElement = new CKEDITOR.dom.element( 'div', editor.document );
+				
+				// Normalize the blocks in each group to a common parent.
+				for( var j = 0; j < blockGroups[ i ].length ; j++ )
+				{
+					currentNode = blockGroups[ i ][ j ];
+
+					while( !currentNode.getParent().equals( ancestor ) )
+						currentNode = currentNode.getParent();
+
+					// This could introduce some duplicated elements in array.
+					blockGroups[ i ][ j ] = currentNode;
+				}
+
+				// Wrapped blocks counting
+				var fixedBlock = null;
+				for ( var j = 0 ; j < blockGroups[ i ].length ; j++ )
+				{
+					currentNode = blockGroups[ i ][ j ];
+
+					// Avoid DUP elements introduced by grouping.
+					if ( !( currentNode.getCustomData && currentNode.getCustomData( 'block_processed' ) ) )
+					{
+						currentNode.is && CKEDITOR.dom.element.setMarker( database, currentNode, 'block_processed', true );
+
+						// Establish new container, wrapping all elements in this group.
+						if ( j == 0 )
+							divElement.insertBefore( currentNode );
+
+						divElement.append( currentNode );
+					}
+				}
+
+				CKEDITOR.dom.element.clearAllMarkers( database );
+				containers.push( divElement );
+			}
+
+			selection.selectBookmarks( bookmarks );
+			return containers;
+		}
+
+		function getDiv( editor )
+		{
+			var path = new CKEDITOR.dom.elementPath( editor.getSelection().getStartElement() ),
+				blockLimit = path.blockLimit,
+				div = blockLimit && blockLimit.getAscendant( 'div', true );
+			return div;
+		}
+		/**
+		 * Divide a set of nodes to different groups by their path's blocklimit element.
+		 * Note: the specified nodes should be in source order naturally, which mean they are supposed to producea by following class:
+		 *  * CKEDITOR.dom.range.Iterator
+		 *  * CKEDITOR.dom.domWalker
+		 *  @return {Array []} the grouped nodes
+		 */
+		function groupByDivLimit( nodes )
+		{
+			var groups = [],
+				lastDivLimit = null,
+				path, block;
+			for ( var i = 0 ; i < nodes.length ; i++ )
+			{
+				block = nodes[i];
+				var limit = getDivLimitElement( block );
+				if ( !limit.equals( lastDivLimit ) )
+				{
+					lastDivLimit = limit ;
+					groups.push( [] ) ;
+				}
+				groups[ groups.length - 1 ].push( block ) ;
+			}
+			return groups;
+		}
+		
+		/**
+		 * Hold a collection of created block container elements.  
+		 */
+		var containers = [];
+		/**
+		 * @type divDialog
+		 */ 
+		return {
+			title : editor.lang.div.title,
+			minWidth : 400,
+			minHeight : 165,
+			contents : 
+			[
+			{
+				id :'info',
+				label :editor.lang.common.generalTab,
+				title :editor.lang.common.generalTab,
+				elements : 
+				[
+					{
+						type :'hbox',
+						widths : [ '50%', '50%' ],
+						children : 
+						[
+							{
+								id :'elementStyle',
+								type :'select',
+								style :'width: 100%;',
+								label :editor.lang.div.styleSelectLabel,
+								'default' : '',
+								items : [],
+								setup : function( element )
+								{
+									this.setValue( element.$.style.cssText || '' );
+								},
+								commit: function( element )
+								{
+									if ( this.getValue() )
+										element.$.style.cssText = this.getValue();
+									else
+										element.removeAttribute( 'style' );
+								}
+							},
+							{
+								id :'class',
+								type :'text',
+								label :editor.lang.common.cssClass,
+								'default' : ''
+							} 
+						]
+					} 
+				]
+			},
+			{
+					id :'advanced',
+					label :editor.lang.common.advancedTab,
+					title :editor.lang.common.advancedTab,
+					elements : 
+					[
+					{
+						type :'vbox',
+						padding :1,
+						children : 
+						[
+							{
+								type :'hbox',
+								widths : [ '50%', '50%' ],
+								children : 
+								[
+									{
+										type :'text',
+										id :'id',
+										label :editor.lang.common.id,
+										'default' : ''
+									},
+									{
+										type :'text',
+										id :'lang',
+										label :editor.lang.link.langCode,
+										'default' : ''
+									} 
+								]
+							},
+							{
+								type :'hbox',
+								children : 
+								[
+										{
+											type :'text',
+											id :'style',
+											style :'width: 100%;',
+											label :editor.lang.common.cssStyle,
+											'default' : ''
+										} 
+								]
+							},
+							{
+								type :'hbox',
+								children : 
+								[
+										{
+											type :'text',
+											id :'title',
+											style :'width: 100%;',
+											label :editor.lang.common.advisoryTitle,
+											'default' : ''
+										} 
+								]
+							},
+							{
+								type :'select',
+								id :'dir',
+								style :'width: 100%;',
+								label :editor.lang.common.langDir,
+								'default' : '',
+								items : 
+								[
+									[
+										editor.lang.common.langDirLtr,
+										'ltr' 
+									],
+									[
+										editor.lang.common.langDirRtl,
+										'rtl' 
+									] 
+								]
+							} 
+						]
+					} 
+					]
+				} 
+			],
+			onLoad : function()
+			{
+				setupFields.call(this);
+			},
+			onShow : function()
+			{
+				// Whether always create new container regardless of existed
+				// ones.
+				if ( command == 'editdiv' )
+				{
+					// Try to discover the containers that already existed in
+					// ranges
+					var div = getDiv( editor );
+					// update dialog field values
+					div && this.setupContent( this._element = div );
+				}
+			},
+			onOk : function()
+			{
+				if( command == 'editdiv' )
+					containers = [ this._element ];
+				else
+					containers = createDiv( editor, true );
+				
+				// Update elements attributes
+				for( var i = 0 ; i < containers.length ; i++ )
+					this.commitContent( containers[ i ] );
+				this.hide();
+			}
+		};
+	}
+	
+	CKEDITOR.dialog.add( 'creatediv', function( editor )
+		{
+			return divDialog( editor, 'creatediv' );
+		} );
+	CKEDITOR.dialog.add( 'editdiv', function( editor )
+		{
+			return divDialog( editor, 'editdiv' );
+		} );
+} )();
+
+/*
+ * @name CKEDITOR.config.div_wrapTable
+ * Whether to wrap the whole table instead of indivisual cells when created 'div' in table cell.
+ * @type Boolean
+ * @default false
+ * @example config.div_wrapTable = true;
+ */
Index: /CKEditor/trunk/_source/plugins/div/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/div/plugin.js	(revision 4774)
+++ /CKEditor/trunk/_source/plugins/div/plugin.js	(revision 4774)
@@ -0,0 +1,121 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview The "div" plugin. It wraps the selected block level elements with a 'div' element with specified styles and attributes.
+ * 
+ */
+
+(function()
+{
+	CKEDITOR.plugins.add( 'div',
+	{
+		requires : [ 'editingblock', 'domiterator' ],
+
+		init : function( editor )
+		{
+			var lang = editor.lang.div;
+
+			editor.addCommand( 'creatediv', new CKEDITOR.dialogCommand( 'creatediv' ) );
+			editor.addCommand( 'editdiv', new CKEDITOR.dialogCommand( 'editdiv' ) );
+			editor.addCommand( 'removediv',
+				{
+					exec : function( editor )
+					{
+						var selection = editor.getSelection(),
+							ranges = selection && selection.getRanges(),
+							range,
+							bookmarks = selection.createBookmarks(),
+							walker,
+							toRemove = [];
+
+						function findDiv( node )
+						{
+							var path = new CKEDITOR.dom.elementPath( node ),
+								blockLimit = path.blockLimit,
+								div = blockLimit.is( 'div' ) && blockLimit;
+
+							if ( div && !div.getAttribute( '_cke_div_added' ) )
+							{
+								toRemove.push( div );
+								div.setAttribute( '_cke_div_added' );
+							}
+						}
+
+						for ( var i = 0 ; i < ranges.length ; i++ )
+						{
+							range = ranges[ i ];
+							if( range.collapsed )
+								findDiv( selection.getStartElement() );
+							else
+							{
+								walker = new CKEDITOR.dom.walker( range );
+								walker.evaluator = findDiv;
+								walker.lastForward();
+							}
+						}
+
+						for ( var i = 0 ; i < toRemove.length ; i++ )
+							toRemove[ i ].remove( true );
+
+						selection.selectBookmarks( bookmarks );
+					}
+				} );
+				
+			editor.ui.addButton( 'CreateDiv',
+			{
+				label : lang.toolbar,
+				command :'creatediv'
+			} );
+
+			if ( editor.addMenuItems )
+			{
+				editor.addMenuItems(
+					{
+						editdiv :
+						{
+							label : lang.edit,
+							command : 'editdiv',
+							group : 'div',
+							order : 1
+						},
+
+						removediv:
+						{
+							label : lang.remove,
+							command : 'removediv',
+							group : 'div',
+							order : 5
+						}
+					} );
+
+				if ( editor.contextMenu )
+				{
+					editor.contextMenu.addListener( function( element, selection )
+						{
+							if ( !element )
+								return null;
+
+							var elementPath = new CKEDITOR.dom.elementPath( element ),
+								blockLimit = elementPath.blockLimit;
+
+							if ( blockLimit && blockLimit.getAscendant( 'div', true ) )
+							{
+								return {
+									editdiv : CKEDITOR.TRISTATE_OFF,
+									removediv : CKEDITOR.TRISTATE_OFF
+								}
+							}
+
+							return null;
+						} );
+				}
+			}
+			
+			CKEDITOR.dialog.add( 'creatediv', this.path + 'dialogs/div.js' );
+			CKEDITOR.dialog.add( 'editdiv', this.path + 'dialogs/div.js' );
+		}
+	} );
+})();
Index: /CKEditor/trunk/_source/plugins/enterkey/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/enterkey/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/enterkey/plugin.js	(revision 4774)
@@ -18,5 +18,266 @@
 	});
 
-	var forceMode,
+	CKEDITOR.plugins.enterkey =
+	{
+		enterBlock : function( editor, mode, range, forceMode )
+		{
+			// Get the range for the current selection.
+			range = range || getRange( editor );
+
+			var doc = range.document;
+
+			// Determine the block element to be used.
+			var blockTag = ( mode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );
+
+			// Split the range.
+			var splitInfo = range.splitBlock( blockTag );
+
+			if ( !splitInfo )
+				return;
+
+			// Get the current blocks.
+			var previousBlock	= splitInfo.previousBlock,
+				nextBlock		= splitInfo.nextBlock;
+
+			var isStartOfBlock	= splitInfo.wasStartOfBlock,
+				isEndOfBlock	= splitInfo.wasEndOfBlock;
+
+			var node;
+
+			// If this is a block under a list item, split it as well. (#1647)
+			if ( nextBlock )
+			{
+				node = nextBlock.getParent();
+				if ( node.is( 'li' ) )
+				{
+					nextBlock.breakParent( node );
+					nextBlock.move( nextBlock.getNext(), true );
+				}
+			}
+			else if ( previousBlock && ( node = previousBlock.getParent() ) && node.is( 'li' ) )
+			{
+				previousBlock.breakParent( node );
+				range.moveToElementEditStart( previousBlock.getNext() );
+				previousBlock.move( previousBlock.getPrevious() );
+			}
+
+			// If we have both the previous and next blocks, it means that the
+			// boundaries were on separated blocks, or none of them where on the
+			// block limits (start/end).
+			if ( !isStartOfBlock && !isEndOfBlock )
+			{
+				// If the next block is an <li> with another list tree as the first
+				// child, we'll need to append a filler (<br>/NBSP) or the list item
+				// wouldn't be editable. (#1420)
+				if ( nextBlock.is( 'li' )
+					 && ( node = nextBlock.getFirst( CKEDITOR.dom.walker.invisible( true ) ) )
+					 && node.is && node.is( 'ul', 'ol' ) )
+					( CKEDITOR.env.ie ? doc.createText( '\xa0' ) : doc.createElement( 'br' ) ).insertBefore( node );
+
+				// Move the selection to the end block.
+				if ( nextBlock )
+					range.moveToElementEditStart( nextBlock );
+			}
+			else
+			{
+
+				if ( isStartOfBlock && isEndOfBlock && previousBlock.is( 'li' ) )
+				{
+					editor.execCommand( 'outdent' );
+					return;
+				}
+
+				var newBlock;
+
+				if ( previousBlock )
+				{
+					// Do not enter this block if it's a header tag, or we are in
+					// a Shift+Enter (#77). Create a new block element instead
+					// (later in the code).
+					if ( !forceMode && !headerTagRegex.test( previousBlock.getName() ) )
+					{
+						// Otherwise, duplicate the previous block.
+						newBlock = previousBlock.clone();
+					}
+				}
+				else if ( nextBlock )
+					newBlock = nextBlock.clone();
+
+				if ( !newBlock )
+					newBlock = doc.createElement( blockTag );
+
+				// Recreate the inline elements tree, which was available
+				// before hitting enter, so the same styles will be available in
+				// the new block.
+				var elementPath = splitInfo.elementPath;
+				if ( elementPath )
+				{
+					for ( var i = 0, len = elementPath.elements.length ; i < len ; i++ )
+					{
+						var element = elementPath.elements[ i ];
+
+						if ( element.equals( elementPath.block ) || element.equals( elementPath.blockLimit ) )
+							break;
+
+						if ( CKEDITOR.dtd.$removeEmpty[ element.getName() ] )
+						{
+							element = element.clone();
+							newBlock.moveChildren( element );
+							newBlock.append( element );
+						}
+					}
+				}
+
+				if ( !CKEDITOR.env.ie )
+					newBlock.appendBogus();
+
+				range.insertNode( newBlock );
+
+				// This is tricky, but to make the new block visible correctly
+				// we must select it.
+				// The previousBlock check has been included because it may be
+				// empty if we have fixed a block-less space (like ENTER into an
+				// empty table cell).
+				if ( CKEDITOR.env.ie && isStartOfBlock && ( !isEndOfBlock || !previousBlock.getChildCount() ) )
+				{
+					// Move the selection to the new block.
+					range.moveToElementEditStart( isEndOfBlock ? previousBlock : newBlock );
+					range.select();
+				}
+
+				// Move the selection to the new block.
+				range.moveToElementEditStart( isStartOfBlock && !isEndOfBlock ? nextBlock : newBlock );
+		}
+
+			if ( !CKEDITOR.env.ie )
+			{
+				if ( nextBlock )
+				{
+					// If we have split the block, adds a temporary span at the
+					// range position and scroll relatively to it.
+					var tmpNode = doc.createElement( 'span' );
+
+					// We need some content for Safari.
+					tmpNode.setHtml( '&nbsp;' );
+
+					range.insertNode( tmpNode );
+					tmpNode.scrollIntoView();
+					range.deleteContents();
+				}
+				else
+				{
+					// We may use the above scroll logic for the new block case
+					// too, but it gives some weird result with Opera.
+					newBlock.scrollIntoView();
+				}
+			}
+
+			range.select();
+		},
+
+		enterBr : function( editor, mode, range, forceMode )
+		{
+			// Get the range for the current selection.
+			range = range || getRange( editor );
+
+			var doc = range.document;
+
+			// Determine the block element to be used.
+			var blockTag = ( mode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );
+
+			var isEndOfBlock = range.checkEndOfBlock();
+
+			var elementPath = new CKEDITOR.dom.elementPath( editor.getSelection().getStartElement() );
+
+			var startBlock = elementPath.block,
+				startBlockTag = startBlock && elementPath.block.getName();
+
+			var isPre = false;
+
+			if ( !forceMode && startBlockTag == 'li' )
+			{
+				enterBlock( editor, mode, range, forceMode );
+				return;
+			}
+
+			// If we are at the end of a header block.
+			if ( !forceMode && isEndOfBlock && headerTagRegex.test( startBlockTag ) )
+			{
+				// Insert a <br> after the current paragraph.
+				doc.createElement( 'br' ).insertAfter( startBlock );
+
+				// A text node is required by Gecko only to make the cursor blink.
+				if ( CKEDITOR.env.gecko )
+					doc.createText( '' ).insertAfter( startBlock );
+
+				// IE has different behaviors regarding position.
+				range.setStartAt( startBlock.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START );
+			}
+			else
+			{
+				var lineBreak;
+
+				isPre = ( startBlockTag == 'pre' );
+
+				if ( isPre )
+					lineBreak = doc.createText( CKEDITOR.env.ie ? '\r' : '\n' );
+				else
+					lineBreak = doc.createElement( 'br' );
+
+				range.deleteContents();
+				range.insertNode( lineBreak );
+
+				// A text node is required by Gecko only to make the cursor blink.
+				// We need some text inside of it, so the bogus <br> is properly
+				// created.
+				if ( !CKEDITOR.env.ie )
+					doc.createText( '\ufeff' ).insertAfter( lineBreak );
+
+				// If we are at the end of a block, we must be sure the bogus node is available in that block.
+				if ( isEndOfBlock && !CKEDITOR.env.ie )
+					lineBreak.getParent().appendBogus();
+
+				// Now we can remove the text node contents, so the caret doesn't
+				// stop on it.
+				if ( !CKEDITOR.env.ie )
+					lineBreak.getNext().$.nodeValue = '';
+				// IE has different behavior regarding position.
+				if ( CKEDITOR.env.ie )
+					range.setStartAt( lineBreak, CKEDITOR.POSITION_AFTER_END );
+				else
+					range.setStartAt( lineBreak.getNext(), CKEDITOR.POSITION_AFTER_START );
+
+				// Scroll into view, for non IE.
+				if ( !CKEDITOR.env.ie )
+				{
+					var dummy = null;
+
+					// BR is not positioned in Opera and Webkit.
+					if ( !CKEDITOR.env.gecko )
+					{
+						dummy = doc.createElement( 'span' );
+						// We need have some contents for Webkit to position it
+						// under parent node. ( #3681)
+						dummy.setHtml('&nbsp;');
+					}
+					else
+						dummy = doc.createElement( 'br' );
+
+					dummy.insertBefore( lineBreak.getNext() );
+					dummy.scrollIntoView();
+					dummy.remove();
+				}
+			}
+
+			// This collapse guarantees the cursor will be blinking.
+			range.collapse( true );
+
+			range.select( isPre );
+		}
+	};
+
+	var plugin = CKEDITOR.plugins.enterkey,
+		enterBr = plugin.enterBr,
+		enterBlock = plugin.enterBlock,
 		headerTagRegex = /^h[1-6]$/;
 
@@ -25,10 +286,8 @@
 		// On SHIFT+ENTER we want to enforce the mode to be respected, instead
 		// of cloning the current block. (#77)
-		forceMode = 1;
-
-		return enter( editor, editor.config.shiftEnterMode );
+		return enter( editor, editor.config.shiftEnterMode, true );
 	}
 
-	function enter( editor, mode )
+	function enter( editor, mode, forceMode )
 	{
 		// Only effective within document.
@@ -44,9 +303,8 @@
 				editor.fire( 'saveSnapshot' );	// Save undo step.
 				if ( mode == CKEDITOR.ENTER_BR || editor.getSelection().getStartElement().hasAscendant( 'pre', true ) )
-					enterBr( editor, mode );
+					enterBr( editor, mode, null, forceMode );
 				else
-					enterBlock( editor, mode );
-
-				forceMode = 0;
+					enterBlock( editor, mode, null, forceMode );
+
 			}, 0 );
 
@@ -54,258 +312,4 @@
 	}
 
-	function enterBlock( editor, mode, range )
-	{
-		// Get the range for the current selection.
-		range = range || getRange( editor );
-
-		var doc = range.document;
-
-		// Determine the block element to be used.
-		var blockTag = ( mode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );
-
-		// Split the range.
-		var splitInfo = range.splitBlock( blockTag );
-
-		if ( !splitInfo )
-			return;
-
-		// Get the current blocks.
-		var previousBlock	= splitInfo.previousBlock,
-			nextBlock		= splitInfo.nextBlock;
-
-		var isStartOfBlock	= splitInfo.wasStartOfBlock,
-			isEndOfBlock	= splitInfo.wasEndOfBlock;
-
-		var node;
-
-		// If this is a block under a list item, split it as well. (#1647)
-		if ( nextBlock )
-		{
-			node = nextBlock.getParent();
-			if ( node.is( 'li' ) )
-			{
-				nextBlock.breakParent( node );
-				nextBlock.move( nextBlock.getNext(), true );
-			}
-		}
-		else if ( previousBlock && ( node = previousBlock.getParent() ) && node.is( 'li' ) )
-		{
-			previousBlock.breakParent( node );
-			range.moveToElementEditStart( previousBlock.getNext() );
-			previousBlock.move( previousBlock.getPrevious() );
-		}
-
-		// If we have both the previous and next blocks, it means that the
-		// boundaries were on separated blocks, or none of them where on the
-		// block limits (start/end).
-		if ( !isStartOfBlock && !isEndOfBlock )
-		{
-			// If the next block is an <li> with another list tree as the first
-			// child, we'll need to append a filler (<br>/NBSP) or the list item
-			// wouldn't be editable. (#1420)
-			if ( nextBlock.is( 'li' )
-				 && ( node = nextBlock.getFirst( CKEDITOR.dom.walker.invisible( true ) ) )
-				 && node.is && node.is( 'ul', 'ol' ) )
-				( CKEDITOR.env.ie ? doc.createText( '\xa0' ) : doc.createElement( 'br' ) ).insertBefore( node );
-
-			// Move the selection to the end block.
-			if ( nextBlock )
-				range.moveToElementEditStart( nextBlock );
-		}
-		else
-		{
-
-			if ( isStartOfBlock && isEndOfBlock && previousBlock.is( 'li' ) )
-			{
-				editor.execCommand( 'outdent' );
-				return;
-			}
-
-			var newBlock;
-
-			if ( previousBlock )
-			{
-				// Do not enter this block if it's a header tag, or we are in
-				// a Shift+Enter (#77). Create a new block element instead
-				// (later in the code).
-				if ( !forceMode && !headerTagRegex.test( previousBlock.getName() ) )
-				{
-					// Otherwise, duplicate the previous block.
-					newBlock = previousBlock.clone();
-				}
-			}
-			else if ( nextBlock )
-				newBlock = nextBlock.clone();
-
-			if ( !newBlock )
-				newBlock = doc.createElement( blockTag );
-
-			// Recreate the inline elements tree, which was available
-			// before hitting enter, so the same styles will be available in
-			// the new block.
-			var elementPath = splitInfo.elementPath;
-			if ( elementPath )
-			{
-				for ( var i = 0, len = elementPath.elements.length ; i < len ; i++ )
-				{
-					var element = elementPath.elements[ i ];
-
-					if ( element.equals( elementPath.block ) || element.equals( elementPath.blockLimit ) )
-						break;
-
-					if ( CKEDITOR.dtd.$removeEmpty[ element.getName() ] )
-					{
-						element = element.clone();
-						newBlock.moveChildren( element );
-						newBlock.append( element );
-					}
-				}
-			}
-
-			if ( !CKEDITOR.env.ie )
-				newBlock.appendBogus();
-
-			range.insertNode( newBlock );
-
-			// This is tricky, but to make the new block visible correctly
-			// we must select it.
-			// The previousBlock check has been included because it may be
-			// empty if we have fixed a block-less space (like ENTER into an
-			// empty table cell).
-			if ( CKEDITOR.env.ie && isStartOfBlock && ( !isEndOfBlock || !previousBlock.getChildCount() ) )
-			{
-				// Move the selection to the new block.
-				range.moveToElementEditStart( isEndOfBlock ? previousBlock : newBlock );
-				range.select();
-			}
-
-			// Move the selection to the new block.
-			range.moveToElementEditStart( isStartOfBlock && !isEndOfBlock ? nextBlock : newBlock );
-		}
-
-		if ( !CKEDITOR.env.ie )
-		{
-			if ( nextBlock )
-			{
-				// If we have split the block, adds a temporary span at the
-				// range position and scroll relatively to it.
-				var tmpNode = doc.createElement( 'span' );
-
-				// We need some content for Safari.
-				tmpNode.setHtml( '&nbsp;' );
-
-				range.insertNode( tmpNode );
-				tmpNode.scrollIntoView();
-				range.deleteContents();
-			}
-			else
-			{
-				// We may use the above scroll logic for the new block case
-				// too, but it gives some weird result with Opera.
-				newBlock.scrollIntoView();
-			}
-		}
-
-		range.select();
-	}
-
-	function enterBr( editor, mode )
-	{
-		// Get the range for the current selection.
-		var range = getRange( editor ),
-			doc = range.document;
-
-		// Determine the block element to be used.
-		var blockTag = ( mode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );
-
-		var isEndOfBlock = range.checkEndOfBlock();
-
-		var elementPath = new CKEDITOR.dom.elementPath( editor.getSelection().getStartElement() );
-
-		var startBlock = elementPath.block,
-			startBlockTag = startBlock && elementPath.block.getName();
-
-		var isPre = false;
-
-		if ( !forceMode && startBlockTag == 'li' )
-		{
-			enterBlock( editor, mode, range );
-			return;
-		}
-
-		// If we are at the end of a header block.
-		if ( !forceMode && isEndOfBlock && headerTagRegex.test( startBlockTag ) )
-		{
-			// Insert a <br> after the current paragraph.
-			doc.createElement( 'br' ).insertAfter( startBlock );
-
-			// A text node is required by Gecko only to make the cursor blink.
-			if ( CKEDITOR.env.gecko )
-				doc.createText( '' ).insertAfter( startBlock );
-
-			// IE has different behaviors regarding position.
-			range.setStartAt( startBlock.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START );
-		}
-		else
-		{
-			var lineBreak;
-
-			isPre = ( startBlockTag == 'pre' );
-
-			if ( isPre )
-				lineBreak = doc.createText( CKEDITOR.env.ie ? '\r' : '\n' );
-			else
-				lineBreak = doc.createElement( 'br' );
-
-			range.deleteContents();
-			range.insertNode( lineBreak );
-
-			// A text node is required by Gecko only to make the cursor blink.
-			// We need some text inside of it, so the bogus <br> is properly
-			// created.
-			if ( !CKEDITOR.env.ie )
-				doc.createText( '\ufeff' ).insertAfter( lineBreak );
-
-			// If we are at the end of a block, we must be sure the bogus node is available in that block.
-			if ( isEndOfBlock && !CKEDITOR.env.ie )
-				lineBreak.getParent().appendBogus();
-
-			// Now we can remove the text node contents, so the caret doesn't
-			// stop on it.
-			if ( !CKEDITOR.env.ie )
-				lineBreak.getNext().$.nodeValue = '';
-			// IE has different behavior regarding position.
-			if ( CKEDITOR.env.ie )
-				range.setStartAt( lineBreak, CKEDITOR.POSITION_AFTER_END );
-			else
-				range.setStartAt( lineBreak.getNext(), CKEDITOR.POSITION_AFTER_START );
-
-			// Scroll into view, for non IE.
-			if ( !CKEDITOR.env.ie )
-			{
-				var dummy = null;
-
-				// BR is not positioned in Opera and Webkit.
-				if ( !CKEDITOR.env.gecko )
-				{
-					dummy = doc.createElement( 'span' );
-					// We need have some contents for Webkit to position it
-					// under parent node. ( #3681)
-					dummy.setHtml('&nbsp;');
-				}
-				else
-					dummy = doc.createElement( 'br' );
-
-				dummy.insertBefore( lineBreak.getNext() );
-				dummy.scrollIntoView();
-				dummy.remove();
-			}
-		}
-
-		// This collapse guarantees the cursor will be blinking.
-		range.collapse( true );
-
-		range.select( isPre );
-	}
 
 	function getRange( editor )
Index: /CKEditor/trunk/_source/plugins/fakeobjects/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/fakeobjects/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/fakeobjects/plugin.js	(revision 4774)
@@ -12,13 +12,13 @@
 			$ : function( element )
 			{
-				var realHtml = element.attributes._cke_realelement,
+				var attributes = element.attributes,
+					realHtml = attributes && attributes._cke_realelement,
 					realFragment = realHtml && new CKEDITOR.htmlParser.fragment.fromHtml( decodeURIComponent( realHtml ) ),
 					realElement = realFragment && realFragment.children[ 0 ];
 
-				if ( realElement )
+				// If we have width/height in the element, we must move it into
+				// the real element.
+				if ( realElement && element.attributes._cke_resizable )
 				{
-					// If we have width/height in the element, we must move it into
-					// the real element.
-
 					var style = element.attributes.style;
 
@@ -64,4 +64,5 @@
 {
 	var lang = this.lang.fakeobjects;
+
 	var attributes =
 	{
@@ -69,8 +70,11 @@
 		src : CKEDITOR.getUrl( 'images/spacer.gif' ),
 		_cke_realelement : encodeURIComponent( realElement.getOuterHtml() ),
+		_cke_real_node_type : realElement.type,
 		alt : lang[ realElementType ] || lang.unknown
 	};
+
 	if ( realElementType )
 		attributes._cke_real_element_type = realElementType;
+
 	if ( isResizable )
 		attributes._cke_resizable = isResizable;
@@ -81,10 +85,10 @@
 CKEDITOR.editor.prototype.createFakeParserElement = function( realElement, className, realElementType, isResizable )
 {
+	var lang = this.lang.fakeobjects, 
+		html, writer;
+
 	var writer = new CKEDITOR.htmlParser.basicWriter();
-
 	realElement.writeHtml( writer );
-
-	var html = writer.getHtml();
-	var lang = this.lang.fakeobjects;
+	html = writer.getHtml();
 
 	var attributes =
@@ -93,4 +97,5 @@
 		src : CKEDITOR.getUrl( 'images/spacer.gif' ),
 		_cke_realelement : encodeURIComponent( html ),
+		_cke_real_node_type : realElement.type,
 		alt : lang[ realElementType ] || lang.unknown
 	};
@@ -107,5 +112,9 @@
 CKEDITOR.editor.prototype.restoreRealElement = function( fakeElement )
 {
-	var html = decodeURIComponent( fakeElement.getAttribute( '_cke_realelement' ) );
-	return CKEDITOR.dom.element.createFromHtml( html, this.document );
+	if ( fakeElement.getAttribute( '_cke_real_node_type' ) != CKEDITOR.NODE_ELEMENT )
+		return null;
+
+	return CKEDITOR.dom.element.createFromHtml( 
+		decodeURIComponent( fakeElement.getAttribute( '_cke_realelement' ) ), 
+		this.document );
 };
Index: /CKEditor/trunk/_source/plugins/flash/dialogs/flash.js
===================================================================
--- /CKEditor/trunk/_source/plugins/flash/dialogs/flash.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/flash/dialogs/flash.js	(revision 4774)
@@ -174,5 +174,6 @@
 			makeEmbedTag = editor.config.flashAddEmbedTag || editor.config.flashEmbedTagOnly;
 
-		var previewAreaHtml = '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.image.preview ) +'<br>' +
+		var previewPreloader,
+			previewAreaHtml = '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.image.preview ) +'<br>' +
 			'<div id="FlashPreviewLoader" style="display:none"><div class="loading">&nbsp;</div></div>' +
 			'<div id="FlashPreviewBox"></div></div>';
@@ -186,4 +187,5 @@
 				// Clear previously saved elements.
 				this.fakeImage = this.objectNode = this.embedNode = null;
+				previewPreloader = new CKEDITOR.dom.element( 'embeded', editor.document );
 
 				// Try to detect any embed or object tag that has Flash parameters.
@@ -319,7 +321,8 @@
 												var dialog = this.getDialog(),
 												updatePreview = function( src ){
-
+													// Query the preloader to figure out the url impacted by based href.
+													previewPreloader.setAttribute( 'src', src );
 													dialog.preview.setHtml( '<embed height="100%" width="100%" src="'
-														+ CKEDITOR.tools.htmlEncode( src )
+														+ CKEDITOR.tools.htmlEncode( previewPreloader.getAttribute( 'src' ) )
 														+ '" type="application/x-shockwave-flash"></embed>' );
 												};
Index: /CKEditor/trunk/_source/plugins/font/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/font/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/font/plugin.js	(revision 4774)
@@ -37,5 +37,5 @@
 				panel :
 				{
-					css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ].concat( config.contentsCss ),
+					css : editor.skin.editor.css.concat( config.contentsCss ),
 					voiceLabel : lang.panelVoiceLabel
 				},
Index: /CKEditor/trunk/_source/plugins/format/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/format/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/format/plugin.js	(revision 4774)
@@ -34,5 +34,5 @@
 				panel :
 				{
-					css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ].concat( config.contentsCss ),
+					css : editor.skin.editor.css.concat( config.contentsCss ),
 					voiceLabel : lang.panelVoiceLabel
 				},
Index: /CKEditor/trunk/_source/plugins/htmldataprocessor/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/htmldataprocessor/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/htmldataprocessor/plugin.js	(revision 4774)
@@ -1,3 +1,3 @@
-﻿/*
+/*
 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
@@ -11,5 +11,4 @@
 
 	var protectedSourceMarker = '{cke_protected}';
-
 
 	// Return the last non-space child node of the block (#4344).
@@ -111,5 +110,7 @@
 
 				// All "_cke" attributes are to be ignored.
-				[ ( /^_cke.*/ ), '' ]
+				[ ( /^_cke.*/ ), '' ],
+
+				[ 'hidefocus', '' ]
 			],
 
@@ -118,9 +119,13 @@
 				$ : function( element )
 				{
-					// Remove duplicated attributes - #3789.
 					var attribs = element.attributes;
 
 					if ( attribs )
 					{
+						// Elements marked as temporary are to be ignored.
+						if ( attribs.cke_temp )
+							return false;
+
+						// Remove duplicated attributes - #3789.
 						var attributeNames = [ 'name', 'href', 'src' ],
 							savedAttributeName;
@@ -131,4 +136,6 @@
 						}
 					}
+
+					return element;
 				},
 
@@ -164,4 +171,19 @@
 						return false;
 					}
+				},
+
+				body : function( element )
+				{
+					delete element.attributes.spellcheck;
+					delete element.attributes.contenteditable;
+				},
+
+				style : function( element )
+				{
+					var child = element.children[ 0 ];
+					child && child.value && ( child.value = CKEDITOR.tools.trim( child.value ));
+
+					if ( !element.attributes.type )
+						element.attributes.type = 'text/css';
 				}
 			},
@@ -178,6 +200,15 @@
 			comment : function( contents )
 			{
+				// If this is a comment for protected source.
 				if ( contents.substr( 0, protectedSourceMarker.length ) == protectedSourceMarker )
-					return new CKEDITOR.htmlParser.cdata( decodeURIComponent( contents.substr( protectedSourceMarker.length ) ) );
+				{
+					// Remove the extra marker for real comments from it.
+					if ( contents.substr( protectedSourceMarker.length, 3 ) == '{C}' )
+						contents = contents.substr( protectedSourceMarker.length + 3 );
+					else
+						contents = contents.substr( protectedSourceMarker.length );
+
+					return new CKEDITOR.htmlParser.cdata( decodeURIComponent( contents ) );
+				}
 
 				return contents;
@@ -202,4 +233,12 @@
 	var protectAttributeRegex = /<(?:a|area|img|input)[\s\S]*?\s((?:href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi;
 
+	var protectElementsRegex = /(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
+		encodedElementsRegex = /<cke:encoded>([^<]*)<\/cke:encoded>/gi;
+
+	var protectElementNamesRegex = /(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,
+		unprotectElementNamesRegex = /(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi;
+
+	var protectSelfClosingRegex = /<cke:(param|embed)([\s\S]*?)\/?>/gi;
+
 	function protectAttributes( html )
 	{
@@ -207,22 +246,30 @@
 	}
 
-	var protectStyleTagsRegex = /<(style)(?=[ >])[^>]*>[^<]*<\/\1>/gi;
-	var encodedTagsRegex = /<cke:encoded>([^<]*)<\/cke:encoded>/gi;
-	var protectElementNamesRegex = /(<\/?)((?:object|embed|param)[\s\S]*?>)/gi;
-	var protectSelfClosingRegex = /<cke:(param|embed)([\s\S]*?)\/?>/gi;
-
-	function protectStyleTagsMatch( match )
-	{
-		return '<cke:encoded>' + encodeURIComponent( match ) + '</cke:encoded>';
-	}
-
-	function protectStyleTags( html )
-	{
-		return html.replace( protectStyleTagsRegex, protectStyleTagsMatch );
-	}
+	function protectElements( html )
+	{
+		return html.replace( protectElementsRegex, function( match )
+			{
+				return '<cke:encoded>' + encodeURIComponent( match ) + '</cke:encoded>';
+			});
+	}
+
+	function unprotectElements( html )
+	{
+		return html.replace( encodedElementsRegex, function( match, encoded )
+			{
+				return decodeURIComponent( encoded );
+			});
+	}
+
 	function protectElementsNames( html )
 	{
 		return html.replace( protectElementNamesRegex, '$1cke:$2');
 	}
+
+	function unprotectElementNames( html )
+	{
+		return html.replace( unprotectElementNamesRegex, '$1$2' );
+	}
+
 	function protectSelfClosingElements( html )
 	{
@@ -230,12 +277,21 @@
 	}
 
-	function unprotectEncodedTagsMatch( match, encoded )
-	{
-		return decodeURIComponent( encoded );
-	}
-
-	function unprotectEncodedTags( html )
-	{
-		return html.replace( encodedTagsRegex, unprotectEncodedTagsMatch );
+	function protectRealComments( html )
+	{
+		return html.replace( /<!--(?!{cke_protected})[\s\S]+?-->/g, function( match )
+			{
+				return '<!--' + protectedSourceMarker +
+						'{C}' +
+						encodeURIComponent( match ).replace( /--/g, '%2D%2D' ) +
+						'-->';
+			});
+	}
+
+	function unprotectRealComments( html )
+	{
+		return html.replace( /<!--{cke_protected}{C}([\s\S]+?)-->/g, function( match, data )
+			{
+				return decodeURIComponent( data );
+			});
 	}
 
@@ -243,11 +299,8 @@
 	{
 		var protectedHtml = [],
-			tempRegex = /<\!--\{cke_temp\}(\d*?)-->/g;
+			tempRegex = /<\!--\{cke_temp(comment)?\}(\d*?)-->/g;
+
 		var regexes =
 			[
-				// First of any other protection, we must protect all comments
-				// to avoid loosing them (of course, IE related).
-				(/<!--[\s\S]*?-->/g),
-
 				// Script tags will also be forced to be protected, otherwise
 				// IE will execute them.
@@ -259,4 +312,13 @@
 			.concat( protectRegexes );
 
+		// First of any other protection, we must protect all comments
+		// to avoid loosing them (of course, IE related).
+		// Note that we use a different tag for comments, as we need to
+		// transform them when applying filters.
+		data = data.replace( (/<!--[\s\S]*?-->/g), function( match )
+			{
+				return  '<!--{cke_tempcomment}' + ( protectedHtml.push( match ) - 1 ) + '-->';
+			});
+
 		for ( var i = 0 ; i < regexes.length ; i++ )
 		{
@@ -264,5 +326,5 @@
 				{
 					match = match.replace( tempRegex, 		// There could be protected source inside another one. (#3869).
-						function( $, id )
+						function( $, isComment, id )
 						{
 							return protectedHtml[ id ];
@@ -272,7 +334,8 @@
 				});
 		}
-		data = data.replace( tempRegex,	function( $, id )
+		data = data.replace( tempRegex,	function( $, isComment, id )
 			{
 				return '<!--' + protectedSourceMarker +
+						( isComment ? '{C}' : '' ) +
 						encodeURIComponent( protectedHtml[ id ] ).replace( /--/g, '%2D%2D' ) +
 						'-->';
@@ -322,25 +385,31 @@
 			data = protectAttributes( data );
 
-			// IE remvoes style tags from innerHTML. (#3710).
-			if ( CKEDITOR.env.ie )
-				data = protectStyleTags( data );
+			// Protect elements than can't be set inside a DIV. E.g. IE removes
+			// style tags from innerHTML. (#3710)
+			data = protectElements( data );
 
 			// Certain elements has problem to go through DOM operation, protect
-			// them by prefixing 'cke' namespace.(#3591)
+			// them by prefixing 'cke' namespace. (#3591)
 			data = protectElementsNames( data );
 
 			// All none-IE browsers ignore self-closed custom elements,
-			// protecting them into open-close.(#3591)
+			// protecting them into open-close. (#3591)
 			data = protectSelfClosingElements( data );
 
 			// Call the browser to help us fixing a possibly invalid HTML
 			// structure.
-			var div = document.createElement( 'div' );
+			var div = new CKEDITOR.dom.element( 'div' );
 			// Add fake character to workaround IE comments bug. (#3801)
-			div.innerHTML = 'a' + data;
-			data = div.innerHTML.substr( 1 );
-
-			if ( CKEDITOR.env.ie )
-				data = unprotectEncodedTags( data );
+			div.setHtml( 'a' + data );
+			data = div.getHtml().substr( 1 );
+
+			// Unprotect "some" of the protected elements at this point.
+			data = unprotectElementNames( data );
+
+			data = unprotectElements( data );
+
+			// Restore the comments that have been protected, in this way they
+			// can be properly filtered.
+			data = unprotectRealComments( data );
 
 			// Now use our parser to make further fixes to the structure, as
@@ -350,6 +419,10 @@
 
 			fragment.writeHtml( writer, this.dataFilter );
-
-			return writer.getHtml( true );
+			data = writer.getHtml( true );
+
+			// Protect the real comments again.
+			data = protectRealComments( data );
+
+			return data;
 		},
 
Index: /CKEditor/trunk/_source/plugins/htmlwriter/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/htmlwriter/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/htmlwriter/plugin.js	(revision 4774)
@@ -68,5 +68,5 @@
 		var dtd = CKEDITOR.dtd;
 
-		for ( var e in CKEDITOR.tools.extend( {}, dtd.$block, dtd.$listItem, dtd.$tableContent ) )
+		for ( var e in CKEDITOR.tools.extend( {}, dtd.$nonBodyContent, dtd.$block, dtd.$listItem, dtd.$tableContent ) )
 		{
 			this.setRules( e,
@@ -79,13 +79,27 @@
 				});
 		}
+
 		this.setRules( 'br',
 			{
 				breakAfterOpen : true
 			});
+
+		this.setRules( 'title',
+			{
+				indent : false,
+				breakAfterOpen : false
+			});
+
+		this.setRules( 'style',
+			{
+				indent : false,
+				breakBeforeClose : true
+			});
+
 		// Disable indentation on <pre>.
 		this.setRules( 'pre',
-		{
-		  indent: false
-		} );
+			{
+			  indent: false
+			});
 	},
 
@@ -263,5 +277,6 @@
 		 * </ul>
 		 *
-		 * All rules default to "false".
+		 * All rules default to "false". Each call to the function overrides
+		 * already present rules, leaving the undefined untouched.
 		 *
 		 * By default, all elements available in the {@link CKEDITOR.dtd.$block),
@@ -284,5 +299,10 @@
 		setRules : function( tagName, rules )
 		{
-			this._.rules[ tagName ] = rules;
+			var currentRules = this._.rules[ tagName ];
+			
+			if ( currentRules )
+				CKEDITOR.tools.extend( currentRules, rules, true );
+			else
+				this._.rules[ tagName ] = rules;
 		}
 	}
Index: /CKEditor/trunk/_source/plugins/image/dialogs/image.js
===================================================================
--- /CKEditor/trunk/_source/plugins/image/dialogs/image.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/image/dialogs/image.js	(revision 4774)
@@ -196,4 +196,6 @@
 	var imageDialog = function( editor, dialogType )
 	{
+		var previewPreloader;
+
 		var onImgLoadEvent = function()
 		{
@@ -316,4 +318,5 @@
 					this.imageElement =  editor.document.createElement( 'img' );
 
+				previewPreloader = new CKEDITOR.dom.element( 'img', editor.document );
 				// Dont show preview if no URL given.
 				if ( !CKEDITOR.tools.trim( this.getValueOf( 'info', 'txtUrl' ) ) )
@@ -493,6 +496,8 @@
 													original.on( 'abort', onImgLoadErrorEvent, dialog );
 													original.setAttribute( 'src', newUrl );
-													dialog.preview.setAttribute( 'src', newUrl );
-
+
+													// Query the preloader to figure out the url impacted by based href.
+													previewPreloader.setAttribute( 'src', newUrl );
+													dialog.preview.setAttribute( 'src', previewPreloader.$.src );
 													updatePreview( dialog );
 												}
@@ -1054,5 +1059,5 @@
 											'<div id="ImagePreviewBox">'+
 											'<a href="javascript:void(0)" target="_blank" onclick="return false;" id="previewLink">'+
-											'<img id="previewImage" src="" alt="" /></a>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. '+
+											'<img id="previewImage" alt="" /></a>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. '+
 											'Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, '+
 											'nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.' +
Index: /CKEditor/trunk/_source/plugins/link/dialogs/link.js
===================================================================
--- /CKEditor/trunk/_source/plugins/link/dialogs/link.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/link/dialogs/link.js	(revision 4774)
@@ -74,6 +74,8 @@
 		emailBodyRegex = /body=([^;?:@&=$,\/]*)/,
 		anchorRegex = /^#(.*)$/,
-		urlRegex = /^((?:http|https|ftp|news):\/\/)?(.*)$/,
-		selectableTargets = /^(_(?:self|top|parent|blank))$/;
+		urlRegex = /^(?!javascript)((?:http|https|ftp|news):\/\/)?(.*)$/,
+		selectableTargets = /^(_(?:self|top|parent|blank))$/,
+		encodedEmailLinkRegex = /^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,
+		functionCallProtectedEmailLinkRegex = /^javascript:([^(]+)\(([^)]+)\)$/;
 
 	var popupRegex =
@@ -84,28 +86,10 @@
 	{
 		var href = element ? ( element.getAttribute( '_cke_saved_href' ) || element.getAttribute( 'href' ) ) : '',
-			emailMatch = '',
-			anchorMatch = '',
-			urlMatch = false,
+			emailMatch,
+			anchorMatch,
+			urlMatch,
 			retval = {};
-
-		if ( href )
-		{
-			emailMatch = href.match( emailRegex );
-			anchorMatch = href.match( anchorRegex );
-			urlMatch = href.match( urlRegex );
-		}
-
-		// Load the link type and URL.
-		if ( emailMatch )
-		{
-			var subjectMatch = href.match( emailSubjectRegex ),
-				bodyMatch = href.match( emailBodyRegex );
-			retval.type = 'email';
-			retval.email = {};
-			retval.email.address = emailMatch[1];
-			subjectMatch && ( retval.email.subject = decodeURIComponent( subjectMatch[1] ) );
-			bodyMatch && ( retval.email.body = decodeURIComponent( bodyMatch[1] ) );
-		}
-		else if ( anchorMatch )
+		
+		if ( anchorMatch = href.match( anchorRegex ) )
 		{
 			retval.type = 'anchor';
@@ -113,5 +97,6 @@
 			retval.anchor.name = retval.anchor.id = anchorMatch[1];
 		}
-		else if ( href && urlMatch )		// urlRegex matches empty strings, so need to check for href as well.
+		// urlRegex matches empty strings, so need to check for href as well.
+		else if ( href && ( urlMatch = href.match( urlRegex ) ) )
 		{
 			retval.type = 'url';
@@ -119,4 +104,59 @@
 			retval.url.protocol = urlMatch[1];
 			retval.url.url = urlMatch[2];
+		}
+		// Protected email link as encoded string.
+		else if ( !emailProtection || emailProtection == 'encode' )
+		{
+			if( emailProtection == 'encode' )
+			{
+				href = href.replace( encodedEmailLinkRegex,
+						function ( match, protectedAddress, rest )
+						{
+							return 'mailto:' +
+							       String.fromCharCode.apply( String, protectedAddress.split( ',' ) ) +
+							       ( rest && unescapeSingleQuote( rest ) );
+						} );
+			}
+
+			emailMatch = href.match( emailRegex );
+
+			if( emailMatch )
+			{
+				var subjectMatch = href.match( emailSubjectRegex ),
+					bodyMatch = href.match( emailBodyRegex );
+
+				retval.type = 'email';
+				var email = ( retval.email = {} );
+				email.address = emailMatch[ 1 ];
+				subjectMatch && ( email.subject = decodeURIComponent( subjectMatch[ 1 ] ) );
+				bodyMatch && ( email.body = decodeURIComponent( bodyMatch[ 1 ] ) );
+			}
+		}
+		// Protected email link as function call.
+		else if( emailProtection )
+		{
+			href.replace( functionCallProtectedEmailLinkRegex, function( match, funcName, funcArgs )
+			{
+				if( funcName == compiledProtectionFunction.name )
+				{
+					retval.type = 'email';
+					var email = retval.email = {};
+
+					var paramRegex = /[^,\s]+/g,
+						paramQuoteRegex = /(^')|('$)/g,
+						paramsMatch = funcArgs.match( paramRegex ),
+						paramsMatchLength = paramsMatch.length,
+						paramName,
+						paramVal;
+
+					for ( var i = 0; i < paramsMatchLength; i++ )
+					{
+						paramVal = decodeURIComponent( unescapeSingleQuote( paramsMatch[ i ].replace( paramQuoteRegex, '' ) ) );
+						paramName = compiledProtectionFunction.params[ i ].toLowerCase();
+						email[ paramName ] = paramVal;
+					}
+					email.address = [ email.name, email.domain ].join( '@' );
+				}
+			} );
 		}
 		else
@@ -246,4 +286,70 @@
 	};
 
+	function unescapeSingleQuote( str )
+	{
+		return str.replace( /\\'/g, '\'' );
+	}
+
+	function escapeSingleQuote( str )
+	{
+		return str.replace( /'/g, '\\$&' );
+	}
+
+	var emailProtection = editor.config.emailProtection || '';
+
+	// Compile the protection function pattern.
+	if( emailProtection && emailProtection != 'encode' )
+	{
+		var compiledProtectionFunction = {};
+
+		emailProtection.replace( /^([^(]+)\(([^)]+)\)$/, function( match, funcName, params )
+		{
+			compiledProtectionFunction.name = funcName;
+			compiledProtectionFunction.params = [];
+			params.replace( /[^,\s]+/g, function( param )
+			{
+				compiledProtectionFunction.params.push( param );
+			} );
+		} );
+	}
+
+	function protectEmailLinkAsFunction( email )
+	{
+		var retval,
+			name = compiledProtectionFunction.name,
+			params = compiledProtectionFunction.params,
+			paramName,
+			paramValue;
+
+		retval = [ name, '(' ];
+		for ( var i = 0; i < params.length; i++ )
+		{
+			paramName = params[ i ].toLowerCase();
+			paramValue = email[ paramName ];
+
+			i > 0 && retval.push( ',' );
+			retval.push( '\'',
+						 paramValue ?
+						 escapeSingleQuote( encodeURIComponent( email[ paramName ] ) )
+						 : '', 
+						 '\'');
+		}
+		retval.push( ')' );
+		return retval.join( '' );
+	}
+
+	function protectEmailAddressAsEncodedString( address )
+	{
+		var charCode,
+			length = address.length,
+			encodedChars = [];
+		for ( var i = 0; i < length; i++ )
+		{
+			charCode = address.charCodeAt( i );
+			encodedChars.push( charCode );
+		}
+		return 'String.fromCharCode(' + encodedChars.join( ',' ) + ')';
+	}
+	
 	return {
 		title : editor.lang.link.title,
@@ -1042,5 +1148,6 @@
 				removeAttributes = [],
 				data = { href : attributes.href },
-				me = this, editor = this.getParentEditor();
+				me = this,
+				editor = this.getParentEditor();
 
 			this.commitContent( data );
@@ -1060,19 +1167,50 @@
 					break;
 				case 'email':
-					var address = ( data.email && data.email.address ),
-						subject = ( data.email && encodeURIComponent( data.email.subject || '' ) ),
-						body = ( data.email && encodeURIComponent( data.email.body || '' ) ),
-						linkList = [ 'mailto:', address ];
-					if ( subject || body )
-					{
-						var argList = [];
-						linkList.push( '?' );
-						subject && argList.push( 'subject=' + subject );
-						body && argList.push( 'body=' + body );
-						linkList.push( argList.join( '&' ) );
+
+					var linkHref,
+						email = data.email,
+						address = email.address;
+
+					switch( emailProtection )
+					{
+						case '' :
+						case 'encode' :
+						{
+							var subject = encodeURIComponent( email.subject || '' ),
+								body = encodeURIComponent( email.body || '' );
+
+							// Build the e-mail parameters first.
+							var argList = [];
+							subject && argList.push( 'subject=' + subject );
+							body && argList.push( 'body=' + body );
+							argList = argList.length ? '?' + argList.join( '&' ) : '';
+
+							if ( emailProtection == 'encode' )
+							{
+								linkHref = [ 'javascript:void(location.href=\'mailto:\'+',
+											 protectEmailAddressAsEncodedString( address ) ];
+								// parameters are optional.
+								argList && linkHref.push( '+\'', escapeSingleQuote( argList ), '\'' );
+
+								linkHref.push( ')' );
+							}
+							else
+								linkHref = [ 'mailto:', address, argList ];
+
+							break;
+						}
+						default :
+						{
+							// Separating name and domain.
+							var nameAndDomain = address.split( '@', 2 );
+							email.name = nameAndDomain[ 0 ];
+							email.domain = nameAndDomain[ 1 ];
+
+							linkHref = [ 'javascript:', protectEmailLinkAsFunction( email ) ];
+						}
 					}
-					attributes._cke_saved_href = linkList.join( '' );
+
+					attributes._cke_saved_href = linkHref.join( '' );
 					break;
-				default:
 			}
 
@@ -1219,3 +1357,23 @@
 		}
 	};
-} );
+} )
+
+/**
+ * The e-mail address anti-spam protection option.
+ * @name CKEDITOR.config.emailProtection
+ * @type {String}
+ * Two forms of protection could be choosed from :
+ * 1. The whole address parts ( name, domain with any other query string ) are assembled into a
+ *   function call pattern which invoke you own provided function, with the specified arguments.
+ * 2. Only the e-mail address is obfuscated into unicode code point sequences, replacement are
+ *   done by a String.fromCharCode() call.
+ * Note: Both approaches require JavaScript to be enabled.
+ * @default ''
+ * @example
+ *  config.emailProtection = '';
+ *  // href="mailto:tester@ckeditor.com?subject=subject&body=body"
+ *  config.emailProtection = 'encode';
+ *  // href="<a href=\"javascript:void(location.href=\'mailto:\'+String.fromCharCode(116,101,115,116,101,114,64,99,107,101,100,105,116,111,114,46,99,111,109)+\'?subject=subject&body=body\')\">e-mail</a>"
+ *  config.emailProtection = 'mt(NAME,DOMAIN,SUBJECT,BODY)';
+ *  // href="javascript:mt('tester','ckeditor.com','subject','body')"
+ */
Index: /CKEditor/trunk/_source/plugins/menu/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/menu/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/menu/plugin.js	(revision 4774)
@@ -138,5 +138,5 @@
 					panel = this._.panel = new CKEDITOR.ui.floatPanel( this.editor, CKEDITOR.document.getBody(),
 						{
-							css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ],
+							css : editor.skin.editor.css,
 							level : this._.level - 1,
 							className : editor.skinClass + ' cke_contextmenu'
@@ -382,3 +382,3 @@
 	'tablecell,tablecellproperties,tablerow,tablecolumn,table,'+
 	'anchor,link,image,flash,' +
-	'checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea';
+	'checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div';
Index: /CKEditor/trunk/_source/plugins/pagebreak/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/pagebreak/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/pagebreak/plugin.js	(revision 4774)
@@ -56,5 +56,6 @@
 						div : function( element )
 						{
-							var style = element.attributes.style,
+							var attributes = element.attributes
+								style = attributes && attributes.style,
 								child = style && element.children.length == 1 && element.children[ 0 ],
 								childStyle = child && ( child.name == 'span' ) && child.attributes.style;
Index: /CKEditor/trunk/_source/plugins/panel/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/panel/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/panel/plugin.js	(revision 4774)
@@ -161,5 +161,5 @@
 						// after <body>, so it (body) becames immediatelly
 						// available. (#3031)
-						'<link type="text/css" rel=stylesheet href="' + this.css.join( '"><link type="text/css" rel="stylesheet" href="' ) + '">' +
+						CKEDITOR.tools.buildStyleHtml( this.css ) +
 					'<\/html>' );
 				doc.$.close();
Index: /CKEditor/trunk/_source/plugins/pastefromword/filter/default.js
===================================================================
--- /CKEditor/trunk/_source/plugins/pastefromword/filter/default.js	(revision 4774)
+++ /CKEditor/trunk/_source/plugins/pastefromword/filter/default.js	(revision 4774)
@@ -0,0 +1,1089 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+(function()
+{
+	var fragmentPrototype = CKEDITOR.htmlParser.fragment.prototype,
+		elementPrototype = CKEDITOR.htmlParser.element.prototype;
+
+	fragmentPrototype.onlyChild = elementPrototype.onlyChild = function()
+	{
+		var children = this.children,
+			count = children.length,
+			firstChild = ( count == 1 ) && children[ 0 ];
+		return firstChild || null;
+	};
+
+	elementPrototype.removeAnyChildWithName = function( tagName )
+	{
+		var children = this.children,
+			childs = [],
+			child;
+
+		for ( var i = 0; i < children.length; i++ )
+		{
+			child = children[ i ];
+			if( !child.name )
+				continue;
+
+			if ( child.name == tagName )
+			{
+				childs.push( child );
+				children.splice( i--, 1 );
+			}
+			childs = childs.concat( child.removeAnyChildWithName( tagName ) );
+		}
+		return childs;
+	};
+
+	elementPrototype.getAncestor = function( tagNameRegex )
+	{
+		var parent = this.parent;
+		while ( parent && !( parent.name && parent.name.match( tagNameRegex ) ) )
+			parent = parent.parent;
+		return parent;
+	};
+
+	fragmentPrototype.firstChild = elementPrototype.firstChild = function( evaluator )
+	{
+		var child;
+		for ( var i = 0 ; i < this.children.length ; i++ )
+		{
+			child = this.children[ i ];
+			if ( evaluator( child ) )
+				return child;
+			else if ( child.name )
+			{
+				child = child.firstChild( evaluator );
+				if( child )
+					return child;
+				else
+					continue;
+			}
+		}
+	};
+
+	// Adding a (set) of styles to the element's attributes.
+	elementPrototype.addStyle = function( name, value, isPrepend )
+	{
+		var styleText, addingStyleText = '';
+		// name/value pair.
+		if ( typeof value == 'string' )
+			addingStyleText += name + ':' + value + ';';
+		else
+		{
+			// style literal.
+			if ( typeof name == 'object' )
+			{
+				for( var style in name )
+				{
+					if( name.hasOwnProperty( style) )
+						addingStyleText += style + ':' + name[ style ] + ';';
+				}
+				// Avoid CKPackager produce buggy output (#4695)
+				// TODO: Remove after CKPackager get fixed.
+				;
+			}
+			// raw style text form.
+			else
+				addingStyleText += name;
+
+			isPrepend = value;
+		}
+
+		if( !this.attributes )
+			this.attributes = {};
+
+		styleText = this.attributes.style || '';
+
+		styleText = ( isPrepend ?
+		              [ addingStyleText, styleText ]
+					  : [ styleText, addingStyleText ] ).join( ';' );
+
+		this.attributes.style = styleText.replace( /^;|;(?=;)/, '' );
+	};
+
+	/**
+	 * Return the DTD-valid parent tag names of the specified one.
+	 * @param tagName
+	 */
+	CKEDITOR.dtd.parentOf = function( tagName )
+	{
+		var result = {};
+		for ( var tag in this )
+		{
+			if ( tag.indexOf( '$' ) == -1 && this[ tag ][ tagName ] )
+				result[ tag ] = 1;
+		}
+		return result;
+	};
+
+	var cssLengthRelativeUnit = /^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz){1}?/i;
+	var emptyMarginRegex = /^(?:\b0[^\s]*\s*){1,4}$/;
+
+	CKEDITOR.plugins.pastefromword =
+	{
+		utils :
+		{
+			// Create a <cke:listbullet> which indicate an list item type.
+			createListBulletMarker : function ( bulletStyle, bulletText )
+			{
+				var marker = new CKEDITOR.htmlParser.element( 'cke:listbullet' ),
+					listType;
+
+				// TODO: Support more list style type from MS-Word.
+				if ( !bulletStyle )
+				{
+					bulletStyle = 'decimal';
+					listType = 'ol';
+				}
+				else if ( bulletStyle[ 2 ] )
+				{
+					if ( !isNaN( bulletStyle[ 1 ] ) )
+						bulletStyle = 'decimal';
+					// No way to distinguish between Roman numerals and Alphas,
+					// detect them as a whole.
+					else if ( /^[a-z]+$/.test( bulletStyle[ 1 ] ) )
+						bulletStyle = 'lower-alpha';
+					else if ( /^[A-Z]+$/.test( bulletStyle[ 1 ] ) )
+						bulletStyle = 'upper-alpha';
+					// Simply use decimal for the rest forms of unrepresentable
+					// numerals, e.g. Chinese...
+					else
+						bulletStyle = 'decimal';
+
+					listType = 'ol';
+				}
+				else
+				{
+					if ( /[l\u00B7\u2002]/.test( bulletStyle[ 1 ] ) ) //l·•
+						bulletStyle = 'disc';
+					else if ( /[\u006F\u00D8]/.test( bulletStyle[ 1 ] ) )  //oØ
+						bulletStyle = 'circle';
+					else if ( /[\u006E\u25C6]/.test( bulletStyle[ 1 ] ) ) //n◆
+						bulletStyle = 'square';
+					else
+						bulletStyle = 'disc';
+
+					listType = 'ul';
+				}
+
+				// Represent list type as CSS style.
+				marker.attributes =
+				{
+					'cke:listtype' : listType,
+					'style' : 'list-style-type:' + bulletStyle + ';'
+				};
+				marker.add( new CKEDITOR.htmlParser.text( bulletText ) );
+				return marker;
+			},
+
+			isListBulletIndicator : function( element )
+			{
+				var styleText = element.attributes && element.attributes.style;
+				if( /mso-list\s*:\s*Ignore/i.test( styleText ) )
+					return true;
+			},
+
+			isContainingOnlySpaces : function( element )
+			{
+				var text;
+				return ( ( text = element.onlyChild() )
+					    && /^(:?\s|&nbsp;)+$/.test( text.value ) );
+			},
+
+			resolveList : function( element )
+			{
+				// <cke:listbullet> indicate a list item.
+				var children = element.children,
+					attrs = element.attributes,
+					listMarker;
+
+				if ( ( listMarker = element.removeAnyChildWithName( 'cke:listbullet' ) )
+					  && listMarker.length
+					  && ( listMarker = listMarker[ 0 ] ) )
+				{
+					element.name = 'cke:li';
+
+					if ( attrs.style )
+					{
+						attrs.style = CKEDITOR.plugins.pastefromword.filters.stylesFilter(
+							[
+								// Text-indent is not representing list item level any more.
+								[ 'text-indent' ],
+								[ 'line-height' ],
+								// Resolve indent level from 'margin-left' value.
+								[ /^margin(:?-left)?$/, null, function( value )
+								{
+									// Be able to deal with component/short-hand form style.
+									var values = value.split( ' ' );
+									value = values[ 3 ] || values[ 1 ] || values [ 0 ];
+									attrs[ 'cke:indent' ] =
+										// Indent margin unit by 36pt.
+										Math.floor( parseInt( value ) / 36 );
+								} ]
+							] )( attrs.style, element ) || '' ;
+					}
+
+					// Inherit list-type-style from bullet.
+					var listBulletAttrs = listMarker.attributes,
+						listBulletStyle = listBulletAttrs.style;
+
+					element.addStyle( listBulletStyle );
+					CKEDITOR.tools.extend( attrs, listBulletAttrs );
+					return true;
+				}
+			},
+
+			// Convert various length units to 'px' in ignorance of DPI.
+			convertToPx : ( function ()
+			{
+				var calculator = CKEDITOR.dom.element.createFromHtml(
+								'<div style="position:absolute;left:-9999px;' +
+								'top:-9999px;margin:0px;padding:0px;border:0px;"' +
+								'></div>', CKEDITOR.document );
+				CKEDITOR.document.getBody().append( calculator );
+
+				return function( cssLength )
+				{
+					if( cssLength.indexOf( '%' ) == -1 )
+					{
+						calculator.setStyle( 'width', cssLength );
+						return calculator.$.clientWidth + 'px';
+					}
+					
+					return cssLength;
+				};
+			} )(),
+
+			listDtdParents : CKEDITOR.dtd.parentOf( 'ol' )
+		},
+
+		filters :
+		{
+				// Transform a normal list into flat list items only presentation.
+				// E.g. <ul><li>level1<ol><li>level2</li></ol></li> =>
+				// <cke:li cke:listtype="ul" cke:indent="1">level1</cke:li>
+				// <cke:li cke:listtype="ol" cke:indent="2">level2</cke:li>
+				flattenList : function( element )
+				{
+					var	attrs = element.attributes,
+						parent = element.parent;
+
+					var listStyleType,
+						indentLevel = 1;
+
+					// Resolve how many level nested.
+					while ( parent )
+					{
+						parent.attributes && parent.attributes[ 'cke:list'] && indentLevel++;
+						parent = parent.parent;
+					}
+
+					// All list items are of the same type.
+					switch ( attrs.type )
+					{
+						case 'a' :
+							listStyleType = 'lower-alpha';
+							break;
+						// TODO: Support more list style type from MS-Word.
+					}
+
+					var children = element.children,
+						child;
+
+					for ( var i = 0; i < children.length; i++ )
+					{
+						child = children[ i ];
+						var attributes = child.attributes;
+
+						if( child.name in CKEDITOR.dtd.$listItem )
+						{
+							var listItemChildren = child.children,
+								count = listItemChildren.length,
+								last = listItemChildren[ count - 1 ];
+
+							// Move out nested list.
+							if( last.name in CKEDITOR.dtd.$list )
+							{
+								children.splice( i + 1, 0, last );
+								last.parent = element;
+
+								// Remove the parent list item if it's just a holder.
+								if ( !--listItemChildren.length )
+									children.splice( i, 1 );
+							}
+
+							child.name = 'cke:li';
+							attributes[ 'cke:indent' ] = indentLevel;
+							attributes[ 'cke:listtype' ] = element.name;
+							listStyleType && child.addStyle( 'list-style-type', listStyleType, true );
+						}
+					}
+
+					delete element.name;
+
+					// We're loosing tag name here, signalize this element as a list.
+					attrs[ 'cke:list' ] = 1;
+				},
+
+				/**
+				 *  Try to collect all list items among the children and establish one
+				 *  or more HTML list structures for them.
+				 * @param element
+				 */
+				assembleList : function( element )
+				{
+					var children = element.children, child,
+							listItem,   // The current processing cke:li element.
+							listItemAttrs,
+							listType,   // Determine the root type of the list.
+							listItemIndent, // Indent level of current list item.
+							lastListItem, // The previous one just been added to the list.
+							list, parentList, // Current staging list and it's parent list if any.
+							indent;
+
+					for ( var i = 0; i < children.length; i++ )
+					{
+						child = children[ i ];
+
+						if ( 'cke:li' == child.name )
+						{
+							child.name = 'li';
+							listItem = child;
+							listItemAttrs = listItem.attributes;
+							listType = listItem.attributes[ 'cke:listtype' ];
+							// The indent attribute might not present.
+							listItemIndent = parseInt( listItemAttrs[ 'cke:indent' ] ) || 0;
+
+							// Ignore the 'list-style-type' attribute if it's matched with
+							// the list root element's default style type.
+							listItemAttrs.style && ( listItemAttrs.style =
+							        CKEDITOR.plugins.pastefromword.filters.stylesFilter(
+									[
+										[ 'list-style-type', listType == 'ol' ? 'decimal' : 'disc' ]
+									] )( listItemAttrs.style )
+									|| '' );
+
+							if ( !list )
+							{
+								parentList = list = new CKEDITOR.htmlParser.element( listType );
+								list.add( listItem );
+								children[ i ] = list;
+							}
+							else
+							{
+								if ( listItemIndent > indent )
+								{
+									parentList = list;
+									list = new CKEDITOR.htmlParser.element( listType );
+									list.add( listItem );
+									lastListItem.add( list );
+								}
+								else if ( listItemIndent < indent )
+								{
+									list = parentList;
+									parentList = list.parent ? list.parent.parent : list;
+									list.add( listItem );
+								}
+								else
+									list.add( listItem );
+
+								children.splice( i--, 1 );
+							}
+
+							lastListItem = listItem;
+							indent = listItemIndent;
+						}
+						else
+							list = null;
+					}
+				},
+			
+				/**
+				 * A simple filter which always rejecting.
+				 */
+				falsyFilter : function( value )
+				{
+					return false;
+				},
+
+				/**
+				 * A filter dedicated on the 'style' attribute filtering, e.g. dropping/replacing style properties.
+				 * @param styles {Array} in form of [ styleNameRegexp, styleValueRegexp,
+				 *  newStyleValue/newStyleGenerator, newStyleName ] where only the first
+				 *  parameter is mandatory.
+				 * @param whitelist {Boolean} Whether the {@param styles} will be considered as a white-list.
+				 */
+				stylesFilter : function( styles, whitelist )
+				{
+					return function( styleText, element )
+					{
+						 var rules = [];
+						// html-encoded quote might be introduced by 'font-family'
+						// from MS-Word which confused the following regexp. e.g.
+						//'font-family: &quot;Lucida, Console&quot;'
+						 styleText
+							.replace( /&quot;/g, '"' )
+							.replace( /\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,
+								 function( match, name, value )
+								 {
+									 name = name.toLowerCase();
+									 name == 'font-family' && ( value = value.replace( /["']/g, '' ) );
+
+									 var namePattern,
+										 valuePattern,
+										 newValue,
+										 newName;
+									 for( var i = 0 ; i < styles.length; i++ )
+									 {
+										if( styles[ i ] )
+										{
+											namePattern = styles[ i ][ 0 ];
+											valuePattern = styles[ i ][ 1 ];
+											newValue = styles[ i ][ 2 ];
+											newName = styles[ i ][ 3 ];
+
+											if ( name.match( namePattern )
+												 && ( !valuePattern || value.match( valuePattern ) ) )
+											{
+												name = newName || name;
+												whitelist && ( newValue = newValue || value );
+
+												if( typeof newValue == 'function' )
+													newValue = newValue( value, element );
+												if( typeof newValue == 'string' )
+													rules.push( [ name, newValue ] );
+												return;
+											}
+										}
+									 }
+									 
+									 !whitelist && rules.push( [ name, value ] );
+
+								 });
+
+						for ( var i = 0 ; i < rules.length ; i++ )
+							 rules[ i ] = rules[ i ].join( ':' );
+						return rules.length ?
+						         ( rules.join( ';' ) + ';' ) : false;
+					 };
+				},
+
+				/**
+				 * Migrate the element by decorate styles on it.
+				 * @param styleDefiniton
+				 * @param variables
+				 */
+				elementMigrateFilter : function ( styleDefiniton, variables )
+				{
+					return function( element )
+					{
+						var styleDef =
+								variables ?
+									new CKEDITOR.style( styleDefiniton, variables )._.definition
+									: styleDefiniton;
+						element.name = styleDef.element;
+						CKEDITOR.tools.extend( element.attributes, CKEDITOR.tools.clone( styleDef.attributes ) );
+						element.addStyle( CKEDITOR.style.getStyleText( styleDef ) );
+					}
+				},
+
+				/**
+				 * Migrate styles by creating a new nested stylish element.
+				 * @param styleDefinition
+				 */
+				styleMigrateFilter : function( styleDefinition, variableName )
+				{
+
+					var elementMigrateFilter = this.elementMigrateFilter;
+					return function( value, element )
+					{
+						// Build an stylish element first.
+						var styleElement = new CKEDITOR.htmlParser.element( null ),
+							variables = {};
+
+						variables[ variableName ] = value;
+						elementMigrateFilter( styleDefinition, variables )( styleElement );
+						// Place the new element inside the existing span.
+						styleElement.children = element.children;
+						element.children = [ styleElement ];
+					};
+				},
+
+				/**
+				 * A filter which remove cke-namespaced-attribute on
+				 * all none-cke-namespaced elements.
+				 * @param value
+				 * @param element
+				 */
+				bogusAttrFilter : function( value, element )
+				{
+					if( element.name.indexOf( 'cke:' ) == -1 )
+						return false;
+				},
+
+				/**
+				 * A filter which will be used to apply inline css style according the stylesheet
+				 * definition rules, is generated lazily when filtering.
+				 */
+				applyStyleFilter : null
+
+			},
+
+		getRules : function( editor )
+		{
+			var dtd = CKEDITOR.dtd,
+				blockLike = CKEDITOR.tools.extend( {}, dtd.$block, dtd.$listItem, dtd.$tableContent ),
+				config = editor.config,
+				filters = this.filters,
+				falsyFilter = filters.falsyFilter,
+				stylesFilter = filters.stylesFilter,
+				elementMigrateFilter = filters.elementMigrateFilter,
+				styleMigrateFilter = CKEDITOR.tools.bind( this.filters.styleMigrateFilter, this.filters ),
+				bogusAttrFilter = filters.bogusAttrFilter,
+				createListBulletMarker = this.utils.createListBulletMarker,
+				flattenList = filters.flattenList,
+				assembleList = filters.assembleList,
+				isListBulletIndicator = this.utils.isListBulletIndicator,
+				containsNothingButSpaces = this.utils.isContainingOnlySpaces,
+				resolveListItem = this.utils.resolveList,
+				convertToPx = this.utils.convertToPx,
+				listDtdParents = this.utils.listDtdParents,
+				removeFontStyles = config.pasteFromWordRemoveFontStyles !== false,
+				removeStyles = config.pasteFromWordRemoveStyles !== false;
+
+			return {
+
+				elementNames :
+				[
+					// Remove script, meta and link elements.
+					[ /meta|link|script/, '' ]
+				],
+
+				root : function( element )
+				{
+					element.filterChildren();
+					assembleList( element );
+				},
+				
+				elements :
+				{
+					'^' : function( element )
+					{
+						// Transform CSS style declaration to inline style.
+						var applyStyleFilter;
+						if ( CKEDITOR.env.gecko && ( applyStyleFilter = filters.applyStyleFilter ) )
+							applyStyleFilter( element );
+					},
+
+					$ : function( element )
+					{
+						var tagName = element.name || '',
+							attrs = element.attributes;
+
+						// Convert length unit of width/height on blocks to
+						// a more editor-friendly way (px).
+						if ( tagName in blockLike
+							&& attrs.style )
+						{
+							attrs.style = stylesFilter(
+										[ [ /^width|height$/, null, convertToPx ] ] )( attrs.style ) || '';
+						}
+
+						// Processing headings.
+						if ( tagName.match( /h\d/ ) )
+						{
+							element.filterChildren();
+							// Is the heading actually a list item?
+							if( resolveListItem( element ) )
+								return;
+
+							// Adapt heading styles to editor's convention.
+							elementMigrateFilter( config[ 'format_' + tagName ] )( element );
+						}
+						// Remove inline elements which contain only empty spaces.
+						else if ( tagName in dtd.$inline )
+						{
+							element.filterChildren();
+							if ( containsNothingButSpaces( element ) )
+								delete element.name;
+						}
+						// Remove element with ms-office namespace,
+						// with it's content preserved, e.g. 'o:p'. 
+						else if ( tagName.indexOf( ':' ) != -1
+								 && tagName.indexOf( 'cke' ) == -1 )
+						{
+							element.filterChildren();
+
+							// Restore image real link from vml.
+							if ( tagName == 'v:imagedata' )
+							{
+								var href = element.attributes[ 'o:href' ];
+								if ( href )
+									element.attributes.src = href;
+								element.name = 'img';
+								return;
+							}
+							delete element.name;
+						}
+
+						// Assembling list items into a whole list.
+						if ( tagName in listDtdParents )
+						{
+							element.filterChildren();
+							assembleList( element );
+						}
+					},
+
+					// We'll drop any style sheet, but Firefox conclude
+					// certain styles in a single style element, which are
+					// required to be changed into inline ones.
+					'style' : function( element )
+					{
+						if ( CKEDITOR.env.gecko )
+						{
+							// Grab only the style definition section.
+							var styleDefSection = element.onlyChild().value.match( /\/\* Style Definitions \*\/([\s\S]*?)\/\*/ ),
+								styleDefText = styleDefSection && styleDefSection[ 1 ],
+								rules = {}; // Storing the parsed result.
+
+							if ( styleDefText )
+							{
+								styleDefText
+									// Remove line-breaks.
+									.replace(/[\n\r]/g,'')
+									// Extract selectors and style properties.
+									.replace( /(.+?)\{(.+?)\}/g,
+										function( rule, selectors, styleBlock )
+										{
+											selectors = selectors.split( ',' );
+											var length = selectors.length, selector;
+											for ( var i = 0; i < length; i++ )
+											{
+												// Assume MS-Word mostly generate only simple
+												// selector( [Type selector][Class selector]).
+												CKEDITOR.tools.trim( selectors[ i ] )
+															  .replace( /^(\w+)(\.[\w-]+)?$/g,
+												function( match, tagName, className )
+												{
+													tagName = tagName || '*';
+													className = className.substring( 1, className.length );
+
+													// Reject MS-Word Normal styles.
+													if( className.match( /MsoNormal/ ) )
+														return;
+
+													if( !rules[ tagName ] )
+														rules[ tagName ] = {};
+													if( className )
+														rules[ tagName ][ className ] = styleBlock;
+													else
+														rules[ tagName ] = styleBlock;
+												} );
+											}
+										});
+
+								filters.applyStyleFilter = function( element )
+								{
+									var name = rules[ '*' ] ? '*' : element.name,
+										className = element.attributes && element.attributes[ 'class' ],
+										style;
+									if( name in rules )
+									{
+										style = rules[ name ];
+										if( typeof style == 'object' )
+											style = style[ className ];
+										// Maintain style rules priorities.
+										style && element.addStyle( style, true );
+									}
+								};
+							}
+						}
+						return false;
+					},
+
+					'p' : function( element )
+					{
+						element.filterChildren();
+
+						var attrs = element.attributes,
+							parent = element.parent,
+							children = element.children;
+
+						// Is the paragraph actually a list item?
+						if ( resolveListItem( element ) )
+							return;
+
+						// Adapt paragraph formatting to editor's convention
+						// according to enter-mode.
+						if ( config.enterMode == CKEDITOR.ENTER_BR )
+						{
+							// We suffer from attribute/style lost in this situation.
+							delete element.name;
+							element.add( new CKEDITOR.htmlParser.element( 'br' ) );
+						}
+						else
+							elementMigrateFilter( config[ 'format_' + ( config.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ) ] )( element );
+					},
+
+					'td' : function ( element )
+					{
+						// 'td' in 'thead' is actually <th>.
+						if ( element.getAncestor( 'thead') )
+							element.name = 'th';
+					},
+
+					// MS-Word sometimes present list as a mixing of normal list
+					// and pseudo-list, normalize the previous ones into pseudo form.
+					'ol' : flattenList,
+					'ul' : flattenList,
+					'dl' : flattenList,
+
+					'font' : function( element )
+					{
+						// IE/Safari: drop the font tag if it comes from list bullet text.
+						if ( !CKEDITOR.env.gecko && isListBulletIndicator( element.parent ) )
+						{
+							delete element.name;
+							return;
+						}
+
+						element.filterChildren();
+
+						var attrs = element.attributes,
+							styleText = attrs.style,
+							parent = element.parent;
+
+						if ( 'font' == parent.name )     // Merge nested <font> tags.
+						{
+							CKEDITOR.tools.extend( parent.attributes,
+									element.attributes );
+							styleText && parent.addStyle( styleText );
+							delete element.name;
+							return;
+						}
+						// Convert the merged into a span with all attributes preserved.
+						else
+						{
+							styleText = styleText || '';
+							// IE's having those deprecated attributes, normalize them.
+							if ( attrs.color )
+							{
+								attrs.color != '#000000' && ( styleText += 'color:' + attrs.color + ';' );
+								delete attrs.color;
+							}
+							if ( attrs.face )
+							{
+								styleText += 'font-family:' + attrs.face + ';';
+								delete attrs.face;
+							}
+							// TODO: Mapping size in ranges of xx-small,
+							// x-small, small, medium, large, x-large, xx-large.
+							if ( attrs.size )
+							{
+								styleText += 'font-size:' +
+								             ( attrs.size > 3 ? 'large'
+										             : ( attrs.size < 3 ? 'small' : 'medium' ) ) + ';';
+								delete attrs.size;
+							}
+
+							element.name = 'span';
+							element.addStyle( styleText );
+						}
+					},
+
+					'span' : function( element )
+					{
+						// IE/Safari: remove the span if it comes from list bullet text.
+						if ( !CKEDITOR.env.gecko && isListBulletIndicator( element.parent ) )
+							return false;
+
+						element.filterChildren();
+						if ( containsNothingButSpaces( element ) )
+						{
+							delete element.name;
+							return;
+						}
+
+						// For IE/Safari: List item bullet type is supposed to be indicated by
+						// the text of a span with style 'mso-list : Ignore' or an image.
+						if ( !CKEDITOR.env.gecko && isListBulletIndicator( element ) )
+						{
+							var listSymbolNode = element.firstChild( function( node )
+							{
+								return node.value || node.name == 'img';
+							});
+
+							var listSymbol =  listSymbolNode && ( listSymbolNode.value || 'l.' ),
+								listType = listSymbol.match( /^([^\s]+?)([.)]?)$/ );
+							return createListBulletMarker( listType, listSymbol );
+						}
+
+						// Update the src attribute of image element with href.
+						var children = element.children,
+							attrs = element.attributes,
+							styleText = attrs && attrs.style,
+							firstChild = children && children[ 0 ];
+
+						// Assume MS-Word mostly carry font related styles on <span>,
+						// adapting them to editor's convention.
+						if ( styleText )
+						{
+							attrs.style = stylesFilter(
+									[
+										// Drop 'inline-height' style which make lines overlapping.
+										[ 'line-height' ],
+										[ /^font-family$/, null, !removeFontStyles ? styleMigrateFilter( config[ 'font_style' ], 'family' ) : null ] ,
+										[ /^font-size$/, null, !removeFontStyles ? styleMigrateFilter( config[ 'fontSize_style' ], 'size' ) : null ] ,
+										[ /^color$/, null, !removeFontStyles ? styleMigrateFilter( config[ 'colorButton_foreStyle' ], 'color' ) : null ] ,
+										[ /^background-color$/, null, !removeFontStyles ? styleMigrateFilter( config[ 'colorButton_backStyle' ], 'color' ) : null ]
+									] )( styleText, element ) || '';
+						}
+
+					},
+
+					// Migrate basic style formats to editor configured ones.
+					'b' : elementMigrateFilter( config[ 'coreStyles_bold' ] ),
+					'i' : elementMigrateFilter( config[ 'coreStyles_italic' ] ),
+					'u' : elementMigrateFilter( config[ 'coreStyles_underline' ] ),
+					's' : elementMigrateFilter( config[ 'coreStyles_strike' ] ),
+					'sup' : elementMigrateFilter( config[ 'coreStyles_superscript' ] ),
+					'sub' : elementMigrateFilter( config[ 'coreStyles_subscript' ] ),
+					// Editor doesn't support anchor with content currently (#3582),
+					// drop such anchors with content preserved.
+					'a' : function( element )
+					{
+						var attrs = element.attributes;
+						if( attrs && !attrs.href && attrs.name )
+							delete element.name;
+					},
+					'cke:listbullet' : function( element )
+					{
+						if ( element.getAncestor( /h\d/ ) && !config.pasteFromWordNumberedHeadingToList )
+							delete element.name;
+						}
+				},
+
+				attributeNames :
+				[
+					// Remove onmouseover and onmouseout events (from MS Word comments effect)
+					[ /^onmouse(:?out|over)/, '' ],
+					// Onload on image element.
+					[ /^onload$/, '' ],
+					// Remove office and vml attribute from elements.
+					[ /(?:v|o):\w+/, '' ],
+					// Remove lang/language attributes.
+					[ /^lang/, '' ]
+				],
+
+				attributes :
+				{
+					'style' : stylesFilter(
+					removeStyles ?
+					// Provide a white-list of styles that we preserve, those should
+					// be the ones that could later be altered with editor tools.
+					[
+						[ /^margin$|^margin-(?!bottom|top)/, null, function( value, element )
+							{
+								if( element.name in { p : 1, div : 1 }
+									&& !emptyMarginRegex.test( value ) )
+									return value;
+							} ],
+
+						[ /^border.*|margin.*|vertical-align|float$/ , null,
+							function( value, element )
+							{
+								if( element.name == 'img' )
+									return value;
+							} ],
+
+						[ /^width|height$/, null,
+							function( value, element )
+							{
+								if( element.name in { table : 1, td : 1, th : 1, img : 1 } )
+									return value;
+							} ]
+					] :
+					// Otherwise provide a black-list of styles that we remove.
+					[
+						[ /^mso-/ ],
+						// Fixing color values.
+						[ /-color$/, null, function( value )
+						{
+							if( value == 'transparent' )
+								return false;
+							if( CKEDITOR.env.gecko )
+								return value.replace( /-moz-use-text-color/g, 'transparent' );
+						} ],
+						// Remove empty margin values, e.g. 0.00001pt 0em 0pt
+						[ /^margin$/, emptyMarginRegex ],
+						[ 'text-indent', '0cm' ],
+						[ 'page-break-before' ],
+						[ 'tab-stops' ],
+						[ 'display', 'none' ],
+						removeFontStyles ? [ /font-?/ ] : null,
+					], removeStyles ),
+
+					// Prefer width styles over 'width' attributes.
+					'width' : function( value, element )
+					{
+						if( element.name in dtd.$tableContent )
+							return false;
+					},
+					// Prefer border styles over table 'border' attributes.
+					'border' : function( value, element )
+					{
+						if( element.name in dtd.$tableContent )
+							return false;
+					},
+
+					// Only Firefox carry style sheet from MS-Word, which
+					// will be applied by us manually. For other browsers
+					// the css className is useless.
+					'class' : falsyFilter,
+
+					// MS-Word always generate 'background-color' along with 'bgcolor',
+					// simply drop the deprecated attributes.
+					'bgcolor' : falsyFilter,
+
+					// Deprecate 'valign' attribute in favor of 'vertical-align'.
+					'valign' : removeStyles ? falsyFilter : function( value, element )
+					{
+						element.addStyle( 'vertical-align', value );
+						return false;
+					}
+				},
+
+				// Fore none-IE, some useful data might be buried under these IE-conditional
+				// comments where RegExp were the right approach to dig them out where usual approach
+				// is transform it into a fake element node which hold the desired data.
+				comment : 
+					!CKEDITOR.env.ie ? 
+						function( value, node )
+						{
+							var imageInfo = value.match( /<img.*?>/ ),
+								listInfo = value.match( /^\[if !supportLists\]([\s\S]*?)\[endif\]$/ );
+
+							// Seek for list bullet indicator.
+							if ( listInfo )
+							{
+								// Bullet symbol could be either text or an image.
+								var listSymbol = listInfo[ 1 ] || ( imageInfo && 'l.' ),
+									listType = listSymbol && listSymbol.match( />([^\s]+?)([.)]?)</ );
+								return createListBulletMarker( listType, listSymbol );
+							}
+
+							// Reveal the <img> element in conditional comments for Firefox.
+							if( CKEDITOR.env.gecko && imageInfo )
+							{
+								var img = CKEDITOR.htmlParser.fragment.fromHtml( imageInfo[ 0 ] ).children[ 0 ],
+									previousComment = node.previous,
+									// Try to dig the real image link from vml markup from previous comment text.
+									imgSrcInfo = previousComment && previousComment.value.match( /<v:imagedata[^>]*o:href=['"](.*?)['"]/ ),
+									imgSrc = imgSrcInfo && imgSrcInfo[ 1 ];
+
+								// Is there a real 'src' url to be used? 
+								imgSrc && ( img.attributes.src = imgSrc );
+								return img;
+							}
+
+							return false;
+						} 
+					: falsyFilter
+			};
+		}
+	};
+
+	// The paste processor here is just a reduced copy of html data processor.
+	var pasteProcessor = function()
+	{
+		this.dataFilter = new CKEDITOR.htmlParser.filter();
+	};
+
+	pasteProcessor.prototype =
+	{
+		toHtml : function( data )
+		{
+			var fragment = CKEDITOR.htmlParser.fragment.fromHtml( data, false ),
+				writer = new CKEDITOR.htmlParser.basicWriter();
+
+			fragment.writeHtml( writer, this.dataFilter );
+			return writer.getHtml( true );
+		}
+	};
+
+	CKEDITOR.cleanWord = function( data, editor )
+	{
+		// Firefox will be confused by those downlevel-revealed IE conditional
+		// comments, fixing them first( convert it to upperlevel-revealed one ).
+		// e.g. <![if !vml]>...<![endif]>
+		if( CKEDITOR.env.gecko )
+			data = data.replace( /(<!--\[if[^<]*?\])-->([\S\s]*?)<!--(\[endif\]-->)/gi, '$1$2$3' );
+
+		var dataProcessor = new pasteProcessor(),
+			dataFilter = dataProcessor.dataFilter;
+
+		// These rules will have higher priorities than default ones.
+		dataFilter.addRules( CKEDITOR.plugins.pastefromword.getRules( editor ) );
+
+		// Allow extending data filter rules. 
+		editor.fire( 'beforeCleanWord', { filter : dataFilter } );
+
+		try
+		{
+			data = dataProcessor.toHtml( data, false );
+		}
+		catch ( e )
+		{
+			alert( editor.lang.pastefromword.error );
+		}
+
+		/* Below post processing those things that are unable to delivered by filter rules. */
+
+		// Remove 'cke' namespaced attribute used in filter rules as marker.
+		data = data.replace( /cke:.*?".*?"/g, '' );
+
+		// Remove empty style attribute.
+		data = data.replace( /style=""/g, '' );
+
+		// Remove the dummy spans ( having no inline style ).
+		data = data.replace( /<span>/g, '' );
+
+		return data;
+	};
+})();
+
+/**
+ * Whether the ignore all font-related format styles, including:
+ * - font size;
+ * - font family;
+ * - font fore/background color;
+ * @name CKEDITOR.config.pasteFromWordRemoveFontStyles
+ * @type Boolean
+ * @default true
+ * @example
+ * config.pasteFromWordRemoveFontStyles = false;
+ */
+
+/**
+ * Whether transform MS-Word Outline Numbered Heading into html list.
+ * @name CKEDITOR.config.pasteFromWordNumberedHeadingToList
+ * @type Boolean
+ * @default false
+ * @example
+ * config.pasteFromWordNumberedHeadingToList = true;
+ */
+
+/**
+ * Whether remove element styles that can't be managed with editor, note that this
+ * this doesn't handle the font-specific styles, which depends on
+ * how {@link CKEDITOR.config.pasteFromWordRemoveFontStyles} is configured. 
+ * @name CKEDITOR.config.pasteFromWordRemoveStyles
+ * @type Boolean
+ * @default true
+ * @example
+ * config.pasteFromWordRemoveStyles = false;
+ */
Index: /CKEditor/trunk/_source/plugins/pastefromword/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/pastefromword/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/pastefromword/plugin.js	(revision 4774)
@@ -3,52 +3,114 @@
 For licensing, see LICENSE.html or http://ckeditor.com/license
 */
+(function()
+{
+	CKEDITOR.plugins.add( 'pastefromword',
+	{
+		init : function( editor )
+		{
 
-CKEDITOR.plugins.add( 'pastefromword',
-{
-	init : function( editor )
-	{
-		// Register the command.
-		editor.addCommand( 'pastefromword', new CKEDITOR.dialogCommand( 'pastefromword' ) );
+			// Flag indicate this command is actually been asked instead of a generic
+			// pasting.
+			var forceFromWord = 0;
+			var resetFromWord = function()
+				{
+					setTimeout( function() { forceFromWord = 0; }, 0 );
+				};
 
-		// Register the toolbar button.
-		editor.ui.addButton( 'PasteFromWord',
+			// Features bring by this command beside the normal process:
+			// 1. No more bothering of user about the clean-up.
+			// 2. Perform the clean-up even if content is not from MS-Word.
+			// (e.g. from a MS-Word similar application.)
+			editor.addCommand( 'pastefromword',
 			{
-				label : editor.lang.pastefromword.toolbar,
-				command : 'pastefromword'
-			} );
+				canUndo : false,
+				exec : function()
+				{
+					forceFromWord = 1;
+					if( editor.execCommand( 'paste' ) === false )
+					{
+						editor.on( 'dialogHide', function ( evt )
+							{
+								evt.removeListener();
+								resetFromWord();
+							});
+					}
+				}
+			});
 
-		// Register the dialog.
-		CKEDITOR.dialog.add( 'pastefromword', this.path + 'dialogs/pastefromword.js' );
-	}
-} );
+			// Register the toolbar button.
+			editor.ui.addButton( 'PasteFromWord',
+				{
+					label : editor.lang.pastefromword.toolbar,
+					command : 'pastefromword'
+				});
+
+			editor.on( 'paste', function( evt )
+			{
+				var data = evt.data,
+					mswordHtml;
+				
+				// MS-WORD format sniffing.
+				if ( ( mswordHtml = data[ 'html' ] )
+					 && ( forceFromWord || /(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test( mswordHtml ) ) )
+				{
+					var isLazyLoad = this.loadFilterRules( function()
+						{
+							// Event continuation with the original data.
+							if ( isLazyLoad )
+								editor.fire( 'paste', data );
+							else if( !editor.config.pasteFromWordPromptCleanup
+							  || ( forceFromWord || confirm( editor.lang.pastefromword.confirmCleanup ) ) )
+							 {
+								data[ 'html' ] = CKEDITOR.cleanWord( mswordHtml, editor );
+							}
+						});
+
+					// The cleanup rules are to be loaded, we should just cancel
+					// this event.
+					isLazyLoad && evt.cancel();
+				}
+			}, this );
+		},
+
+		loadFilterRules : function( callback )
+		{
+
+			var isLoaded = CKEDITOR.cleanWord;
+
+			if ( isLoaded )
+				callback();
+			else
+			{
+				var filterFilePath = CKEDITOR.getUrl( 
+						CKEDITOR.config.pasteFromWordCleanupFile 
+						|| ( this.path + 'filter/default.js' ) );
+
+				// Load with busy indicator.
+				CKEDITOR.scriptLoader.load( filterFilePath, callback, null, false, true );
+			}
+
+			return !isLoaded;
+		}
+	});
+})();
 
 /**
- * Whether the "Ignore font face definitions" checkbox is enabled by default in
- * the Paste from Word dialog.
+ * Whether prompt the user about the clean-up of content from MS-Word.
+ * @name CKEDITOR.config.pasteFromWordPromptCleanup
  * @type Boolean
- * @default true
+ * @default undefined
  * @example
- * config.pasteFromWordIgnoreFontFace = false;
+ * config.pasteFromWordPromptCleanup = true;
  */
-CKEDITOR.config.pasteFromWordIgnoreFontFace = true;
 
 /**
- * Whether the "Remove styles definitions" checkbox is enabled by default in
- * the Paste from Word dialog.
- * @type Boolean
- * @default false
+ * The file that provides the MS-Word Filtering rules.
+ * Note: It's a global configuration which are shared by all editor instances.
+ * @name CKEDITOR.config.pasteFromWordCleanupFile
+ * @type String
+ * @default 'default'
  * @example
- * config.pasteFromWordRemoveStyle = true;
+ * // Load from 'pastefromword' plugin 'filter' sub folder (custom.js file).
+ * CKEDITOR.config.pasteFromWordCleanupFile = 'custom';
  */
-CKEDITOR.config.pasteFromWordRemoveStyle = false;
-
-/**
- * Whether to keep structure markup (&lt;h1&gt;, &lt;h2&gt;, etc.) or replace
- * it with elements that create more similar pasting results when pasting
- * content from Microsoft Word into the Paste from Word dialog.
- * @type Boolean
- * @default false
- * @example
- * config.pasteFromWordKeepsStructure = true;
- */
-CKEDITOR.config.pasteFromWordKeepsStructure = false;
Index: /CKEditor/trunk/_source/plugins/pastetext/dialogs/pastetext.js
===================================================================
--- /CKEditor/trunk/_source/plugins/pastetext/dialogs/pastetext.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/pastetext/dialogs/pastetext.js	(revision 4774)
@@ -24,7 +24,5 @@
 					// Get the textarea value.
 					var text = this.getContentElement( 'general', 'content' ).getInputElement().getValue();
-
-					// Inserts the text.
-					this.getParentEditor().insertText( text );
+					this.getParentEditor().fire( 'paste', { 'text' : text } );
 				},
 
Index: /CKEditor/trunk/_source/plugins/pastetext/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/pastetext/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/pastetext/plugin.js	(revision 4774)
@@ -1,3 +1,3 @@
-﻿/*
+/*
 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
@@ -15,15 +15,55 @@
 		exec : function( editor )
 		{
-			// We use getClipboardData just to test if the clipboard access has
-			// been granted by the user.
-			if ( CKEDITOR.getClipboardData() === false || !window.clipboardData )
+			var clipboardText = CKEDITOR.tools.tryThese(
+				function()
+				{
+					var clipboardText = window.clipboardData.getData( 'Text' );
+					if ( !clipboardText )
+						throw 0;
+					return clipboardText;
+				},
+				function()
+				{
+					netscape.security.PrivilegeManager.enablePrivilege( "UniversalXPConnect" );
+
+					var clip = Components.classes[ "@mozilla.org/widget/clipboard;1" ]
+							.getService( Components.interfaces.nsIClipboard );
+					var trans = Components.classes[ "@mozilla.org/widget/transferable;1" ]
+							.createInstance( Components.interfaces.nsITransferable );
+					trans.addDataFlavor( "text/unicode" );
+					clip.getData( trans, clip.kGlobalClipboard );
+
+					var str = {}, strLength = {}, clipboardText;
+					trans.getTransferData( "text/unicode", str, strLength );
+					str = str.value.QueryInterface( Components.interfaces.nsISupportsString );
+					clipboardText = str.data.substring( 0, strLength.value / 2 );
+					return clipboardText;
+				}
+				// Any other approach that's working... 
+				);
+			
+			if ( !clipboardText )   // Clipboard access privilege is not granted.
 			{
 				editor.openDialog( 'pastetext' );
-				return;
+				return false;
 			}
-
-			editor.insertText( window.clipboardData.getData( 'Text' ) );
+			else
+				editor.fire( 'paste', { 'text' : clipboardText } );
 		}
 	};
+
+	function doInsertText( doc, text )
+	{
+		// Native text insertion.
+		if( CKEDITOR.env.ie )
+		{
+			var selection = doc.selection;
+			if ( selection.type == 'Control' )
+				selection.clear();
+			selection.createRange().pasteHTML( text );
+		}
+		else
+			doc.execCommand( 'inserthtml', false, text );
+	}
 
 	// Register the plugin.
@@ -45,89 +85,80 @@
 			if ( editor.config.forcePasteAsPlainText )
 			{
-				editor.on( 'beforePaste', function( event )
+				// Intercept the default pasting process.
+				editor.on( 'beforeCommandExec', function ( evt )
+				{
+					if ( evt.data.name == 'paste' )
 					{
-						if ( editor.mode == "wysiwyg" )
-						{
-							setTimeout( function() { command.exec(); }, 0 );
-							event.cancel();
-						}
-					},
-					null, null, 20 );
+						editor.execCommand( 'pastetext' );
+						evt.cancel();
+					}
+				}, null, null, 0 );
 			}
 		},
+
 		requires : [ 'clipboard' ]
 	});
 
-	var clipboardDiv;
+	function doInsertText( doc, text )
+	{
+		// Native text insertion.
+		if( CKEDITOR.env.ie )
+		{
+			var selection = doc.selection;
+			if ( selection.type == 'Control' )
+				selection.clear();
+			selection.createRange().pasteHTML( text );
+		}
+		else
+			doc.execCommand( 'inserthtml', false, text );
+	}
 
-	CKEDITOR.getClipboardData = function()
+	function doEnter( editor, mode, times, forceMode )
 	{
-		if ( !CKEDITOR.env.ie )
-			return false;
+		while ( times-- )
+		{
+			CKEDITOR.plugins.enterkey[ mode == CKEDITOR.ENTER_BR ? 'enterBr' : 'enterBlock' ]
+					( editor, mode, null, forceMode );
+		}
+	}
 
-		var doc = CKEDITOR.document,
-			body = doc.getBody();
+	CKEDITOR.editor.prototype.insertText = function( text )
+	{
+		this.fire( 'saveSnapshot' );
 
-		if ( !clipboardDiv )
-		{
-			clipboardDiv = doc.createElement( 'div',
-				{
-					attributes :
-						{
-							id: 'cke_hiddenDiv'
-						},
-					styles :
-						{
-							position : 'absolute',
-							visibility : 'hidden',
-							overflow : 'hidden',
-							width : '1px',
-							height : '1px'
-						}
-				});
+		var mode = this.getSelection().getStartElement().hasAscendant( 'pre', true ) ? CKEDITOR.ENTER_BR : this.config.enterMode,
+			isEnterBrMode = mode == CKEDITOR.ENTER_BR,
+			doc = this.document.$,
+			self = this,
+			line;
 
-			clipboardDiv.setHtml( '' );
+		text = CKEDITOR.tools.htmlEncode( text.replace( /\r\n|\r/g, '\n' ) );
 
-			clipboardDiv.appendTo( body );
-		}
+		var startIndex = 0;
+		text.replace( /\n+/g, function( match, lastIndex )
+		 {
+			line = text.substring( startIndex, lastIndex );
+			startIndex = lastIndex + match.length;
+			line.length && doInsertText( doc, line );
 
-		// The "enabled" flag is used to check whether the paste operation has
-		// been completed (the onpaste event has been fired).
-		var	enabled = false;
-		var setEnabled = function()
-		{
-			enabled = true;
-		};
+			var lineBreakNums = match.length,
+				// Duo consequence line-break as a enter block.
+				enterBlockTimes = isEnterBrMode ? 0 : Math.floor( lineBreakNums / 2 ),
+				// Per link-break as a enter br.
+				enterBrTimes = isEnterBrMode ? lineBreakNums : lineBreakNums % 2;
 
-		body.on( 'paste', setEnabled );
+			// Line-breaks are converted to editor enter key strokes.
+			doEnter( self, mode, enterBlockTimes );
+			doEnter( self, CKEDITOR.ENTER_BR, enterBrTimes, isEnterBrMode ? false : true );
+		 });
 
-		// Create a text range and move it inside the div.
-		var textRange = body.$.createTextRange();
-		textRange.moveToElementText( clipboardDiv.$ );
+		// Insert the last text line of text.
+		line = text.substring( startIndex, text.length );
+		line.length && doInsertText( doc, line );
 
-		// The execCommand in will fire the "onpaste", only if the
-		// security settings are enabled.
-		textRange.execCommand( 'Paste' );
-
-		// Get the DIV html and reset it.
-		var html = clipboardDiv.getHtml();
-		clipboardDiv.setHtml( '' );
-
-		body.removeListener( 'paste', setEnabled );
-
-		// Return the HTML or false if not enabled.
-		return enabled && html;
+		this.fire( 'saveSnapshot' );
 	};
 })();
 
-CKEDITOR.editor.prototype.insertText = function( text )
-{
-	text = CKEDITOR.tools.htmlEncode( text );
-
-	// TODO: Replace the following with fill line break processing (see V2).
-	text = text.replace( /(?:\r\n)|\n|\r/g, '<br>' );
-
-	this.insertHtml( text );
-};
 
 /**
@@ -135,4 +166,5 @@
  * editor, loosing any formatting information possibly available in the source
  * text.
+ * @name CKEDITOR.config.forcePasteAsPlainText
  * @type Boolean
  * @default false
@@ -140,3 +172,2 @@
  * config.forcePasteAsPlainText = true;
  */
-CKEDITOR.config.forcePasteAsPlainText = false;
Index: /CKEditor/trunk/_source/plugins/preview/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/preview/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/preview/plugin.js	(revision 4774)
@@ -17,12 +17,18 @@
 		{
 			var sHTML,
+				config = editor.config,
+				baseTag = config.baseHref ? '<base href="' + config.baseHref + '"/>' : '',
 				isCustomDomain = CKEDITOR.env.isCustomDomain();
-			if ( editor.config.fullPage )
-				sHTML = editor.getData();
+
+			if ( config.fullPage )
+			{
+				sHTML = editor.getData()
+						.replace( /<head>/, '$&' + baseTag )
+						.replace( /[^>]*(?=<\/title>)/, editor.lang.preview );
+			}
 			else
 			{
 				var bodyHtml = '<body ',
-					body = CKEDITOR.document.getBody(),
-					baseTag = ( editor.config.baseHref.length > 0 ) ? '<base href="' + editor.config.baseHref + '" _cktemp="true"></base>' : '';
+						body = editor.document.getBody();
 
 				if ( body.getAttribute( 'id' ) )
@@ -38,7 +44,5 @@
 					baseTag +
 					'<title>' + editor.lang.preview + '</title>' +
-					'<link type="text/css" rel="stylesheet" href="' +
-					[].concat( editor.config.contentsCss ).join( '"><link type="text/css" rel="stylesheet" href="' ) +
-					'">' +
+					CKEDITOR.tools.buildStyleHtml( editor.config.contentsCss ) +
 					'</head>' + bodyHtml +
 					editor.getData() +
Index: /CKEditor/trunk/_source/plugins/selection/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/selection/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/selection/plugin.js	(revision 4774)
@@ -942,4 +942,12 @@
 			return this;
 		},
+		
+		getCommonAncestor : function()
+		{
+			var ranges = this.getRanges(),
+				startNode = ranges[ 0 ].startContainer,
+				endNode = ranges[ ranges.length - 1 ].endContainer;
+			return startNode.getCommonAncestor( endNode );
+		},
 
 		// Moving scroll bar to the current selection's start position.
Index: /CKEditor/trunk/_source/plugins/showborders/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/showborders/plugin.js	(revision 4774)
+++ /CKEditor/trunk/_source/plugins/showborders/plugin.js	(revision 4774)
@@ -0,0 +1,171 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @fileOverview The "show border" plugin. The command display visible outline
+ * border line around all table elements if table doesn't have a none-zero 'border' attribute specified.
+ */
+
+(function()
+{
+	var showBorderClassName = 'cke_show_border',
+		cssStyleText,
+		cssTemplate =
+		// TODO: For IE6, we don't have child selector support,
+		// where nested table cells could be incorrect.
+		( CKEDITOR.env.ie6Compat ?
+		  [
+			'.%1 table.%2,',
+			 '.%1 table.%2 td, .%1 table.%2 th,',
+			 '{',
+				'border : #d3d3d3 1px dotted',
+			 '}'
+		  ] :
+		  [
+			 '.%1 table.%2,',
+			 '.%1 table.%2 > tr > td, .%1 table.%2 > tr > th,',
+			 '.%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,',
+			 '.%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,',
+			 '.%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th',
+			 '{',
+				'border : #d3d3d3 1px dotted',
+			 '}'
+		  ] ).join( '' );
+
+	cssStyleText = cssTemplate.replace( /%2/g, showBorderClassName ).replace( /%1/g, 'cke_show_borders ' );
+
+	var commandDefinition =
+	{
+		preserveState : true,
+		editorFocus : false,
+
+		exec : function ( editor )
+		{
+			this.toggleState();
+			this.refresh( editor );
+		},
+
+		refresh : function( editor )
+		{
+			var funcName = ( this.state == CKEDITOR.TRISTATE_ON ) ? 'addClass' : 'removeClass';
+			editor.document.getBody()[ funcName ]( 'cke_show_borders' );
+		}
+	};
+
+	CKEDITOR.plugins.add( 'showborders',
+	{
+		requires : [ 'wysiwygarea' ],
+		modes : { 'wysiwyg' : 1 },
+
+		init : function( editor )
+		{
+
+			var command = editor.addCommand( 'showborders', commandDefinition );
+			command.canUndo = false;
+
+			if ( editor.config.startupShowBorders != false )
+				command.setState( CKEDITOR.TRISTATE_ON );
+
+			editor.addCss( cssStyleText );
+			
+			// Refresh the command on setData.
+			editor.on( 'mode', function()
+				{
+					if ( command.state != CKEDITOR.TRISTATE_DISABLED )
+						command.refresh( editor );
+				}, null, null, 100 );
+
+			// Refresh the command on wysiwyg frame reloads.
+			editor.on( 'contentDom', function()
+				{
+					if ( command.state != CKEDITOR.TRISTATE_DISABLED )
+						command.refresh( editor );
+				});
+		},
+
+		afterInit : function( editor )
+		{
+			var dataProcessor = editor.dataProcessor,
+				dataFilter = dataProcessor && dataProcessor.dataFilter,
+				htmlFilter = dataProcessor && dataProcessor.htmlFilter;
+
+			if ( dataFilter )
+			{
+				dataFilter.addRules(
+					{
+						elements :
+						{
+							'table' : function( element )
+							{
+								var attributes = element.attributes,
+									cssClass = attributes[ 'class' ],
+									border = parseInt( attributes.border );
+
+								if ( !border || border <= 0 )
+									attributes[ 'class' ] = ( cssClass || '' ) + ' ' + showBorderClassName;
+							}
+						}
+					} );
+			}
+
+			if( htmlFilter )
+			{
+				htmlFilter.addRules(
+				{
+					elements :
+					{
+						'table' : function( table )
+						{
+							var attributes = table.attributes,
+								cssClass = attributes[ 'class' ];
+
+							cssClass && ( attributes[ 'class' ] =
+							              cssClass.replace( showBorderClassName, '' )
+									              .replace( /\s{2}/, ' ' )
+												  .replace( /^\s+|\s+$/, '' ) );
+						}
+					}
+				} );
+			}
+
+			// Table dialog must be aware of it.
+			CKEDITOR.on( 'dialogDefinition', function( ev )
+				{
+					if( ev.editor != editor )
+						return;
+
+					var dialogName = ev.data.name;
+
+					if ( dialogName == 'table' || dialogName == 'tableProperties' )
+					{
+						var dialogDefinition = ev.data.definition,
+							infoTab = dialogDefinition.getContents( 'info' ),
+							borderField = infoTab.get( 'txtBorder' ),
+							originalCommit = borderField.commit;
+
+						borderField.commit = CKEDITOR.tools.override( originalCommit, function( org )
+						{
+							return function( data, selectedTable )
+							{
+								org.apply( this, arguments );
+								var value = parseInt( this.getValue() );
+								selectedTable[ ( !value || value <= 0 ) ? 'addClass' : 'removeClass' ]( showBorderClassName );
+							}
+						} );
+					}
+				});
+		}
+
+	});
+} )();
+
+/**
+ * Whether to automatically enable the "show borders" command when the editor loads.
+ * @type Boolean
+ * @default true
+ * @example
+ * config.startupShowBorders = false;
+ */
+
Index: /CKEditor/trunk/_source/plugins/styles/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/styles/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/styles/plugin.js	(revision 4774)
@@ -199,6 +199,6 @@
 							continue;
 
-						var elementAttr = element.getAttribute( attName );
-						if ( attribs[attName] ==
+						var elementAttr = element.getAttribute( attName ) || '';
+						if ( attribs[ attName ] ==
 							 ( attName == 'style' ?
 							   normalizeCssText( elementAttr, false ) : elementAttr  ) )
Index: /CKEditor/trunk/_source/plugins/stylescombo/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/stylescombo/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/stylescombo/plugin.js	(revision 4774)
@@ -27,5 +27,5 @@
 					panel :
 					{
-						css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ].concat( config.contentsCss ),
+						css : editor.skin.editor.css.concat( config.contentsCss ),
 						voiceLabel : lang.panelVoiceLabel
 					},
Index: /CKEditor/trunk/_source/plugins/tabletools/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/tabletools/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/tabletools/plugin.js	(revision 4774)
@@ -87,156 +87,4 @@
 	}
 
-	function createTableMap( $refCell )
-	{
-		var refCell = new CKEDITOR.dom.element( $refCell );
-		var $table = ( refCell.getName() == 'table' ? $refCell : refCell.getAscendant( 'table' ) ).$;
-		var $rows = $table.rows;
-
-		// Row and column counters.
-		var r = -1;
-		var map = [];
-		for ( var i = 0 ; i < $rows.length ; i++ )
-		{
-			r++;
-			if ( !map[ r ] )
-				map[ r ] = [];
-
-			var c = -1;
-
-			for ( var j = 0 ; j < $rows[ i ].cells.length ; j++ )
-			{
-				var $cell = $rows[ i ].cells[ j ];
-
-				c++;
-				while ( map[ r ][ c ] )
-					c++;
-
-				var colSpan = isNaN( $cell.colSpan ) ? 1 : $cell.colSpan;
-				var rowSpan = isNaN( $cell.rowSpan ) ? 1 : $cell.rowSpan;
-
-				for ( var rs = 0 ; rs < rowSpan ; rs++ )
-				{
-					if ( !map[ r + rs ] )
-						map[ r + rs ] = [];
-
-					for ( var cs = 0 ; cs < colSpan ; cs++ )
-						map [ r + rs ][ c + cs ] = $rows[ i ].cells[ j ];
-				}
-
-				c += colSpan - 1;
-			}
-		}
-
-		return map;
-	}
-
-	function installTableMap( tableMap, $table )
-	{
-		/*
-		 * IE BUG: rowSpan is always 1 in IE if the cell isn't attached to a row. So
-		 * store is separately in another attribute. (#1917)
-		 */
-		var rowSpanAttr = CKEDITOR.env.ie ? '_cke_rowspan' : 'rowSpan';
-
-		/*
-		 * Disconnect all the cells in tableMap from their parents, set all colSpan
-		 * and rowSpan attributes to 1.
-		 */
-		for ( var i = 0 ; i < tableMap.length ; i++ )
-		{
-			for ( var j = 0 ; j < tableMap[ i ].length ; j++ )
-			{
-				var $cell = tableMap[ i ][ j ];
-				if ( $cell.parentNode )
-					$cell.parentNode.removeChild( $cell );
-				$cell.colSpan = $cell[ rowSpanAttr ] = 1;
-			}
-		}
-
-		// Scan by rows and set colSpan.
-		var maxCol = 0;
-		for ( i = 0 ; i < tableMap.length ; i++ )
-		{
-			for ( j = 0 ; j < tableMap[ i ].length ; j++ )
-			{
-				$cell = tableMap[ i ][ j ];
-				if ( !$cell )
-					continue;
-				if ( j > maxCol )
-					maxCol = j;
-				if ( $cell[ '_cke_colScanned' ] )
-					continue;
-				if ( tableMap[ i ][ j - 1 ] == $cell )
-					$cell.colSpan++;
-				if ( tableMap[ i ][ j + 1 ] != $cell )
-					$cell[ '_cke_colScanned' ] = 1;
-			}
-		}
-
-		// Scan by columns and set rowSpan.
-		for ( i = 0 ; i <= maxCol ; i++ )
-		{
-			for ( j = 0 ; j < tableMap.length ; j++ )
-			{
-				if ( !tableMap[ j ] )
-					continue;
-				$cell = tableMap[ j ][ i ];
-				if ( !$cell || $cell[ '_cke_rowScanned' ] )
-					continue;
-				if ( tableMap[ j - 1 ] && tableMap[ j - 1 ][ i ] == $cell )
-					$cell[ rowSpanAttr ]++;
-				if ( !tableMap[ j + 1 ] || tableMap[ j + 1 ][ i ] != $cell  )
-					$cell[ '_cke_rowScanned' ] = 1;
-			}
-		}
-
-		// Clear all temporary flags.
-		for ( i = 0 ; i < tableMap.length ; i++ )
-		{
-			for ( j = 0 ; j < tableMap[ i ].length ; j++ )
-			{
-				$cell = tableMap[ i ][ j ];
-				removeRawAttribute( $cell, '_cke_colScanned' );
-				removeRawAttribute( $cell, '_cke_rowScanned' );
-			}
-		}
-
-		// Insert physical rows and columns to table.
-		for ( i = 0 ; i < tableMap.length ; i++ )
-		{
-			var $row = $table.ownerDocument.createElement( 'tr' );
-			for ( j = 0 ; j < tableMap[ i ].length ; )
-			{
-				$cell = tableMap[ i ][ j ];
-				if ( tableMap[ i - 1 ] && tableMap[ i - 1 ][ j ] == $cell )
-				{
-					j += $cell.colSpan;
-					continue;
-				}
-				$row.appendChild( $cell );
-				if ( rowSpanAttr != 'rowSpan' )
-				{
-					$cell.rowSpan = $cell[ rowSpanAttr ];
-					$cell.removeAttribute( rowSpanAttr );
-				}
-				j += $cell.colSpan;
-				if ( $cell.colSpan == 1 )
-					$cell.removeAttribute( 'colSpan' );
-				if ( $cell.rowSpan == 1 )
-					$cell.removeAttribute( 'rowSpan' );
-			}
-
-			if ( CKEDITOR.env.ie )
-				$table.rows[ i ].replaceNode( $row );
-			else
-			{
-				var dest = new CKEDITOR.dom.element( $table.rows[ i ] );
-				var src = new CKEDITOR.dom.element( $row );
-				dest.setHtml( '' );
-				src.moveChildren( dest );
-			}
-		}
-	}
-
 	function clearRow( $tr )
 	{
@@ -417,4 +265,359 @@
 	}
 
+	// Remove filler at end and empty spaces around the cell content.
+	function trimCell( cell )
+	{
+		var bogus = cell.getBogus();
+		bogus && bogus.remove();
+		cell.trim();
+	}
+
+	function placeCursorInCell( cell, placeAtEnd )
+	{
+		var range = new CKEDITOR.dom.range( cell.getDocument() );
+		if ( !range[ 'moveToElementEdit' + ( placeAtEnd ? 'End' : 'Start' ) ]( cell ) )
+		{
+			range.selectNodeContents( cell );
+			range.collapse( placeAtEnd ? false : true );
+		}
+		range.select( true );
+	}
+
+	function buildTableMap( table )
+	{
+
+		var aRows = table.$.rows ;
+
+		// Row and Column counters.
+		var r = -1 ;
+
+		var aMap = [];
+
+		for ( var i = 0 ; i < aRows.length ; i++ )
+		{
+			r++ ;
+			!aMap[r] && ( aMap[r] = [] );
+
+			var c = -1 ;
+
+			for ( var j = 0 ; j < aRows[i].cells.length ; j++ )
+			{
+				var oCell = aRows[i].cells[j] ;
+
+				c++ ;
+				while ( aMap[r][c] )
+					c++ ;
+
+				var iColSpan = isNaN( oCell.colSpan ) ? 1 : oCell.colSpan ;
+				var iRowSpan = isNaN( oCell.rowSpan ) ? 1 : oCell.rowSpan ;
+
+				for ( var rs = 0 ; rs < iRowSpan ; rs++ )
+				{
+					if ( !aMap[r + rs] )
+						aMap[r + rs] = new Array() ;
+
+					for ( var cs = 0 ; cs < iColSpan ; cs++ )
+					{
+						aMap[r + rs][c + cs] = aRows[i].cells[j] ;
+					}
+				}
+
+				c += iColSpan - 1 ;
+			}
+		}
+		return aMap ;
+	}
+
+	function cellInRow( tableMap, rowIndex, cell )
+	{
+		var oRow = tableMap[ rowIndex ];
+		if( typeof cell == 'undefined' )
+			return oRow;
+
+		for ( var c = 0 ; oRow && c < oRow.length ; c++ )
+		{
+			if ( cell.is && oRow[c] == cell.$ )
+				return c;
+			else if( c == cell )
+				return new CKEDITOR.dom.element( oRow[ c ] );
+		}
+		return cell.is ? -1 : null;
+	}
+
+	function cellInCol( tableMap, colIndex, cell )
+	{
+		var oCol = [];
+		for ( var r = 0; r < tableMap.length; r++ )
+		{
+			var row = tableMap[ r ];
+			if( typeof cell == 'undefined' )
+				oCol.push( row[ colIndex ] );
+			else if( cell.is && row[ colIndex ] == cell.$ )
+				return r;
+			else if( r == cell )
+				return new CKEDITOR.dom.element( row[ colIndex ] );
+		}
+		
+		return ( typeof cell == 'undefined' )? oCol : cell.is ? -1 :  null;
+	}
+
+	function mergeCells( selection, mergeDirection, isDetect )
+	{
+		var cells = getSelectedCells( selection );
+
+		// Invalid merge request if:
+		// 1. In batch mode despite that less than two selected.
+		// 2. In solo mode while not exactly only one selected.    
+		// 3. Cells distributed in different table groups (e.g. from both thead and tbody).
+		if( ( mergeDirection ? cells.length != 1 : cells.length < 2 ) 
+			 || selection.getCommonAncestor().is( 'table' ) )
+			return false;
+
+		var	cell,
+			firstCell = cells[ 0 ],
+			table = firstCell.getAscendant( 'table' ),
+			map = buildTableMap( table ),
+			mapHeight = map.length,
+			mapWidth = map[ 0 ].length,
+			startRow = firstCell.getParent().$.rowIndex,
+			startColumn = cellInRow( map, startRow, firstCell );
+
+		if( mergeDirection )
+		{
+			var targetCell;
+			try
+			{
+				targetCell =
+					map[ mergeDirection == 'up' ?
+							( startRow - 1 ):
+							mergeDirection == 'down' ? ( startRow + 1 ) : startRow  ] [
+						 mergeDirection == 'left' ?
+							( startColumn - 1 ):
+						 mergeDirection == 'right' ?  ( startColumn + 1 ) : startColumn ];
+
+			}
+			catch( er )
+			{
+				return false;
+			}
+
+			// 1. No cell could be merged.
+			// 2. Same cell actually.
+			if( !targetCell || firstCell.$ == targetCell  )
+				return false;
+
+			// Sort in map order regardless of the DOM sequence.
+			cells[ ( mergeDirection == 'up' || mergeDirection == 'left' ) ?
+			         'unshift' : 'push' ]( new CKEDITOR.dom.element( targetCell ) );
+		}
+
+		// Start from here are merging way ignorance (merge up/right, batch merge).
+		var	doc = firstCell.getDocument(),
+			lastRowIndex = startRow,
+			totalRowSpan = 0,
+			totalColSpan = 0,
+			// Use a documentFragment as buffer when appending cell contents.
+			frag = !isDetect && new CKEDITOR.dom.documentFragment( doc ),
+			dimension = 0;
+
+		for ( var i = 0; i < cells.length; i++ )
+		{
+			cell = cells[ i ];
+
+			var tr = cell.getParent(),
+				cellFirstChild = cell.getFirst(),
+				colSpan = cell.$.colSpan,
+				rowSpan = cell.$.rowSpan,
+				rowIndex = tr.$.rowIndex,
+				colIndex = cellInRow( map, rowIndex, cell );
+
+			// Accumulated the actual places taken by all selected cells.
+			dimension += colSpan * rowSpan;
+			// Accumulated the maximum virtual spans from column and row.
+			totalColSpan = Math.max( totalColSpan, colIndex - startColumn + colSpan ) ;
+			totalRowSpan = Math.max( totalRowSpan, rowIndex - startRow + rowSpan );
+
+			if ( !isDetect )
+			{
+				// Trim all cell fillers and check to remove empty cells.
+				if( trimCell( cell ), cell.getChildren().count() )
+				{
+					// Merge vertically cells as two separated paragraphs.
+					if( rowIndex != lastRowIndex
+						&& cellFirstChild
+						&& !( cellFirstChild.isBlockBoundary
+							  && cellFirstChild.isBlockBoundary( { br : 1 } ) ) )
+					{
+						var last = frag.getLast( CKEDITOR.dom.walker.whitespaces( true ) );
+						if( last && !( last.is && last.is( 'br' ) ) )
+							frag.append( new CKEDITOR.dom.element( 'br' ) );
+					}
+
+					cell.moveChildren( frag );
+				}
+				i ? cell.remove() : cell.setHtml( '' );
+			}
+			lastRowIndex = rowIndex;
+		}
+
+		if ( !isDetect )
+		{
+			frag.moveChildren( firstCell );
+
+			if( !CKEDITOR.env.ie )
+				firstCell.appendBogus();
+
+			if( totalColSpan >= mapWidth )
+				firstCell.removeAttribute( 'rowSpan' );
+			else
+				firstCell.$.rowSpan = totalRowSpan;
+
+			if( totalRowSpan >= mapHeight )
+				firstCell.removeAttribute( 'colSpan' );
+			else
+				firstCell.$.colSpan = totalColSpan;
+
+			// Swip empty <tr> left at the end of table due to the merging.
+			var trs = new CKEDITOR.dom.nodeList( table.$.rows ),
+				count = trs.count();
+
+			for ( var i = count - 1; i >= 0; i-- )
+			{
+				var tailTr = trs.getItem( i );
+				if( !tailTr.$.cells.length )
+				{
+					tailTr.remove();
+					count++;
+					continue;
+				}
+			}
+
+			return firstCell;
+		}
+		// Be able to merge cells only if actual dimension of selected
+		// cells equals to the caculated rectangle.
+		else
+			return ( totalRowSpan * totalColSpan ) == dimension;
+	}
+
+	function verticalSplitCell ( selection, isDetect )
+	{
+		var cells = getSelectedCells( selection );
+		if( cells.length > 1 )
+			return false;
+		else if( isDetect )
+			return true;
+		
+		var cell = cells[ 0 ],
+			tr = cell.getParent(),
+			table = tr.getAscendant( 'table' ),
+			map = buildTableMap( table ),
+			rowIndex = tr.$.rowIndex,
+			colIndex = cellInRow( map, rowIndex, cell ),
+			rowSpan = cell.$.rowSpan,
+			newCell,
+			newRowSpan,
+			newCellRowSpan,
+			newRowIndex;
+		
+		if( rowSpan > 1 )
+		{
+			newRowSpan = Math.ceil( rowSpan / 2 );
+			newCellRowSpan = Math.floor( rowSpan / 2 );
+			newRowIndex = rowIndex + newRowSpan;
+			var newCellTr = new CKEDITOR.dom.element( table.$.rows[ newRowIndex ] ),
+				newCellRow = cellInRow( map, newRowIndex ),
+				candidateCell;
+			
+			newCell = cell.clone();
+
+			// Figure out where to insert the new cell by checking the vitual row.
+			for ( var c = 0; c < newCellRow.length; c++ )
+			{
+				candidateCell = newCellRow[ c ];
+				// Catch first cell actually following the column.
+				if( candidateCell.parentNode == newCellTr.$
+					&& c > colIndex )
+				{
+					newCell.insertBefore( new CKEDITOR.dom.element( candidateCell ) );
+					break;
+				}
+				else
+					candidateCell = null;
+			}
+
+			// The destination row is empty, append at will.
+			if( !candidateCell )
+				newCellTr.append( newCell, true );
+		}
+		else
+		{
+			newCellRowSpan = newRowSpan = 1;
+			var newCellTr = tr.clone();
+			newCellTr.insertAfter( tr );
+			newCellTr.append( newCell = cell.clone() );
+			var cellsInSameRow = cellInRow( map, rowIndex );
+			for ( var i = 0; i < cellsInSameRow.length; i++ )
+				cellsInSameRow[ i ].rowSpan++;
+		}
+
+		if( !CKEDITOR.env.ie )
+			newCell.appendBogus();
+
+		cell.$.rowSpan = newRowSpan;
+		newCell.$.rowSpan = newCellRowSpan;
+		if( newRowSpan == 1 )
+			cell.removeAttribute( 'rowSpan' );
+		if( newCellRowSpan == 1 )
+			newCell.removeAttribute( 'rowSpan' );
+
+		return newCell;
+	}
+
+	function horizontalSplitCell( selection, isDetect )
+	{
+		var cells = getSelectedCells( selection );
+		if( cells.length > 1 )
+			return false;
+		else if( isDetect )
+			return true;
+
+		var cell = cells[ 0 ],
+			tr = cell.getParent(),
+			table = tr.getAscendant( 'table' ),
+			map = buildTableMap( table ),
+			rowIndex = tr.$.rowIndex,
+			colIndex = cellInRow( map, rowIndex, cell ),
+			colSpan = cell.$.colSpan,
+			newCell,
+			newColSpan,
+			newCellColSpan;
+
+		if( colSpan > 1 )
+		{
+			newColSpan = Math.ceil( colSpan / 2 );
+			newCellColSpan = Math.floor( colSpan / 2 );
+		}
+		else
+		{
+			newCellColSpan = newColSpan = 1;
+			var cellsInSameCol = cellInCol( map, colIndex );
+			for ( var i = 0; i < cellsInSameCol.length; i++ )
+				cellsInSameCol[ i ].colSpan++;
+		}
+		newCell = cell.clone();
+		newCell.insertAfter( cell );
+		if( !CKEDITOR.env.ie )
+			newCell.appendBogus();
+
+		cell.$.colSpan = newColSpan;
+		newCell.$.colSpan = newCellColSpan;
+		if( newColSpan == 1 )
+			cell.removeAttribute( 'colSpan' );
+		if( newCellColSpan == 1 )
+			newCell.removeAttribute( 'colSpan' );
+
+		return newCell;
+	}
 	// Context menu on table caption incorrect (#3834)
 	var contextMenuTags = { thead : 1, tbody : 1, tfoot : 1, td : 1, tr : 1, th : 1 };
@@ -517,4 +720,44 @@
 				} );
 
+			editor.addCommand( 'cellMerge',
+				{
+					exec : function( editor )
+					{
+						placeCursorInCell( mergeCells( editor.getSelection() ), true );
+					}
+				} );
+
+			editor.addCommand( 'cellMergeRight',
+				{
+					exec : function( editor )
+					{
+						placeCursorInCell( mergeCells( editor.getSelection(), 'right' ), true );
+					}
+				} );
+
+			editor.addCommand( 'cellMergeDown',
+				{
+					exec : function( editor )
+					{
+						placeCursorInCell( mergeCells( editor.getSelection(), 'down' ), true );
+					}
+				} );
+
+			editor.addCommand( 'cellVerticalSplit',
+				{
+					exec : function( editor )
+					{
+						placeCursorInCell( verticalSplitCell( editor.getSelection() ) );
+					}
+				} );
+			
+			editor.addCommand( 'cellHorizontalSplit',
+				{
+					exec : function( editor )
+					{
+						placeCursorInCell( horizontalSplitCell( editor.getSelection() ) );
+					}
+				} );
+			
 			editor.addCommand( 'cellInsertBefore',
 				{
@@ -547,9 +790,15 @@
 							getItems : function()
 							{
-								var cells = getSelectedCells( editor.getSelection() );
+								var selection = editor.getSelection(),
+									cells = getSelectedCells( selection );
 								return {
 									tablecell_insertBefore : CKEDITOR.TRISTATE_OFF,
 									tablecell_insertAfter : CKEDITOR.TRISTATE_OFF,
 									tablecell_delete : CKEDITOR.TRISTATE_OFF,
+									tablecell_merge : mergeCells( selection, null, true ) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
+									tablecell_merge_right : mergeCells( selection, 'right', true ) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
+									tablecell_merge_down : mergeCells( selection, 'down', true ) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
+									tablecell_split_vertical : verticalSplitCell( selection, true ) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
+									tablecell_split_horizontal : horizontalSplitCell( selection, true ) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
 									tablecell_properties : cells.length > 0 ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
 								};
@@ -581,4 +830,44 @@
 						},
 
+						tablecell_merge :
+						{
+							label : lang.cell.merge,
+							group : 'tablecell',
+							command : 'cellMerge',
+							order : 16
+						},
+
+						tablecell_merge_right :
+						{
+							label : lang.cell.mergeRight,
+							group : 'tablecell',
+							command : 'cellMergeRight',
+							order : 17
+						},
+
+						tablecell_merge_down :
+						{
+							label : lang.cell.mergeDown,
+							group : 'tablecell',
+							command : 'cellMergeDown',
+							order : 18
+						},
+
+						tablecell_split_horizontal :
+						{
+							label : lang.cell.splitHorizontal,
+							group : 'tablecell',
+							command : 'cellHorizontalSplit',
+							order : 19
+						},
+
+						tablecell_split_vertical :
+						{
+							label : lang.cell.splitVertical,
+							group : 'tablecell',
+							command : 'cellVerticalSplit',
+							order : 20
+						},
+
 						tablecell_properties :
 						{
@@ -586,5 +875,5 @@
 							group : 'tablecellproperties',
 							command : 'cellProperties',
-							order : 20
+							order : 21
 						},
 
Index: /CKEditor/trunk/_source/plugins/toolbar/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/toolbar/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/toolbar/plugin.js	(revision 4774)
@@ -368,5 +368,5 @@
 	'/',
 	['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
-	['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
+	['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
 	['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
 	['Link','Unlink','Anchor'],
Index: /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js	(revision 4773)
+++ /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js	(revision 4774)
@@ -11,10 +11,9 @@
 (function()
 {
-	/**
-	 * List of elements in which has no way to move editing focus outside.
-	 */
+	// List of elements in which has no way to move editing focus outside.
 	var nonExitableElementNames = { table:1,pre:1 };
+
 	// Matching an empty paragraph at the end of document.
-	var emptyParagraphRegexp = /\s*<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\1>)?\s*$/gi;
+	var emptyParagraphRegexp = /\s*<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\1>)?\s*(?=$|<\/body>)/gi;
 
 	function onInsertHtml( evt )
@@ -23,4 +22,5 @@
 		{
 			this.focus();
+			this.fire( 'saveSnapshot' );
 
 			var selection = this.getSelection(),
@@ -47,4 +47,9 @@
 			else
 				this.document.$.execCommand( 'inserthtml', false, data );
+
+			CKEDITOR.tools.setTimeout( function()
+				{
+					this.fire( 'saveSnapshot' );
+				}, 0, this );
 		}
 	}
@@ -251,5 +256,5 @@
 
 					// Creates the iframe that holds the editable document.
-					var createIFrame = function()
+					var createIFrame = function( data )
 					{
 						if ( iframe )
@@ -259,32 +264,34 @@
 
 						frameLoaded = 0;
-						// The document domain must be set within the src
-						// attribute;
-						// Defer the script execution until iframe
-						// has been added to main window, this is needed for some
-						// browsers which will begin to load the frame content
-						// prior to it's presentation in DOM.(#3894)
-						var src = 'void( '
-								+ ( CKEDITOR.env.gecko ? 'setTimeout' : '' ) + '( function(){' +
-								'document.open();' +
-								( CKEDITOR.env.ie && isCustomDomain ? 'document.domain="' + document.domain + '";' : '' ) +
-								'document.write( window.parent[ "_cke_htmlToLoad_' + editor.name + '" ] );' +
-								'document.close();' +
-								'window.parent[ "_cke_htmlToLoad_' + editor.name + '" ] = null;' +
-								'}'
-								+ ( CKEDITOR.env.gecko ? ', 0 )' : ')()' )
-								+ ' )';
-
-						// Loading via src attribute does not work in Opera.
-						if ( CKEDITOR.env.opera )
-							src = 'void(0);';
 
 						iframe = CKEDITOR.dom.element.createFromHtml( '<iframe' +
-								' style="width:100%;height:100%"' +
-								' frameBorder="0"' +
-								' tabIndex="-1"' +
-								' allowTransparency="true"' +
-								' src="javascript:' + encodeURIComponent( src ) + '"' +
-								'></iframe>' );
+  							' style="width:100%;height:100%"' +
+  							' frameBorder="0"' +
+							// Support for custom document.domain in IE.
+							( isCustomDomain ?
+								' src="javascript:void((function(){' +
+									'document.open();' +
+									'document.domain=\'' + document.domain + '\';' +
+									'document.close();' +
+								'})())"' : '' ) +
+  							' tabIndex="-1"' +
+  							' allowTransparency="true"' +
+  							'></iframe>' );
+
+						// Register onLoad event for iframe element, which
+						// will fill it with content and set custom domain.
+						iframe.on( 'load', function( e )
+						{
+							e.removeListener();
+							var doc = iframe.getFrameDocument().$;
+
+							// Custom domain handling is needed after each document.open().
+							doc.open();
+							if ( isCustomDomain )
+								doc.domain = document.domain;
+							doc.write( data );
+							doc.close();
+
+						} );
 
 						var accTitle = editor.lang.editorTitle.replace( '%1', editor.name );
@@ -292,11 +299,4 @@
 						if ( CKEDITOR.env.gecko )
 						{
-							// Double checking the iframe will be loaded properly(#4058).
-							iframe.on( 'load', function( ev )
-							{
-								ev.removeListener();
-								contentDomReady( iframe.$.contentWindow );
-							} );
-
 							// Accessibility attributes for Firefox.
 							mainElement.setAttributes(
@@ -587,44 +587,94 @@
 								isLoadingData = true;
 
+								var config = editor.config,
+									fullPage = config.fullPage,
+									docType = config.docType;
+
+								// Build the additional stuff to be included into <head>.
+								var headExtra =
+									'<style type="text/css" cke_temp="1">' +
+										editor._.styles.join( '\n' ) +
+									'</style>';
+
+								!fullPage && ( headExtra =
+									CKEDITOR.tools.buildStyleHtml( editor.config.contentsCss ) +
+									headExtra );
+
+								var baseTag = config.baseHref ? '<base href="' + config.baseHref + '" cke_temp="1" />' : '';
+
+								if ( fullPage )
+								{
+									// Search and sweep out the doctype declaration.
+									data = data.replace( /<!DOCTYPE[^>]*>/i, function( match )
+										{
+											editor.docType = docType = match;
+											return '';
+										});
+								}
+
 								// Get the HTML version of the data.
 								if ( editor.dataProcessor )
-								{
 									data = editor.dataProcessor.toHtml( data, fixForBody );
-								}
-
-								data =
-									editor.config.docType +
-									'<html dir="' + editor.config.contentsLangDirection + '">' +
-									'<head>' +
-										'<link type="text/css" rel="stylesheet" href="' +
-										[].concat( editor.config.contentsCss ).join( '"><link type="text/css" rel="stylesheet" href="' ) +
-										'">' +
-										'<style type="text/css" _fcktemp="true">' +
-											editor._.styles.join( '\n' ) +
-										'</style>'+
-									'</head>' +
-									'<body>' +
-										data +
-									'</body>' +
-									'</html>' +
-									activationScript;
-
-								window[ '_cke_htmlToLoad_' + editor.name ] = data;
+
+								if ( fullPage )
+								{
+									// Check if the <body> tag is available.
+									if ( !(/<body[\s|>]/).test( data ) )
+										data = '<body>' + data;
+
+									// Check if the <html> tag is available.
+									if ( !(/<html[\s|>]/).test( data ) )
+										data = '<html>' + data + '</html>';
+
+									// Check if the <head> tag is available.
+									if ( !(/<head[\s|>]/).test( data ) )
+										data = data.replace( /<html[^>]*>/, '$&<head><title></title></head>' ) ;
+
+									// The base must be the first tag in the HEAD, e.g. to get relative
+									// links on styles.
+									baseTag && ( data = data.replace( /<head>/, '$&' + baseTag ) );
+
+									// Inject the extra stuff into <head>.
+									// Attention: do not change it before testing it well. (V2)
+									// This is tricky... if the head ends with <meta ... content type>,
+									// Firefox will break. But, it works if we place our extra stuff as
+									// the last elements in the HEAD.
+									data = data.replace( /<\/head\s*>/, headExtra + '$&' );
+
+									// Add the DOCTYPE back to it.
+									data = docType + data;
+								}
+								else
+								{
+									data =
+										config.docType +
+										'<html dir="' + config.contentsLangDirection + '">' +
+										'<head>' +
+											baseTag +
+											headExtra +
+										'</head>' +
+										'<body' + ( config.bodyId ? ' id="' + config.bodyId + '"' : '' ) +
+												  ( config.bodyClass ? ' class="' + config.bodyClass + '"' : '' ) +
+												  '>' +
+											data +
+										'</html>';
+								}
+								
+								data += activationScript;
+
 								CKEDITOR._[ 'contentDomReady' + editor.name ] = contentDomReady;
-								createIFrame();
-
-								// Opera must use the old method for loading contents.
-								if ( CKEDITOR.env.opera )
-								{
-									var doc = iframe.$.contentWindow.document;
-									doc.open();
-									doc.write( data );
-									doc.close();
-								}
+								createIFrame( data );
 							},
 
 							getData : function()
 							{
-								var data = iframe.getFrameDocument().getBody().getHtml();
+								var config = editor.config,
+									fullPage = config.fullPage,
+									docType = fullPage && editor.docType,
+									doc = iframe.getFrameDocument();
+								
+								var data = fullPage
+									? doc.getDocumentElement().getOuterHtml()
+									: doc.getBody().getHtml();
 
 								if ( editor.dataProcessor )
@@ -632,6 +682,9 @@
 
 								// Strip the last blank paragraph within document.
-								if ( editor.config.ignoreEmptyParagraph )
+								if ( config.ignoreEmptyParagraph )
 									data = data.replace( emptyParagraphRegexp, '' );
+
+								if ( docType )
+									data = docType + '\n' + data;
 
 								return data;
Index: /CKEditor/trunk/_source/skins/kama/elementspath.css
===================================================================
--- /CKEditor/trunk/_source/skins/kama/elementspath.css	(revision 4773)
+++ /CKEditor/trunk/_source/skins/kama/elementspath.css	(revision 4774)
@@ -14,7 +14,7 @@
 .cke_skin_kama .cke_path
 {
-	padding: 0 5px;
 	display: inline-block;
 	float: left;
+	margin-top: 5px;
 }
 
@@ -24,4 +24,9 @@
 }
 
+.cke_shared .cke_skin_kama .cke_path
+{
+	margin: 0 0 5px;
+}
+
 .cke_skin_kama .cke_path a,
 .cke_skin_kama .cke_path .cke_empty
@@ -29,9 +34,5 @@
 	display: inline-block;
 	float: left;
-	padding-top: 1px;
-	padding-bottom: 1px;
-	padding-left: 4px;
-	padding-right: 4px;
-	margin-bottom : 3px;
+	padding: 1px 4px 0;
 	color: #60676a;
 }
@@ -53,8 +54,5 @@
 {
 	background-color: #dff1ff;
-	padding-top: 1px;
-	padding-bottom: 1px;
-	padding-left: 4px;
-	padding-right: 4px;
+	padding: 1px 4px 0;
 	outline: none;
 	color : #000;
Index: /CKEditor/trunk/_source/skins/kama/icons.css
===================================================================
--- /CKEditor/trunk/_source/skins/kama/icons.css	(revision 4773)
+++ /CKEditor/trunk/_source/skins/kama/icons.css	(revision 4774)
@@ -284,4 +284,17 @@
 }
 
+.cke_skin_kama .cke_button_creatediv .cke_icon
+{
+	background-position: 0 -1168px;
+}
+.cke_skin_kama .cke_button_editdiv .cke_icon
+{
+	background-position: 0 -1184px;
+}
+.cke_skin_kama .cke_button_removediv .cke_icon
+{
+	background-position: 0 -1200px;
+}
+
 .cke_skin_kama .cke_button_flash .cke_icon
 {
@@ -308,2 +321,6 @@
 	background-position: 0 -1040px;
 }
+.cke_skin_office2003 .cke_button_editdiv .cke_icon
+{
+	background-position: 0 -1184px;
+}
Index: /CKEditor/trunk/_source/skins/kama/mainui.css
===================================================================
--- /CKEditor/trunk/_source/skins/kama/mainui.css	(revision 4773)
+++ /CKEditor/trunk/_source/skins/kama/mainui.css	(revision 4774)
@@ -29,6 +29,12 @@
 	background-position: 0 -1950px;
 	display: block;
+	padding: 5px;
 
 	/*background-color: Red;*/
+}
+
+.cke_shared .cke_skin_kama .cke_wrapper
+{
+	padding-bottom: 0;
 }
 
@@ -66,5 +72,4 @@
 {
 	margin: 5px;
-	padding: 0 5px 5px;
 }
 
@@ -137,2 +142,13 @@
 	top: 0;
 }
+
+.cke_skin_kama .cke_browser_ie7 .cke_editor
+{
+	display: inline-block;
+}
+
+.cke_shared .cke_skin_kama .cke_browser_ie7 .cke_wrapper
+{
+	padding-bottom: 5px;
+}
+
Index: /CKEditor/trunk/_source/skins/kama/skin.js
===================================================================
--- /CKEditor/trunk/_source/skins/kama/skin.js	(revision 4773)
+++ /CKEditor/trunk/_source/skins/kama/skin.js	(revision 4774)
@@ -148,5 +148,5 @@
 					var cssContent,
 						uiStyle = getStylesheet( CKEDITOR.document ),
-						cssId = '#cke_' + CKEDITOR.tools.escapeCssSelector( editor.name );
+						cssId = '.cke_editor_' + CKEDITOR.tools.escapeCssSelector( editor.name );
 
 					var cssSelectors =
@@ -204,5 +204,5 @@
 })() );
 
-if ( CKEDITOR.dialog )
+CKEDITOR.on( 'dialogPluginReady', function()
 {
 	CKEDITOR.dialog.on( 'resize', function( evt )
@@ -246,6 +246,6 @@
 				},
 				100 );
-		});
-}
+		} );
+} );
 
 /**
Index: /CKEditor/trunk/_source/skins/kama/toolbar.css
===================================================================
--- /CKEditor/trunk/_source/skins/kama/toolbar.css	(revision 4773)
+++ /CKEditor/trunk/_source/skins/kama/toolbar.css	(revision 4774)
@@ -23,10 +23,4 @@
 {
 	clear: both;
-	padding: 5px 3px 5px 6px;
-}
-
-.cke_skin_kama .cke_rtl .cke_toolbox
-{
-	padding: 5px 6px 5px 3px;
 }
 
@@ -43,5 +37,5 @@
 	float: right;
 	border: 1px outset #D3D3D3;
-	margin: 11px 4px 2px;
+	margin: 11px 0 2px;
 	cursor: pointer;
 }
@@ -396,2 +390,18 @@
 	cursor: default;
 }
+
+.cke_skin_kama .cke_browser_ie7 .cke_toolbox
+{
+	margin-bottom: 2px;
+}
+
+.cke_shared .cke_skin_kama .cke_browser_ie7 .cke_toolbox
+{
+	margin-bottom: 0;
+}
+
+.cke_skin_kama .cke_browser_gecko .cke_toolbox
+{
+	/* Define the padding-bottom otherwise the collapser button will not be clicable in FF */
+	padding-bottom: 1px;
+}
Index: /CKEditor/trunk/_source/skins/office2003/icons.css
===================================================================
--- /CKEditor/trunk/_source/skins/office2003/icons.css	(revision 4773)
+++ /CKEditor/trunk/_source/skins/office2003/icons.css	(revision 4774)
@@ -308,2 +308,17 @@
 	background-position: 0 -1040px;
 }
+
+.cke_skin_office2003 .cke_button_creatediv .cke_icon
+{
+	background-position: 0 -1168px;
+}
+
+.cke_skin_office2003 .cke_button_editdiv .cke_icon
+{
+	background-position: 0 -1184px;
+}
+
+.cke_skin_office2003 .cke_button_removediv .cke_icon
+{
+	background-position: 0 -1200px;
+}
Index: /CKEditor/trunk/_source/skins/office2003/mainui.css
===================================================================
--- /CKEditor/trunk/_source/skins/office2003/mainui.css	(revision 4773)
+++ /CKEditor/trunk/_source/skins/office2003/mainui.css	(revision 4774)
@@ -19,5 +19,7 @@
 }
 
-.cke_skin_office2003 .cke_top, .cke_skin_office2003 .cke_bottom
+.cke_skin_office2003 .cke_top,
+.cke_skin_office2003 .cke_bottom,
+ .cke_shared .cke_skin_office2003
 {
 	background-color: #f7f8fd;
Index: /CKEditor/trunk/_source/skins/office2003/skin.js
===================================================================
--- /CKEditor/trunk/_source/skins/office2003/skin.js	(revision 4773)
+++ /CKEditor/trunk/_source/skins/office2003/skin.js	(revision 4774)
@@ -24,5 +24,5 @@
 })() );
 
-if ( CKEDITOR.dialog )
+CKEDITOR.on( 'dialogPluginReady', function()
 {
 	CKEDITOR.dialog.on( 'resize', function( evt )
@@ -73,4 +73,4 @@
 			if ( evt.editor.lang.dir == 'rtl' )
 				setTimeout( fixSize, 1000 );
-		});
-}
+		} );
+} );
Index: /CKEditor/trunk/_source/skins/v2/icons.css
===================================================================
--- /CKEditor/trunk/_source/skins/v2/icons.css	(revision 4773)
+++ /CKEditor/trunk/_source/skins/v2/icons.css	(revision 4774)
@@ -308,2 +308,17 @@
 	background-position: 0 -1040px;
 }
+
+.cke_skin_v2 .cke_button_creatediv .cke_icon
+{
+	background-position: 0 -1168px;
+}
+
+.cke_skin_v2 .cke_button_editdiv .cke_icon
+{
+	background-position: 0 -1184px;
+}
+
+.cke_skin_v2 .cke_button_removediv .cke_icon
+{
+	background-position: 0 -1200px;
+}
Index: /CKEditor/trunk/_source/skins/v2/mainui.css
===================================================================
--- /CKEditor/trunk/_source/skins/v2/mainui.css	(revision 4773)
+++ /CKEditor/trunk/_source/skins/v2/mainui.css	(revision 4774)
@@ -28,5 +28,7 @@
 }
 
-.cke_skin_v2 .cke_top, .cke_skin_v2 .cke_bottom
+.cke_skin_v2 .cke_top,
+.cke_skin_v2 .cke_bottom,
+ .cke_shared .cke_skin_v2
 {
 	background-color: #efefde;
Index: /CKEditor/trunk/_source/skins/v2/skin.js
===================================================================
--- /CKEditor/trunk/_source/skins/v2/skin.js	(revision 4773)
+++ /CKEditor/trunk/_source/skins/v2/skin.js	(revision 4774)
@@ -24,5 +24,5 @@
 })() );
 
-if ( CKEDITOR.dialog )
+CKEDITOR.on( 'dialogPluginReady', function()
 {
 	CKEDITOR.dialog.on( 'resize', function( evt )
@@ -69,4 +69,4 @@
 				},
 				100 );
-		});
-}
+		} );
+} );
Index: /CKEditor/trunk/_source/themes/default/theme.js
===================================================================
--- /CKEditor/trunk/_source/themes/default/theme.js	(revision 4773)
+++ /CKEditor/trunk/_source/themes/default/theme.js	(revision 4774)
@@ -6,4 +6,64 @@
 CKEDITOR.themes.add( 'default', (function()
 {
+	function checkSharedSpace( editor, spaceName )
+	{
+		var container,
+			element;
+
+		// Try to retrieve the target element from the sharedSpaces settings. 
+		element = editor.config.sharedSpaces;
+		element = element && element[ spaceName ];
+		element = element && CKEDITOR.document.getById( element );
+
+		// If the element is available, we'll then create the container for
+		// the space.			
+		if ( element )
+		{
+			// Creates an HTML structure that reproduces the editor class hierarchy.
+			var html = 
+				'<span class="cke_shared">' +
+				'<span class="' + editor.skinClass + ' cke_editor_' + editor.name + '">' +
+				'<span class="' + CKEDITOR.env.cssClass + '">' +
+				'<span class="cke_wrapper cke_' + editor.lang.dir + '">' +
+				'<span class="cke_editor">' +
+				'<div class="cke_' + spaceName + '">' +
+				'</div></span></span></span></span></span>';
+
+			var mainContainer = element.append( CKEDITOR.dom.element.createFromHtml( html, element.getDocument() ) );
+
+			// Only the first container starts visible. Others get hidden.
+			if ( element.getCustomData( 'cke_hasshared' ) )
+				mainContainer.hide();
+			else
+				element.setCustomData( 'cke_hasshared', 1 );
+			
+			// Get the deeper inner <div>.
+			container = mainContainer.getChild( [0,0,0,0] );
+
+			// When the editor gets focus, we show the space container, hiding others.
+			editor.on( 'focus', function()
+				{
+					for ( var i = 0, sibling, children = element.getChildren() ; ( sibling = children.getItem( i ) ) ; i++ )
+					{
+						if ( sibling.type == CKEDITOR.NODE_ELEMENT 
+							&& !sibling.equals( mainContainer ) 
+							&& sibling.hasClass( 'cke_shared' ) )
+						{
+							sibling.hide();
+						}
+					}
+
+					mainContainer.show();
+				});
+
+			editor.on( 'destroy', function()
+				{
+					mainContainer.remove();
+				});
+		}
+
+		return container;
+	}
+
 	return {
 		build : function( editor, themePath )
@@ -45,9 +105,15 @@
 			}
 
+			var sharedTop		= topHtml && checkSharedSpace( editor, 'top' ),
+				sharedBottoms	= checkSharedSpace( editor, 'bottom' );
+				
+			sharedTop		&& ( sharedTop.setHtml( topHtml )		, topHtml = '' );
+			sharedBottoms	&& ( sharedBottoms.setHtml( bottomHtml ), bottomHtml = '' );
+
 			var container = CKEDITOR.dom.element.createFromHtml( [
 				'<span' +
 					' id="cke_', name, '"' +
 					' onmousedown="return false;"' +
-					' class="', editor.skinClass, '"' +
+					' class="', editor.skinClass, ' cke_editor_', name, '"' +
 					' dir="', editor.lang.dir, '"' +
 					' title="', ( CKEDITOR.env.gecko ? ' ' : '' ), '"' +
@@ -99,5 +165,5 @@
 
 			var element = CKEDITOR.dom.element.createFromHtml( [
-					'<div id="cke_' + editor.name.replace('.', '\\.') + '_dialog" class="cke_skin_', editor.skinName,
+					'<div class="cke_editor_' + editor.name.replace('.', '\\.') + '_dialog cke_skin_', editor.skinName,
 						'" dir="', editor.lang.dir, '"' +
 						' lang="', editor.langCode, '"' +
@@ -239,2 +305,28 @@
 	return this.container.getChild( [ 0, 0 ] );
 };
+
+/**
+ * Makes it possible to place some of the editor UI blocks, like the toolbar
+ * and the elements path, into any element in the page.
+ * The elements used to hold the UI blocks can be shared among several editor
+ * instances. In that case, only the blocks of the active editor instance will
+ * display.
+ * @name CKEDITOR.config.sharedSpaces
+ * @type Object
+ * @default undefined
+ * @example
+ * // Place the toolbar inside the element with ID "someElementId" and the
+ * // elements path into the element with ID "anotherId".
+ * config.sharedSpaces =
+ * {
+ *     top : 'someElementId',
+ *     bottom : 'anotherId'
+ * };
+ * @example
+ * // Place the toolbar inside the element with ID "someElementId". The
+ * // elements path will remain attached to the editor UI.
+ * config.sharedSpaces =
+ * {
+ *     top : 'someElementId'
+ * };
+ */
Index: /CKEditor/trunk/ckeditor.pack
===================================================================
--- /CKEditor/trunk/ckeditor.pack	(revision 4773)
+++ /CKEditor/trunk/ckeditor.pack	(revision 4774)
@@ -99,4 +99,5 @@
 					'_source/core/dom/node.js',
 					'_source/core/dom/nodelist.js',
+					'_source/core/dom/comment.js',
 					'_source/core/dom/element.js',
 					'_source/core/command.js',
Index: /CKEditor/trunk/ckeditor.php
===================================================================
--- /CKEditor/trunk/ckeditor.php	(revision 4774)
+++ /CKEditor/trunk/ckeditor.php	(revision 4774)
@@ -0,0 +1,29 @@
+<?php
+/*
+ * Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
+
+/*! \mainpage CKEditor - PHP server side intergation
+ * \section intro_sec CKEditor
+ * Visit <a href="http://ckeditor.com">CKEditor web site</a> to find more information about the editor.
+ * \section install_sec Installation
+ * \subsection step1 Include ckeditor.php in your PHP web site.
+ * @code
+ * <?php
+ * include("ckeditor/ckeditor.php");
+ * ?>
+ * @endcode
+ * \subsection step2 Create CKEditor class instance and use one of available methods to insert CKEditor.
+ * @code
+ * <?php
+ * $CKEditor = new CKEditor();
+ * echo $CKEditor->textarea("field1", "<p>Initial value.</p>");
+ * ?>
+ * @endcode
+ */
+
+if ( !function_exists('version_compare') || version_compare( phpversion(), '5', '<' ) )
+	include_once( 'ckeditor_php4.php' ) ;
+else
+	include_once( 'ckeditor_php5.php' ) ;
Index: /CKEditor/trunk/ckeditor_php4.php
===================================================================
--- /CKEditor/trunk/ckeditor_php4.php	(revision 4774)
+++ /CKEditor/trunk/ckeditor_php4.php	(revision 4774)
@@ -0,0 +1,598 @@
+<?php
+/*
+* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+* For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * \brief CKEditor class that can be used to create editor
+ * instances in PHP pages on server side.
+ * @see http://ckeditor.com
+ *
+ * Sample usage:
+ * @code
+ * $CKEditor = new CKEditor();
+ * $CKEditor->editor("editor1", "<p>Initial value.</p>");
+ * @endcode
+ */
+class CKEditor
+{
+	/**
+	 * The version of %CKEditor.
+	 * \private
+	 */
+	var $version = '%VERSION%';
+	/**
+	 * A constant string unique for each release of %CKEditor.
+	 * \private
+	 */
+	var $_timestamp = '%TIMESTAMP%';
+
+	/**
+	 * URL to the %CKEditor installation directory (absolute or relative to document root).
+	 * If not set, CKEditor will try to guess it's path.
+	 *
+	 * Example usage:
+	 * @code
+	 * $CKEditor->basePath = '/ckeditor/';
+	 * @endcode
+	 */
+	var $basePath;
+	/**
+	 * An array that holds the global %CKEditor configuration.
+	 * For the list of available options, see http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html
+	 *
+	 * Example usage:
+	 * @code
+	 * $CKEditor->config['height'] = 400;
+	 * // Use @@ at the beggining of a string to ouput it without surrounding quotes.
+	 * $CKEditor->config['width'] = '@@screen.width * 0.8';
+	 * @endcode
+	 */
+	var $config = array();
+	/**
+	 * A boolean variable indicating whether CKEditor has been initialized.
+	 * Set it to true only if you have already included
+	 * &lt;script&gt; tag loading ckeditor.js in your website. 
+	 */
+	var $initialized = false;
+	/**
+	 * Boolean variable indicating whether created code should be printed out or returned by a function.
+	 *
+	 * Example 1: get the code creating %CKEditor instance and print it on a page with the "echo" function. 
+	 * @code
+	 * $CKEditor = new CKEditor();
+	 * $CKEditor->returnOutput = true;
+	 * $code = $CKEditor->editor("editor1", "<p>Initial value.</p>");
+	 * echo "<p>Editor 1:</p>";
+	 * echo $code;
+	 * @endcode
+	 */
+	var $returnOutput = false;
+	/**
+	 * An array with textarea attributes.
+	 *
+	 * When %CKEditor is created with the editor() method, a HTML &lt;textarea&gt; element is created,
+	 * it will be displayed to anyone with JavaScript disabled or with incompatible browser.
+	 */	
+	var $textareaAttributes = array( "rows" => 8, "cols" => 60 );
+	/**
+	 * A string indicating the creation date of %CKEditor.
+	 * Do not change it unless you want to force browsers to not use previously cached version of %CKEditor.
+	 */
+	var $timestamp = "%TIMESTAMP%";
+	/**
+	 * An array that holds event listeners.
+	 * \private
+	 */
+	var $_events = array();
+	/**
+	 * An array that holds global event listeners.
+	 * \private
+	 */
+	var $_globalEvents = array();
+
+	/**
+	 * Main Constructor.
+	 *
+	 *  @param $basePath (string) URL to the %CKEditor installation directory (optional).
+	 */
+	function CKEditor($basePath = null) {
+		if (!empty($basePath)) {
+			$this->basePath = $basePath;
+		}
+	}
+
+	/**
+	 * Creates a %CKEditor instance. 
+	 * In incompatible browsers %CKEditor will downgrade to plain HTML &lt;textarea&gt; element.
+	 *
+	 * @param $name (string) Name of the %CKEditor instance (this will be also the "name" attribute of textarea element).
+	 * @param $value (string) Initial value (optional).
+	 * @param $config (array) The specific configurations to apply to this editor instance (optional).
+	 * @param $events (array) Event listeners for this editor instance (optional).
+	 *
+	 * Example usage:
+	 * @code
+	 * $CKEditor = new CKEditor();
+	 * $CKEditor->editor("field1", "<p>Initial value.</p>");
+	 * @endcode
+	 *
+	 * Advanced example:
+	 * @code
+	 * $CKEditor = new CKEditor();
+	 * $config = array();
+	 * $config['toolbar'] = array(
+	 *     array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ),
+	 *     array( 'Image', 'Link', 'Unlink', 'Anchor' )
+	 * );
+	 * $events['instanceReady'] = 'function (ev) {
+	 *     alert("Loaded: " + ev.editor.name);
+	 * }';
+	 * $CKEditor->editor("field1", "<p>Initial value.</p>", $config, $events);
+	 * @endcode
+	 */
+	function editor($name, $value = "", $config = array(), $events = array())
+	{
+		$attr = "";
+		foreach ($this->textareaAttributes as $key => $val) {
+			$attr.= " " . $key . '="' . str_replace('"', '&quot;', $val) . '"';
+		}
+		$out = "<textarea name=\"" . $name . "\"" . $attr . ">" . htmlspecialchars($value) . "</textarea>\n";
+		if (!$this->initialized) {
+			$out .= $this->init();
+		}
+
+		$_config = $this->configSettings($config, $events);
+
+		$js = $this->returnGlobalEvents();
+		if (!empty($_config))
+			$js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");";
+		else
+			$js .= "CKEDITOR.replace('".$name."');";
+
+		$out .= $this->script($js);
+
+		if (!$this->returnOutput) {
+			print $out;
+			$out = "";
+		}
+
+		return $out;
+	}
+
+	/**
+	 * Replaces a &lt;textarea&gt; with a %CKEditor instance.
+	 *
+	 * @param $id (string) The id or name of textarea element.
+	 * @param $config (array) The specific configurations to apply to this editor instance (optional).
+	 * @param $events (array) Event listeners for this editor instance (optional).
+	 *
+	 * Example 1: adding %CKEditor to &lt;textarea name="article"&gt;&lt;/textarea&gt; element:
+	 * @code
+	 * $CKEditor = new CKEditor();
+	 * $CKEditor->replace("article");
+	 * @endcode
+	 */
+	function replace($id, $config = array(), $events = array())
+	{
+		$out = "";
+		if (!$this->initialized) {
+			$out .= $this->init();
+		}
+
+		$_config = $this->configSettings($config, $events);
+
+		$js = $this->returnGlobalEvents();
+		if (!empty($_config)) {
+			$js .= "CKEDITOR.replace('".$id."', ".$this->jsEncode($_config).");";
+		}
+		else {
+			$js .= "CKEDITOR.replace('".$id."');";
+		}
+		$out .= $this->script($js);
+
+		if (!$this->returnOutput) {
+			print $out;
+			$out = "";
+		}
+
+		return $out;
+	}
+
+	/**
+	 * Replace all &lt;textarea&gt; elements available in the document with editor instances.
+	 * 
+	 * @param $className (string) If set, replace all textareas with class className in the page.
+	 *
+	 * Example 1: replace all &lt;textarea&gt; elements in the page.
+	 * @code
+	 * $CKEditor = new CKEditor();
+	 * $CKEditor->replaceAll();
+	 * @endcode
+	 * 
+	 * Example 2: replace all &lt;textarea class="myClassName"&gt; elements in the page.
+	 * @code
+	 * $CKEditor = new CKEditor();
+	 * $CKEditor->replaceAll( 'myClassName' );
+	 * @endcode
+	 */
+	function replaceAll($className = null)
+	{
+		$out = "";
+		if (!$this->initialized) {
+			$out .= $this->init();
+		}
+
+		$_config = $this->configSettings();
+
+		$js = $this->returnGlobalEvents();
+		if (empty($_config)) {
+			if (empty($className)) {
+				$js .= "CKEDITOR.replaceAll();";
+			}
+			else {
+				$js .= "CKEDITOR.replaceAll('".$className."');";
+			}
+		}
+		else {
+			$classDetection = "";
+			$js .= "CKEDITOR.replaceAll( function(textarea, config) {\n";
+			if (!empty($className)) {
+				$js .= "	var classRegex = new RegExp('(?:^| )' + '". $className ."' + '(?:$| )');\n";
+				$js .= "	if (!classRegex.test(textarea.className))\n";
+				$js .= "		return false;\n";
+			}
+			$js .= "	CKEDITOR.tools.extend(config, ". $this->jsEncode($_config) .", true);";
+			$js .= "} );";
+			
+		}
+
+		$out .= $this->script($js);
+
+		if (!$this->returnOutput) {
+			print $out;
+			$out = "";
+		}
+
+		return $out;
+	}
+
+	/**
+	 * Adds event listener.
+	 * Events are fired by %CKEditor in various situations.
+	 *
+	 * @param $event (string) Event name.
+	 * @param $javascriptCode (string) Javascript anonymous function or function name.
+	 *
+	 * Example usage:
+	 * @code
+	 * $CKEditor->addEventHandler('instanceReady', 'function (ev) {
+	 *     alert("Loaded: " + ev.editor.name);
+	 * }');
+	 * @endcode
+	 */
+	function addEventHandler($event, $javascriptCode)
+	{
+		if (!isset($this->_events[$event])) {
+			$this->_events[$event] = array();
+		}
+		// Avoid duplicates.
+		if (!in_array($javascriptCode, $this->_events[$event])) {
+			$this->_events[$event][] = $javascriptCode;
+		}
+	}
+
+	/**
+	 * Clear registered event handlers.
+	 * Note: this function will have no effect on already created editor instances.
+	 * 
+	 * @param $event (string) Event name, if not set all event handlers will be removed (optional).
+	 */
+	function clearEventHandlers($event = null)
+	{
+		if (!empty($event)) {
+			$this->_events[$event] = array();
+		}
+		else {
+			$this->_events = array();
+		}
+	}
+
+	/**
+	 * Adds global event listener.
+	 *
+	 * @param $event (string) Event name.
+	 * @param $javascriptCode (string) Javascript anonymous function or function name.
+	 *
+	 * Example usage:
+	 * @code
+	 * $CKEditor->addGlobalEventHandler('dialogDefinition', 'function (ev) {
+	 *     alert("Loading dialog: " + ev.data.name);
+	 * }');
+	 * @endcode
+	 */
+	function addGlobalEventHandler($event, $javascriptCode)
+	{
+		if (!isset($this->_globalEvents[$event])) {
+			$this->_globalEvents[$event] = array();
+		}
+		// Avoid duplicates.
+		if (!in_array($javascriptCode, $this->_globalEvents[$event])) {
+			$this->_globalEvents[$event][] = $javascriptCode;
+		}
+	}
+
+	/**
+	 * Clear registered global event handlers.
+	 * Note: this function will have no effect if the event handler has been already printed/returned.
+	 *
+	 * @param $event (string) Event name, if not set all event handlers will be removed (optional).
+	 */
+	function clearGlobalEventHandlers($event = null)
+	{
+		if (!empty($event)) {
+			$this->_globalEvents[$event] = array();
+		}
+		else {
+			$this->_globalEvents = array();
+		}
+	}
+
+	/**
+	 * Prints javascript code.
+	 * \private
+	 *
+	 * @param string $js
+	 */
+	function script($js)
+	{
+		$out = "<script type=\"text/javascript\">";
+		$out .= "//<![CDATA[\n";
+		$out .= $js;
+		$out .= "\n//]]>";
+		$out .= "</script>\n";
+
+		return $out;
+	}
+
+	/**
+	 * Returns the configuration array (global and instance specific settings are merged into one array).
+	 * \private
+	 * 
+	 * @param $config (array) The specific configurations to apply to editor instance.
+	 * @param $events (array) Event listeners for editor instance.
+	 */
+	function configSettings($config = array(), $events = array())
+	{
+		$_config = $this->config;
+		$_events = $this->_events;
+
+		if (is_array($config) && !empty($config)) {
+			$_config = array_merge($_config, $config);
+		}
+
+		if (is_array($events) && !empty($events)) {
+			foreach ($events as $eventName => $code) {
+				if (!isset($_events[$eventName])) {
+					$_events[$eventName] = array();
+				}
+				if (!in_array($code, $_events[$eventName])) {
+					$_events[$eventName][] = $code;
+				}
+			}
+		}
+
+		if (!empty($_events)) {
+			foreach($_events as $eventName => $handlers) {
+				if (empty($handlers)) {
+					continue;
+				}
+				else if (count($handlers) == 1) {
+					$_config['on'][$eventName] = '@@'.$handlers[0];
+				}
+				else {
+					$_config['on'][$eventName] = '@@function (ev){';
+					foreach ($handlers as $handler => $code) {
+						$_config['on'][$eventName] .= '('.$code.')(ev);';
+					}
+					$_config['on'][$eventName] .= '}';
+				}
+			}
+		}
+
+		return $_config;
+	}
+
+	/**
+	 * Return global event handlers.
+	 * \private
+	 */
+	function returnGlobalEvents()
+	{
+		static $returnedEvents;
+		$out = "";
+
+		if (!isset($returnedEvents)) {
+			$returnedEvents = array();
+		}
+
+		if (!empty($this->_globalEvents)) {
+			foreach ($this->_globalEvents as $eventName => $handlers) {
+				foreach ($handlers as $handler => $code) {
+					if (!isset($returnedEvents[$eventName])) {
+						$returnedEvents[$eventName] = array();
+					}
+					// Return only new events
+					if (!in_array($code, $returnedEvents[$eventName])) {
+						$out .= ($code ? "\n" : "") . "CKEDITOR.on('". $eventName ."', $code);";
+						$returnedEvents[$eventName][] = $code;
+					}
+				}
+			}
+		}
+
+		return $out;
+	}
+
+	/**
+	 * Initializes CKEditor (executed only once).
+	 * \private
+	 */
+	function init()
+	{
+		static $initComplete;
+		$out = "";
+
+		if (!empty($initComplete)) {
+			return "";
+		}
+
+		if ($this->initialized) {
+			$initComplete = true;
+			return "";
+		}
+
+		$args = "";
+		$ckeditorPath = $this->ckeditorPath();
+
+		if (!empty($this->timestamp) && $this->timestamp != "%TIMESTAMP%") {
+			$args = '?t=' . $this->timestamp;
+		}
+
+		// Skip relative paths...
+		if (strpos($ckeditorPath, '..') !== 0) {
+			$out .= $this->script("window.CKEDITOR_BASEPATH='". $ckeditorPath ."';");
+		}
+
+		$out .= "<script type=\"text/javascript\" src=\"" . $ckeditorPath . 'ckeditor.js' . $args . "\"></script>\n";
+
+		$extraCode = "";
+		// CKReleaser %REMOVE_START% 
+		if ($this->version == '%VERSION%') { 
+			$extraCode .= ($extraCode ? "\n" : "") . "if (typeof(CKEDITOR) == 'undefined') { alert('The CKEDITOR object was not found. Please make sure that the ckeditor.js file is available in your installation.'); }";
+		}
+		// %REMOVE_END% 
+		if (!empty($this->timestamp) && $this->timestamp != $this->_timestamp) {
+			$extraCode .= ($extraCode ? "\n" : "") . "CKEDITOR.timestamp = '". $this->timestamp ."';";
+		}
+		if ($extraCode) {
+			$out .= $this->script($extraCode);
+		}
+
+		$initComplete = $this->initialized = true;
+
+		return $out;
+	}
+
+	/**
+	 * Return path to ckeditor.js.
+	 * \private
+	 */
+	function ckeditorPath()
+	{
+		if (!empty($this->basePath)) {
+			return $this->basePath;
+		}
+
+		/**
+		 * The absolute pathname of the currently executing script.
+		 * Note: If a script is executed with the CLI, as a relative path, such as file.php or ../file.php,
+		 * $_SERVER['SCRIPT_FILENAME'] will contain the relative path specified by the user.
+		 */
+		if (isset($_SERVER['SCRIPT_FILENAME'])) {
+			$realPath = dirname($_SERVER['SCRIPT_FILENAME']);
+		}
+		else {
+			/**
+			 * realpath — Returns canonicalized absolute pathname
+			 */
+			$realPath = realpath( './' ) ;
+		}
+
+		/**
+		 * The filename of the currently executing script, relative to the document root.
+		 * For instance, $_SERVER['PHP_SELF'] in a script at the address http://example.com/test.php/foo.bar
+		 * would be /test.php/foo.bar.
+		 */
+		$selfPath = dirname($_SERVER['PHP_SELF']);
+		$file = str_replace("\\", "/", __FILE__);
+
+		if (!$selfPath || !$realPath || !$file) {
+			return "/ckeditor/";
+		}
+
+		$documentRoot = substr($realPath, 0, strlen($realPath) - strlen($selfPath));
+		$fileUrl = substr($file, strlen($documentRoot));
+		$ckeditorUrl = str_replace("ckeditor_php5.php", "", $fileUrl);
+
+		return $ckeditorUrl;
+	}
+
+	/**
+	 * This little function provides a basic JSON support.
+	 * http://php.net/manual/en/function.json-encode.php
+	 * \private
+	 *
+	 * @param mixed $val
+	 * @return string
+	 */
+	function jsEncode($val)
+	{
+		if (is_null($val)) {
+			return 'null';
+		}
+		if ($val === false) {
+			return 'false';
+		}
+		if ($val === true) {
+			return 'true';
+		}
+		if (is_scalar($val))
+		{
+			if (is_float($val))
+			{
+				// Always use "." for floats.
+				$val = str_replace(",", ".", strval($val));
+			}
+
+			// Use @@ to not use quotes when outputting string value
+			if (strpos($val, '@@') === 0) {
+				return substr($val, 2);
+			}
+			else {
+				// All scalars are converted to strings to avoid indeterminism.
+				// PHP's "1" and 1 are equal for all PHP operators, but
+				// JS's "1" and 1 are not. So if we pass "1" or 1 from the PHP backend,
+				// we should get the same result in the JS frontend (string).
+				// Character replacements for JSON.
+				static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'),
+				array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
+
+				$val = str_replace($jsonReplaces[0], $jsonReplaces[1], $val);
+
+				return '"' . $val . '"';
+			}
+		}
+		$isList = true;
+		for ($i = 0, reset($val); $i < count($val); $i++, next($val))
+		{
+			if (key($val) !== $i)
+			{
+				$isList = false;
+				break;
+			}
+		}
+		$result = array();
+		if ($isList)
+		{
+			foreach ($val as $v) $result[] = $this->jsEncode($v);
+			return '[ ' . join(', ', $result) . ' ]';
+		}
+		else
+		{
+			foreach ($val as $k => $v) $result[] = $this->jsEncode($k).': '.$this->jsEncode($v);
+			return '{ ' . join(', ', $result) . ' }';
+		}
+	}
+}
Index: /CKEditor/trunk/ckeditor_php5.php
===================================================================
--- /CKEditor/trunk/ckeditor_php5.php	(revision 4774)
+++ /CKEditor/trunk/ckeditor_php5.php	(revision 4774)
@@ -0,0 +1,588 @@
+<?php
+/*
+* Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+* For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * \brief CKEditor class that can be used to create editor
+ * instances in PHP pages on server side.
+ * @see http://ckeditor.com
+ *
+ * Sample usage:
+ * @code
+ * $CKEditor = new CKEditor();
+ * $CKEditor->editor("editor1", "<p>Initial value.</p>");
+ * @endcode
+ */
+class CKEditor
+{
+	/**
+	 * The version of %CKEditor.
+	 */
+	const version = '%VERSION%';
+	/**
+	 * A constant string unique for each release of %CKEditor.
+	 */
+	const timestamp = '%TIMESTAMP%';
+
+	/**
+	 * URL to the %CKEditor installation directory (absolute or relative to document root).
+	 * If not set, CKEditor will try to guess it's path.
+	 *
+	 * Example usage:
+	 * @code
+	 * $CKEditor->basePath = '/ckeditor/';
+	 * @endcode
+	 */
+	public $basePath;
+	/**
+	 * An array that holds the global %CKEditor configuration.
+	 * For the list of available options, see http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html
+	 *
+	 * Example usage:
+	 * @code
+	 * $CKEditor->config['height'] = 400;
+	 * // Use @@ at the beggining of a string to ouput it without surrounding quotes.
+	 * $CKEditor->config['width'] = '@@screen.width * 0.8';
+	 * @endcode
+	 */
+	public $config = array();
+	/**
+	 * A boolean variable indicating whether CKEditor has been initialized.
+	 * Set it to true only if you have already included
+	 * &lt;script&gt; tag loading ckeditor.js in your website. 
+	 */
+	public $initialized = false;
+	/**
+	 * Boolean variable indicating whether created code should be printed out or returned by a function.
+	 *
+	 * Example 1: get the code creating %CKEditor instance and print it on a page with the "echo" function. 
+	 * @code
+	 * $CKEditor = new CKEditor();
+	 * $CKEditor->returnOutput = true;
+	 * $code = $CKEditor->editor("editor1", "<p>Initial value.</p>");
+	 * echo "<p>Editor 1:</p>";
+	 * echo $code;
+	 * @endcode
+	 */
+	public $returnOutput = false;
+	/**
+	 * An array with textarea attributes.
+	 *
+	 * When %CKEditor is created with the editor() method, a HTML &lt;textarea&gt; element is created,
+	 * it will be displayed to anyone with JavaScript disabled or with incompatible browser.
+	 */	
+	public $textareaAttributes = array( "rows" => 8, "cols" => 60 );
+	/**
+	 * A string indicating the creation date of %CKEditor.
+	 * Do not change it unless you want to force browsers to not use previously cached version of %CKEditor.
+	 */
+	public $timestamp = "%TIMESTAMP%";
+	/**
+	 * An array that holds event listeners.
+	 */
+	private $events = array();
+	/**
+	 * An array that holds global event listeners.
+	 */
+	private $globalEvents = array();
+
+	/**
+	 * Main Constructor.
+	 *
+	 *  @param $basePath (string) URL to the %CKEditor installation directory (optional).
+	 */
+	function __construct($basePath = null) {
+		if (!empty($basePath)) {
+			$this->basePath = $basePath;
+		}
+	}
+
+	/**
+	 * Creates a %CKEditor instance. 
+	 * In incompatible browsers %CKEditor will downgrade to plain HTML &lt;textarea&gt; element.
+	 *
+	 * @param $name (string) Name of the %CKEditor instance (this will be also the "name" attribute of textarea element).
+	 * @param $value (string) Initial value (optional).
+	 * @param $config (array) The specific configurations to apply to this editor instance (optional).
+	 * @param $events (array) Event listeners for this editor instance (optional).
+	 *
+	 * Example usage:
+	 * @code
+	 * $CKEditor = new CKEditor();
+	 * $CKEditor->editor("field1", "<p>Initial value.</p>");
+	 * @endcode
+	 *
+	 * Advanced example:
+	 * @code
+	 * $CKEditor = new CKEditor();
+	 * $config = array();
+	 * $config['toolbar'] = array(
+	 *     array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ),
+	 *     array( 'Image', 'Link', 'Unlink', 'Anchor' )
+	 * );
+	 * $events['instanceReady'] = 'function (ev) {
+	 *     alert("Loaded: " + ev.editor.name);
+	 * }';
+	 * $CKEditor->editor("field1", "<p>Initial value.</p>", $config, $events);
+	 * @endcode
+	 */
+	public function editor($name, $value = "", $config = array(), $events = array())
+	{
+		$attr = "";
+		foreach ($this->textareaAttributes as $key => $val) {
+			$attr.= " " . $key . '="' . str_replace('"', '&quot;', $val) . '"';
+		}
+		$out = "<textarea name=\"" . $name . "\"" . $attr . ">" . htmlspecialchars($value) . "</textarea>\n";
+		if (!$this->initialized) {
+			$out .= $this->init();
+		}
+
+		$_config = $this->configSettings($config, $events);
+
+		$js = $this->returnGlobalEvents();
+		if (!empty($_config))
+			$js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");";
+		else
+			$js .= "CKEDITOR.replace('".$name."');";
+
+		$out .= $this->script($js);
+
+		if (!$this->returnOutput) {
+			print $out;
+			$out = "";
+		}
+
+		return $out;
+	}
+
+	/**
+	 * Replaces a &lt;textarea&gt; with a %CKEditor instance.
+	 *
+	 * @param $id (string) The id or name of textarea element.
+	 * @param $config (array) The specific configurations to apply to this editor instance (optional).
+	 * @param $events (array) Event listeners for this editor instance (optional).
+	 *
+	 * Example 1: adding %CKEditor to &lt;textarea name="article"&gt;&lt;/textarea&gt; element:
+	 * @code
+	 * $CKEditor = new CKEditor();
+	 * $CKEditor->replace("article");
+	 * @endcode
+	 */
+	public function replace($id, $config = array(), $events = array())
+	{
+		$out = "";
+		if (!$this->initialized) {
+			$out .= $this->init();
+		}
+
+		$_config = $this->configSettings($config, $events);
+
+		$js = $this->returnGlobalEvents();
+		if (!empty($_config)) {
+			$js .= "CKEDITOR.replace('".$id."', ".$this->jsEncode($_config).");";
+		}
+		else {
+			$js .= "CKEDITOR.replace('".$id."');";
+		}
+		$out .= $this->script($js);
+
+		if (!$this->returnOutput) {
+			print $out;
+			$out = "";
+		}
+
+		return $out;
+	}
+
+	/**
+	 * Replace all &lt;textarea&gt; elements available in the document with editor instances.
+	 * 
+	 * @param $className (string) If set, replace all textareas with class className in the page.
+	 *
+	 * Example 1: replace all &lt;textarea&gt; elements in the page.
+	 * @code
+	 * $CKEditor = new CKEditor();
+	 * $CKEditor->replaceAll();
+	 * @endcode
+	 * 
+	 * Example 2: replace all &lt;textarea class="myClassName"&gt; elements in the page.
+	 * @code
+	 * $CKEditor = new CKEditor();
+	 * $CKEditor->replaceAll( 'myClassName' );
+	 * @endcode
+	 */
+	public function replaceAll($className = null)
+	{
+		$out = "";
+		if (!$this->initialized) {
+			$out .= $this->init();
+		}
+
+		$_config = $this->configSettings();
+
+		$js = $this->returnGlobalEvents();
+		if (empty($_config)) {
+			if (empty($className)) {
+				$js .= "CKEDITOR.replaceAll();";
+			}
+			else {
+				$js .= "CKEDITOR.replaceAll('".$className."');";
+			}
+		}
+		else {
+			$classDetection = "";
+			$js .= "CKEDITOR.replaceAll( function(textarea, config) {\n";
+			if (!empty($className)) {
+				$js .= "	var classRegex = new RegExp('(?:^| )' + '". $className ."' + '(?:$| )');\n";
+				$js .= "	if (!classRegex.test(textarea.className))\n";
+				$js .= "		return false;\n";
+			}
+			$js .= "	CKEDITOR.tools.extend(config, ". $this->jsEncode($_config) .", true);";
+			$js .= "} );";
+			
+		}
+
+		$out .= $this->script($js);
+
+		if (!$this->returnOutput) {
+			print $out;
+			$out = "";
+		}
+
+		return $out;
+	}
+
+	/**
+	 * Adds event listener.
+	 * Events are fired by %CKEditor in various situations.
+	 *
+	 * @param $event (string) Event name.
+	 * @param $javascriptCode (string) Javascript anonymous function or function name.
+	 *
+	 * Example usage:
+	 * @code
+	 * $CKEditor->addEventHandler('instanceReady', 'function (ev) {
+	 *     alert("Loaded: " + ev.editor.name);
+	 * }');
+	 * @endcode
+	 */
+	public function addEventHandler($event, $javascriptCode)
+	{
+		if (!isset($this->events[$event])) {
+			$this->events[$event] = array();
+		}
+		// Avoid duplicates.
+		if (!in_array($javascriptCode, $this->events[$event])) {
+			$this->events[$event][] = $javascriptCode;
+		}
+	}
+
+	/**
+	 * Clear registered event handlers.
+	 * Note: this function will have no effect on already created editor instances.
+	 * 
+	 * @param $event (string) Event name, if not set all event handlers will be removed (optional).
+	 */
+	public function clearEventHandlers($event = null)
+	{
+		if (!empty($event)) {
+			$this->events[$event] = array();
+		}
+		else {
+			$this->events = array();
+		}
+	}
+
+	/**
+	 * Adds global event listener.
+	 *
+	 * @param $event (string) Event name.
+	 * @param $javascriptCode (string) Javascript anonymous function or function name.
+	 *
+	 * Example usage:
+	 * @code
+	 * $CKEditor->addGlobalEventHandler('dialogDefinition', 'function (ev) {
+	 *     alert("Loading dialog: " + ev.data.name);
+	 * }');
+	 * @endcode
+	 */
+	public function addGlobalEventHandler($event, $javascriptCode)
+	{
+		if (!isset($this->globalEvents[$event])) {
+			$this->globalEvents[$event] = array();
+		}
+		// Avoid duplicates.
+		if (!in_array($javascriptCode, $this->globalEvents[$event])) {
+			$this->globalEvents[$event][] = $javascriptCode;
+		}
+	}
+
+	/**
+	 * Clear registered global event handlers.
+	 * Note: this function will have no effect if the event handler has been already printed/returned.
+	 *
+	 * @param $event (string) Event name, if not set all event handlers will be removed (optional).
+	 */
+	public function clearGlobalEventHandlers($event = null)
+	{
+		if (!empty($event)) {
+			$this->globalEvents[$event] = array();
+		}
+		else {
+			$this->globalEvents = array();
+		}
+	}
+
+	/**
+	 * Prints javascript code.
+	 *
+	 * @param string $js
+	 */
+	private function script($js)
+	{
+		$out = "<script type=\"text/javascript\">";
+		$out .= "//<![CDATA[\n";
+		$out .= $js;
+		$out .= "\n//]]>";
+		$out .= "</script>\n";
+
+		return $out;
+	}
+
+	/**
+	 * Returns the configuration array (global and instance specific settings are merged into one array).
+	 * 
+	 * @param $config (array) The specific configurations to apply to editor instance.
+	 * @param $events (array) Event listeners for editor instance.
+	 */
+	private function configSettings($config = array(), $events = array())
+	{
+		$_config = $this->config;
+		$_events = $this->events;
+
+		if (is_array($config) && !empty($config)) {
+			$_config = array_merge($_config, $config);
+		}
+
+		if (is_array($events) && !empty($events)) {
+			foreach ($events as $eventName => $code) {
+				if (!isset($_events[$eventName])) {
+					$_events[$eventName] = array();
+				}
+				if (!in_array($code, $_events[$eventName])) {
+					$_events[$eventName][] = $code;
+				}
+			}
+		}
+
+		if (!empty($_events)) {
+			foreach($_events as $eventName => $handlers) {
+				if (empty($handlers)) {
+					continue;
+				}
+				else if (count($handlers) == 1) {
+					$_config['on'][$eventName] = '@@'.$handlers[0];
+				}
+				else {
+					$_config['on'][$eventName] = '@@function (ev){';
+					foreach ($handlers as $handler => $code) {
+						$_config['on'][$eventName] .= '('.$code.')(ev);';
+					}
+					$_config['on'][$eventName] .= '}';
+				}
+			}
+		}
+
+		return $_config;
+	}
+
+	/**
+	 * Return global event handlers.
+	 */
+	private function returnGlobalEvents()
+	{
+		static $returnedEvents;
+		$out = "";
+
+		if (!isset($returnedEvents)) {
+			$returnedEvents = array();
+		}
+
+		if (!empty($this->globalEvents)) {
+			foreach ($this->globalEvents as $eventName => $handlers) {
+				foreach ($handlers as $handler => $code) {
+					if (!isset($returnedEvents[$eventName])) {
+						$returnedEvents[$eventName] = array();
+					}
+					// Return only new events
+					if (!in_array($code, $returnedEvents[$eventName])) {
+						$out .= ($code ? "\n" : "") . "CKEDITOR.on('". $eventName ."', $code);";
+						$returnedEvents[$eventName][] = $code;
+					}
+				}
+			}
+		}
+
+		return $out;
+	}
+
+	/**
+	 * Initializes CKEditor (executed only once).
+	 */
+	private function init()
+	{
+		static $initComplete;
+		$out = "";
+
+		if (!empty($initComplete)) {
+			return "";
+		}
+
+		if ($this->initialized) {
+			$initComplete = true;
+			return "";
+		}
+
+		$args = "";
+		$ckeditorPath = $this->ckeditorPath();
+
+		if (!empty($this->timestamp) && $this->timestamp != "%TIMESTAMP%") {
+			$args = '?t=' . $this->timestamp;
+		}
+
+		// Skip relative paths...
+		if (strpos($ckeditorPath, '..') !== 0) {
+			$out .= $this->script("window.CKEDITOR_BASEPATH='". $ckeditorPath ."';");
+		}
+
+		$out .= "<script type=\"text/javascript\" src=\"" . $ckeditorPath . 'ckeditor.js' . $args . "\"></script>\n";
+
+		$extraCode = "";
+		// CKReleaser %REMOVE_START% 
+		if (self::version == '%VERSION%') { 
+			$extraCode .= ($extraCode ? "\n" : "") . "if (typeof(CKEDITOR) == 'undefined') { alert('The CKEDITOR object was not found. Please make sure that the ckeditor.js file is available in your installation.'); }";
+		}
+		// %REMOVE_END% 
+		if (!empty($this->timestamp) && $this->timestamp != self::timestamp) {
+			$extraCode .= ($extraCode ? "\n" : "") . "CKEDITOR.timestamp = '". $this->timestamp ."';";
+		}
+		if ($extraCode) {
+			$out .= $this->script($extraCode);
+		}
+
+		$initComplete = $this->initialized = true;
+
+		return $out;
+	}
+
+	/**
+	 * Return path to ckeditor.js.
+	 */
+	private function ckeditorPath()
+	{
+		if (!empty($this->basePath)) {
+			return $this->basePath;
+		}
+
+		/**
+		 * The absolute pathname of the currently executing script.
+		 * Note: If a script is executed with the CLI, as a relative path, such as file.php or ../file.php,
+		 * $_SERVER['SCRIPT_FILENAME'] will contain the relative path specified by the user.
+		 */
+		if (isset($_SERVER['SCRIPT_FILENAME'])) {
+			$realPath = dirname($_SERVER['SCRIPT_FILENAME']);
+		}
+		else {
+			/**
+			 * realpath — Returns canonicalized absolute pathname
+			 */
+			$realPath = realpath( './' ) ;
+		}
+
+		/**
+		 * The filename of the currently executing script, relative to the document root.
+		 * For instance, $_SERVER['PHP_SELF'] in a script at the address http://example.com/test.php/foo.bar
+		 * would be /test.php/foo.bar.
+		 */
+		$selfPath = dirname($_SERVER['PHP_SELF']);
+		$file = str_replace("\\", "/", __FILE__);
+
+		if (!$selfPath || !$realPath || !$file) {
+			return "/ckeditor/";
+		}
+
+		$documentRoot = substr($realPath, 0, strlen($realPath) - strlen($selfPath));
+		$fileUrl = substr($file, strlen($documentRoot));
+		$ckeditorUrl = str_replace("ckeditor_php5.php", "", $fileUrl);
+
+		return $ckeditorUrl;
+	}
+
+	/**
+	 * This little function provides a basic JSON support.
+	 * http://php.net/manual/en/function.json-encode.php
+	 *
+	 * @param mixed $val
+	 * @return string
+	 */
+	private function jsEncode($val)
+	{
+		if (is_null($val)) {
+			return 'null';
+		}
+		if ($val === false) {
+			return 'false';
+		}
+		if ($val === true) {
+			return 'true';
+		}
+		if (is_scalar($val))
+		{
+			if (is_float($val))
+			{
+				// Always use "." for floats.
+				$val = str_replace(",", ".", strval($val));
+			}
+
+			// Use @@ to not use quotes when outputting string value
+			if (strpos($val, '@@') === 0) {
+				return substr($val, 2);
+			}
+			else {
+				// All scalars are converted to strings to avoid indeterminism.
+				// PHP's "1" and 1 are equal for all PHP operators, but
+				// JS's "1" and 1 are not. So if we pass "1" or 1 from the PHP backend,
+				// we should get the same result in the JS frontend (string).
+				// Character replacements for JSON.
+				static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'),
+				array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
+
+				$val = str_replace($jsonReplaces[0], $jsonReplaces[1], $val);
+
+				return '"' . $val . '"';
+			}
+		}
+		$isList = true;
+		for ($i = 0, reset($val); $i < count($val); $i++, next($val))
+		{
+			if (key($val) !== $i)
+			{
+				$isList = false;
+				break;
+			}
+		}
+		$result = array();
+		if ($isList)
+		{
+			foreach ($val as $v) $result[] = $this->jsEncode($v);
+			return '[ ' . join(', ', $result) . ' ]';
+		}
+		else
+		{
+			foreach ($val as $k => $v) $result[] = $this->jsEncode($k).': '.$this->jsEncode($v);
+			return '{ ' . join(', ', $result) . ' }';
+		}
+	}
+}
Index: /CKEditor/trunk/config.js
===================================================================
--- /CKEditor/trunk/config.js	(revision 4773)
+++ /CKEditor/trunk/config.js	(revision 4774)
@@ -1,3 +1,3 @@
-﻿/*
+/*
 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
 For licensing, see LICENSE.html or http://ckeditor.com/license
