Index: /FCKeditor/trunk/_testcases/010.html
===================================================================
--- /FCKeditor/trunk/_testcases/010.html	(revision 450)
+++ /FCKeditor/trunk/_testcases/010.html	(revision 451)
@@ -49,5 +49,5 @@
 		FCKeditor - Test 010</h1>
 	<p>
-		<strong>Expected results</strong>: The editor content must be loaded and the the
+		<strong>Expected results</strong>: The editor content must be loaded and the
 		user must be able to change the toolbar dinamically (without reloading the page).<br />
 		<strong>Configurations</strong>: Default<br />
Index: /FCKeditor/trunk/_whatsnew.html
===================================================================
--- /FCKeditor/trunk/_whatsnew.html	(revision 450)
+++ /FCKeditor/trunk/_whatsnew.html	(revision 451)
@@ -118,4 +118,6 @@
 		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/299">#299</a>] The 'Browse Server' button in the Image
 			and Flash dialogs was a little too high.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/931">#931</a>] The BodyId and BodyClass configuration 
+			settings weren't applied in the preview window.</li>
 	</ul>
 	<h3>
Index: /FCKeditor/trunk/editor/_source/classes/fckdataprocessor.js
===================================================================
--- /FCKeditor/trunk/editor/_source/classes/fckdataprocessor.js	(revision 450)
+++ /FCKeditor/trunk/editor/_source/classes/fckdataprocessor.js	(revision 451)
@@ -80,14 +80,6 @@
 				html += ' style="overflow-y: scroll"' ;
 
-			html += '><head><title></title></head><body' ;
-
-			// Add id and class to the body.
-			if ( FCKConfig.BodyId.length > 0 )
-				html += ' id="' + FCKConfig.BodyId + '"' ;
-			if ( FCKConfig.BodyClass.length > 0 )
-				html += ' class="' + FCKConfig.BodyClass + '"' ;
-
-			html +=
-				'>' +
+			html += '><head><title></title></head>' +
+				'<body' + FCKConfig.GetBodyAttributes() + '>' +
 				data +
 				'</body></html>' ;
Index: /FCKeditor/trunk/editor/_source/classes/fcktoolbarfontformatcombo.js
===================================================================
--- /FCKeditor/trunk/editor/_source/classes/fcktoolbarfontformatcombo.js	(revision 450)
+++ /FCKeditor/trunk/editor/_source/classes/fcktoolbarfontformatcombo.js	(revision 451)
@@ -53,8 +53,5 @@
 
 	// Add ID and Class to the body
-	if ( FCKConfig.BodyId && FCKConfig.BodyId.length > 0 )
-		oTargetDoc.body.id = FCKConfig.BodyId ;
-	if ( FCKConfig.BodyClass && FCKConfig.BodyClass.length > 0 )
-		oTargetDoc.body.className += ' ' + FCKConfig.BodyClass ;
+	FCKConfig.ApplyBodyAttributes( oTargetDoc.body ) ;
 
 	// Get the format names from the language file.
Index: /FCKeditor/trunk/editor/_source/classes/fcktoolbarstylecombo.js
===================================================================
--- /FCKeditor/trunk/editor/_source/classes/fcktoolbarstylecombo.js	(revision 450)
+++ /FCKeditor/trunk/editor/_source/classes/fcktoolbarstylecombo.js	(revision 451)
@@ -50,9 +50,5 @@
 
 	// Add ID and Class to the body
-	if ( FCKConfig.BodyId && FCKConfig.BodyId.length > 0 )
-		oTargetDoc.body.id = FCKConfig.BodyId ;
-	if ( FCKConfig.BodyClass && FCKConfig.BodyClass.length > 0 )
-		oTargetDoc.body.className += ' ' + FCKConfig.BodyClass ;
-
+	FCKConfig.ApplyBodyAttributes( oTargetDoc.body ) ;
 
 	// For some reason Gecko is blocking inside the "RefreshVisibleItems" function.
Index: /FCKeditor/trunk/editor/_source/internals/fck.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fck.js	(revision 450)
+++ /FCKeditor/trunk/editor/_source/internals/fck.js	(revision 451)
@@ -517,5 +517,5 @@
 				'<title>' + FCKLang.Preview + '</title>' +
 				_FCK_GetEditorAreaStyleTags() +
-				'</head><body>' +
+				'</head><body' + FCKConfig.GetBodyAttributes() + '>' +
 				FCK.GetXHTML() +
 				'</body></html>' ;
Index: /FCKeditor/trunk/editor/_source/internals/fckconfig.js
===================================================================
--- /FCKeditor/trunk/editor/_source/internals/fckconfig.js	(revision 450)
+++ /FCKeditor/trunk/editor/_source/internals/fckconfig.js	(revision 451)
@@ -209,2 +209,25 @@
 	return html.replace( /(<|&lt;)!--\{PS..(\d+)\}--(>|&gt;)/g, _Replace ) ;
 }
+
+// Returns a string with the attributes that must be appended to the body
+FCKConfig.GetBodyAttributes = function()
+{
+	var bodyAttributes = '' ;
+	// Add id and class to the body.
+	if ( this.BodyId && this.BodyId.length > 0 )
+		bodyAttributes += ' id="' + this.BodyId + '"' ;
+	if ( this.BodyClass && this.BodyClass.length > 0 )
+		bodyAttributes += ' class="' + this.BodyClass + '"' ;
+
+	return bodyAttributes ;
+}
+
+// Sets the body attributes directly on the node
+FCKConfig.ApplyBodyAttributes = function( oBody )
+{
+	// Add ID and Class to the body
+	if ( this.BodyId && this.BodyId.length > 0 )
+		oBody.id = FCKConfig.BodyId ;
+	if ( this.BodyClass && this.BodyClass.length > 0 )
+		oBody.className += ' ' + FCKConfig.BodyClass ;
+}
