Index: /CKEditor/trunk/_source/core/config.js
===================================================================
--- /CKEditor/trunk/_source/core/config.js	(revision 3159)
+++ /CKEditor/trunk/_source/core/config.js	(revision 3160)
@@ -148,5 +148,5 @@
 	 */
 
-	plugins : 'basicstyles,blockquote,button,clipboard,colorbutton,elementspath,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,newpage,pagebreak,pastefromword,pastetext,preview,print,removeformat,smiley,showblocks,sourcearea,stylescombo,table,specialchar,tab,templates,toolbar,undo,wysiwygarea',
+	plugins : 'basicstyles,blockquote,button,clipboard,colorbutton,elementspath,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,newpage,pagebreak,pastefromword,pastetext,preview,print,removeformat,smiley,showblocks,sourcearea,stylescombo,table,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',
 
 	/**
Index: /CKEditor/trunk/_source/lang/en.js
===================================================================
--- /CKEditor/trunk/_source/lang/en.js	(revision 3159)
+++ /CKEditor/trunk/_source/lang/en.js	(revision 3160)
@@ -377,4 +377,27 @@
 	},
 
+	// Speller Pages Dialog
+	spellCheck :
+	{
+		toolbar			: 'Check Spelling',
+		title			: 'Spell Check',
+		notAvailable	: 'Sorry, but service is unavailable now.',
+		errorLoading	: 'Error loading application service host: %s.',
+		notInDic		: 'Not in dictionary',
+		changeTo		: 'Change to',
+		btnIgnore		: 'Ignore',
+		btnIgnoreAll	: 'Ignore All',
+		btnReplace		: 'Replace',
+		btnReplaceAll	: 'Replace All',
+		btnUndo			: 'Undo',
+		noSuggestions	: '- No suggestions -',
+		progress		: 'Spell check in progress...',
+		noMispell		: 'Spell check complete: No misspellings found',
+		noChanges		: 'Spell check complete: No words changed',
+		oneChange		: 'Spell check complete: One word changed',
+		manyChanges		: 'Spell check complete: %1 words changed',
+		ieSpellDownload	: 'Spell checker not installed. Do you want to download it now?'
+	},
+
 	smiley :
 	{
Index: /CKEditor/trunk/_source/plugins/toolbar/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/toolbar/plugin.js	(revision 3159)
+++ /CKEditor/trunk/_source/plugins/toolbar/plugin.js	(revision 3160)
@@ -213,5 +213,5 @@
 [
 	['Source','-','NewPage','Preview','-','Templates'],
-	['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print'],
+	['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker'],
 	['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
 	['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
Index: /CKEditor/trunk/_source/plugins/wsc/dialogs/tmpFrameset.html
===================================================================
--- /CKEditor/trunk/_source/plugins/wsc/dialogs/tmpFrameset.html	(revision 3160)
+++ /CKEditor/trunk/_source/plugins/wsc/dialogs/tmpFrameset.html	(revision 3160)
@@ -0,0 +1,52 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html>
+<head>
+	<title></title>
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+	<script type="text/javascript">
+
+function doLoadScript( url )
+{
+	if ( !url )
+		return false ;
+
+	var s = document.createElement( "script" ) ;
+	s.type = "text/javascript" ;
+	s.src = url ;
+	document.getElementsByTagName( "head" )[ 0 ].appendChild( s ) ;
+
+	return true ;
+}
+
+function tryLoad ()
+{
+    if ( typeof( opener ) == 'undefined' || !opener )
+        opener = parent ;
+
+    // get access to global parameters
+    oParams = opener.oldFramesetPageParams ;
+
+    // make frameset rows string prepare
+    sFramesetRows = ( parseInt( oParams.firstframeh, 10 ) || '30') + ",*," + ( parseInt( oParams.thirdframeh, 10 ) || '150' ) + ',0' ;
+    document.getElementById( 'itFrameset' ).rows = sFramesetRows ;
+
+    // dynamic including init frames and crossdomain transport code
+    // from config sproxy_js_frameset url
+    var addScriptUrl = oParams.sproxy_js_frameset ;
+    doLoadScript( addScriptUrl ) ;
+}
+
+	</script>
+</head>
+
+<frameset id="itFrameset" onload="tryLoad();" border="0" rows="30,*,*,0">
+    <frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="0" marginwidth="2" src="" name="navbar"></frame>
+    <frame scrolling="auto" framespacing="0" frameborder="0" noresize="noresize" marginheight="0" marginwidth="0" src="" name="mid"></frame>
+    <frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="1" marginwidth="1" src="" name="bot"></frame>
+    <frame scrolling="no" framespacing="0" frameborder="0" noresize="noresize" marginheight="1" marginwidth="1" src="" name="spellsuggestall"></frame>
+</frameset>
+</html>
Index: /CKEditor/trunk/_source/plugins/wsc/dialogs/wsc.css
===================================================================
--- /CKEditor/trunk/_source/plugins/wsc/dialogs/wsc.css	(revision 3160)
+++ /CKEditor/trunk/_source/plugins/wsc/dialogs/wsc.css	(revision 3160)
@@ -0,0 +1,83 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+html, body
+{
+	background-color: transparent;
+	margin: 0px;
+	padding: 0px;
+}
+
+body
+{
+	padding: 10px;
+}
+
+body, td, input, select, textarea
+{
+	font-size: 11px;
+	font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana;
+}
+
+.midtext
+{
+	padding:0px;
+	margin:10px;
+}
+
+.midtext p
+{
+	padding:0px;
+	margin:10px;
+}
+
+.Button
+{
+	border: #737357 1px solid;
+	color: #3b3b1f;
+	background-color: #c7c78f;
+}
+
+.PopupTabArea
+{
+	color: #737357;
+	background-color: #e3e3c7;
+}
+
+.PopupTitleBorder
+{
+	border-bottom: #d5d59d 1px solid;
+}
+.PopupTabEmptyArea
+{
+	padding-left: 10px;
+	border-bottom: #d5d59d 1px solid;
+}
+
+.PopupTab, .PopupTabSelected
+{
+	border-right: #d5d59d 1px solid;
+	border-top: #d5d59d 1px solid;
+	border-left: #d5d59d 1px solid;
+	padding: 3px 5px 3px 5px;
+	color: #737357;
+}
+
+.PopupTab
+{
+	margin-top: 1px;
+	border-bottom: #d5d59d 1px solid;
+	cursor: pointer;
+	cursor: hand;
+}
+
+.PopupTabSelected
+{
+	font-weight: bold;
+	cursor: default;
+	padding-top: 4px;
+	border-bottom: #f1f1e3 1px solid;
+	background-color: #f1f1e3;
+}
Index: /CKEditor/trunk/_source/plugins/wsc/dialogs/wsc.js
===================================================================
--- /CKEditor/trunk/_source/plugins/wsc/dialogs/wsc.js	(revision 3160)
+++ /CKEditor/trunk/_source/plugins/wsc/dialogs/wsc.js	(revision 3160)
@@ -0,0 +1,160 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.dialog.add( 'checkspell', function( editor )
+{
+	var number = CKEDITOR.tools.getNextNumber(),
+		iframeId = 'cke_frame_' + number,
+		textareaId = 'cke_data_' + number,
+		errorBoxId = 'cke_error_' + number,
+		interval,
+		protocol = document.location.protocol || 'http:',
+		errorMsg = editor.lang.spellCheck.notAvailable;
+
+	var pasteArea = '<textarea'+
+			' style="display: none"' +
+			' id="' + textareaId + '"' +
+			' rows="10"' +
+			' cols="40">' +
+		' </textarea><div' + 
+			' id="' + errorBoxId + '"' +
+			' style="display:none;color:red;font-size:16px;font-weight:bold;padding-top:160px;text-align:center;z-index:11;">' + 
+		'</div><iframe' +
+			' src=""' +
+			' style="width:485px;background-color:#f1f1e3;height:380px"' +
+			' frameborder="0"' +
+			' name="' + iframeId + '"' +
+			' id="' + iframeId + '"' +
+			' allowtransparency="1">' +
+		'</iframe>';
+
+	var wscCoreUrl = editor.config.wsc_customLoaderScript || ( protocol +
+			'//loader.spellchecker.net/sproxy_fck/sproxy.php'
+			+ '?plugin=fck2'
+			+ '&customerid=' + editor.config.wsc_customerId 
+			+ '&cmd=script&doc=wsc&schema=22' 
+		);
+
+	if ( editor.config.wsc_customLoaderScript )
+		errorMsg += '<p style="color:#000;font-size:11px;font-weight: normal;text-align:center;padding-top:10px">' + 
+			editor.lang.spellCheck.errorLoading.replace( /%s/g, editor.config.wsc_customLoaderScript ) + '</p>';
+
+	function burnSpelling( dialog, errorMsg )
+	{
+		var i = 0;
+		return function ()
+		{
+			if ( typeof( doSpell ) == 'function' )
+				initAndSpell( dialog );
+			else if ( i++ == 180 )								// Timeout: 180 * 250ms = 45s.
+				_cancelOnError( errorMsg );
+		}
+	};
+
+	function _cancelOnError( m )
+	{
+		if ( typeof( WSC_Error ) == 'undefined' )
+		{
+			CKEDITOR.document.getById( iframeId ).setStyle( 'display', 'none' );
+			var errorBox = CKEDITOR.document.getById( errorBoxId );
+			errorBox.setStyle( 'display', 'block' );
+			errorBox.setHtml( m || editor.lang.spellCheck.notAvailable );
+		}
+	}
+
+	function initAndSpell( dialog )
+	{
+		//Call from window.setInteval expected at once.
+		if ( typeof( interval ) == 'undefined' )
+			return null;
+		window.clearInterval( interval );
+
+		// Global var is used in FCK specific core.
+		gFCKPluginName = 'wsc';
+
+		var sData = editor.getData(),											// Get the data to be checked.
+			LangComparer = new _SP_FCK_LangCompare(),							// Language abbr standarts comparer.
+			pluginPath = CKEDITOR.getUrl( editor.plugins.wsc.path + 'dialogs/' ),			// Service paths corecting/preparing.
+			framesetPath = pluginPath + 'tmpFrameset.html';
+
+		LangComparer.setDefaulLangCode( editor.config.defaultLanguage );
+
+		// Prepare content.
+		CKEDITOR.document.getById( textareaId ).setValue( sData );
+
+		// Hide user message console (if application was loaded more then after timeout).
+		CKEDITOR.document.getById( errorBoxId ).setStyle( 'display', 'none' );
+		CKEDITOR.document.getById( iframeId ).setStyle( 'display', 'block' );
+
+		doSpell({
+			ctrl : textareaId,
+			lang : LangComparer.getSPLangCode( editor.langCode ),
+			winType : iframeId,		// If not defined app will run on winpopup.
+
+			// Callback binding section.
+			onCancel : function()
+			{
+				dialog.hide();
+			},
+			onFinish : function( dT )
+			{
+				dialog.restoreSelection();
+				dialog.clearSavedSelection();
+				dialog.getParentEditor().setData( dT.value );
+				dialog.hide();
+			},
+
+			// Some manipulations with client static pages.
+			staticFrame : framesetPath,
+			framesetPath : framesetPath,
+			iframePath : pluginPath + 'ciframe.html',
+
+			// Styles defining.
+			schemaURI : pluginPath + 'wsc.css'
+		});
+	};
+
+	return {
+		title : editor.lang.spellCheck.title,
+		minWidth : 540,
+		minHeight : 480,
+		buttons : [ CKEDITOR.dialog.cancelButton ],
+		onShow : function()
+		{
+			contentArea = this.getContentElement( 'general', 'content' ).getElement();
+			contentArea.setHtml( pasteArea ); 
+
+			if ( typeof( doSpell ) != 'function' )
+			{
+				// Load script.
+				CKEDITOR.document.getHead().append( 
+					CKEDITOR.document.createElement( 'script',
+						{
+							attributes :
+								{
+									type : 'text/javascript',
+									src : wscCoreUrl
+								}
+						})
+				);
+			}
+			interval = window.setInterval( burnSpelling( this, errorMsg ), 250 );
+		},
+		contents : [
+			{
+				id : 'general',
+				label : editor.lang.spellCheck.title,
+				elements : [
+					{
+						type : 'html',
+						id : 'content',
+						style : 'width:500px;height:400px',
+						html : '<div></div>'
+					}
+				]
+			}
+		]
+	};
+});
Index: /CKEditor/trunk/_source/plugins/wsc/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/wsc/plugin.js	(revision 3160)
+++ /CKEditor/trunk/_source/plugins/wsc/plugin.js	(revision 3160)
@@ -0,0 +1,33 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @file Spell checker
+ */
+ 
+// Register a plugin named "wsc".
+CKEDITOR.plugins.add( 'wsc',
+{
+	init : function( editor, pluginPath )
+	{
+		var commandName = 'checkspell';
+
+		var command = editor.addCommand( commandName, new CKEDITOR.dialogCommand( commandName ) );
+
+		// SpellChecker doesn't work in Opera.
+		if ( CKEDITOR.env.opera )
+			command.state = CKEDITOR.TRISTATE_DISABLED;
+
+		editor.ui.addButton( 'SpellChecker',
+			{
+				label : editor.lang.spellCheck.title,
+				command : commandName
+			});
+		CKEDITOR.dialog.add( commandName, this.path + 'dialogs/wsc.js' );
+	}
+});
+ 
+CKEDITOR.config.wsc_customerId			= CKEDITOR.config.wsc_customerId || '1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk' ;
+CKEDITOR.config.wsc_customLoaderScript	= CKEDITOR.config.wsc_customLoaderScript || null;
Index: /CKEditor/trunk/_source/skins/default/toolbar.css
===================================================================
--- /CKEditor/trunk/_source/skins/default/toolbar.css	(revision 3159)
+++ /CKEditor/trunk/_source/skins/default/toolbar.css	(revision 3160)
@@ -305,4 +305,9 @@
 }
 
+.cke_skin_default a.cke_button_checkspell .cke_icon
+{
+	background-position: 0 -192px;
+}
+
 .cke_skin_default a.cke_button_pagebreak .cke_icon
 {
