Index: /CKEditor/trunk/_source/core/config.js
===================================================================
--- /CKEditor/trunk/_source/core/config.js	(revision 3055)
+++ /CKEditor/trunk/_source/core/config.js	(revision 3056)
@@ -147,5 +147,6 @@
 	 * config.plugins = 'basicstyles,button,htmldataprocessor,toolbar,wysiwygarea';
 	 */
-	plugins : 'basicstyles,button,elementspath,horizontalrule,htmldataprocessor,keystrokes,newpage,pagebreak,removeformat,smiley,indent,link,list,sourcearea,table,specialchar,tab,toolbar,wysiwygarea',
+
+	plugins : 'basicstyles,button,elementspath,horizontalrule,htmldataprocessor,keystrokes,newpage,pagebreak,preview,removeformat,smiley,indent,link,list,sourcearea,table,specialchar,tab,toolbar,wysiwygarea',
 
 	/**
Index: /CKEditor/trunk/_source/lang/en.js
===================================================================
--- /CKEditor/trunk/_source/lang/en.js	(revision 3055)
+++ /CKEditor/trunk/_source/lang/en.js	(revision 3056)
@@ -31,4 +31,5 @@
 	source			: 'Source',
 	newPage			: 'New Page',
+	preview			: 'Preview',
 	print			: 'Print',
 	underline		: 'Underline',
Index: /CKEditor/trunk/_source/plugins/preview/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/preview/plugin.js	(revision 3056)
+++ /CKEditor/trunk/_source/plugins/preview/plugin.js	(revision 3056)
@@ -0,0 +1,94 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @file Preview plugin.
+ */
+
+(function()
+{
+	var previewCmd =
+	{
+		exec : function( editor )
+		{
+			var sHTML,
+				isCustomDomain = CKEDITOR.env.ie && document.domain != window.location.hostname;
+			if ( editor.config.fullPage )
+				sHTML = editor.getData();
+			else
+			{
+				var bodyHtml = '<body ',
+					body = CKEDITOR.document.getBody(),
+					baseTag = ( editor.config.baseHref.length > 0 ) ? '<base href="' + editor.config.baseHref + '" _cktemp="true"></base>' : '';
+
+				if ( body.getAttribute( 'id' ) )
+					bodyHtml += 'id="' + body.getAttribute( 'id' ) + '" ';
+				if ( body.getAttribute( 'class' ) )
+					bodyHtml += 'class="' + body.getAttribute( 'class' ) + '" ';
+				bodyHtml += '>';
+
+				sHTML =
+					editor.config.docType +
+					'<html dir="' + editor.config.contentsLangDirection + '">' +
+					'<head>' +
+					baseTag +
+					'<title>' + editor.lang.preview + '</title>' +
+					'<link href="' + editor.config.contentsCss + '" type="text/css" rel="stylesheet" _cktemp="true"/>' +
+					'</head>' + bodyHtml +
+					editor.getData() +
+					'</body></html>';
+			}
+
+			var iWidth	= 640,	// 800 * 0.8,
+				iHeight	= 420,	// 600 * 0.7,
+				iLeft	= 80;	// (800 - 0.8 * 800) /2 = 800 * 0.1.
+			try
+			{
+				iWidth = Math.Round( screen.width * 0.8 );
+				iHeight = Math.Round( screen.height * 0.7 );
+				iLeft = Math.Round( screen.width * 0.1 );
+			}
+			catch ( e ){}
+
+			var sOpenUrl = '';
+			if ( isCustomDomain )
+			{
+				window._cke_htmlToLoad = sHTML;
+				sOpenUrl = 'javascript:void( (function(){' +
+					'document.open();' +
+					'document.domain="' + document.domain + '";' +
+					'document.write( window.opener._cke_htmlToLoad );' +
+					'document.close();' +
+					'window.opener._cke_htmlToLoad = null;' +
+					'})() )';
+			}
+
+			var oWindow = window.open( sOpenUrl, null, 'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' + 
+				iWidth + ',height=' + iHeight + ',left=' + iLeft );
+
+			if ( !isCustomDomain )
+			{
+				oWindow.document.write( sHTML );
+				oWindow.document.close();
+			}
+		}
+	};
+
+	var pluginName = 'preview';
+
+	// Register a plugin named "preview".
+	CKEDITOR.plugins.add( pluginName,
+	{
+		init : function( editor, pluginPath )
+		{
+			editor.addCommand( pluginName, previewCmd );
+			editor.ui.addButton( 'Preview',
+				{
+					label : editor.lang.preview,
+					command : pluginName
+				});
+		}
+	});
+})();
Index: /CKEditor/trunk/_source/plugins/toolbar/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/toolbar/plugin.js	(revision 3055)
+++ /CKEditor/trunk/_source/plugins/toolbar/plugin.js	(revision 3056)
@@ -208,5 +208,5 @@
 	[
 		'Source', '-',
-		'NewPage', '-',
+		'NewPage', 'Preview', '-',
 		'Bold', 'Italic', 'Underline', 'Strike', '-',
 		'NumberedList', 'BulletedList', '-',
Index: /CKEditor/trunk/_source/skins/default/toolbar.css
===================================================================
--- /CKEditor/trunk/_source/skins/default/toolbar.css	(revision 3055)
+++ /CKEditor/trunk/_source/skins/default/toolbar.css	(revision 3056)
@@ -152,4 +152,9 @@
 }
 
+.cke_skin_default a.cke_button_preview .cke_icon
+{
+	background-position: 0 -64px;
+}
+
 .cke_skin_default a.cke_button_find .cke_icon
 {
