Index: /FCKeditor/trunk/_whatsnew.html
===================================================================
--- /FCKeditor/trunk/_whatsnew.html	(revision 1685)
+++ /FCKeditor/trunk/_whatsnew.html	(revision 1686)
@@ -54,4 +54,7 @@
 		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1695">#1695</a>] Removed
 			Ctrl-Tab hotkey for Source mode and allowed Ctrl-T to work in Firefox.</li>
+		<li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1666">#1666</a>] Fixed 
+			permission denied errors during opening popup menus in IE6 under domain relaxation
+			mode.</li>
 	</ul>
 	<h3>
Index: /FCKeditor/trunk/editor/_source/classes/fckpanel.js
===================================================================
--- /FCKeditor/trunk/editor/_source/classes/fckpanel.js	(revision 1685)
+++ /FCKeditor/trunk/editor/_source/classes/fckpanel.js	(revision 1686)
@@ -35,17 +35,30 @@
 	if ( FCKBrowserInfo.IsIE )
 	{
+		// Create the Popup that will hold the panel.
+		// The popup has to be created before playing with domain hacks, see #1666.
+		this._Popup	= this._Window.createPopup() ;
+
+		// this._Window cannot be accessed while playing with domain hacks, but local variable is ok.
+		// See #1666.
+		var pDoc = this._Window.document ;
+
 		// This is a trick to IE6 (not IE7). The original domain must be set
 		// before creating the popup, so we are able to take a refence to the
 		// document inside of it, and the set the proper domain for it. (#123)
 		if ( FCK_IS_CUSTOM_DOMAIN )
+		{
+			pDoc.domain = FCK_ORIGINAL_DOMAIN ;
 			document.domain = FCK_ORIGINAL_DOMAIN ;
-
-		// Create the Popup that will hold the panel.
-		this._Popup	= this._Window.createPopup() ;
+		}
+
 		oDocument = this.Document = this._Popup.document ;
 
 		// Set the proper domain inside the popup.
 		if ( FCK_IS_CUSTOM_DOMAIN )
-			document.domain = oDocument.domain = FCK_RUNTIME_DOMAIN ;
+		{
+			oDocument.domain = FCK_RUNTIME_DOMAIN ;
+			pDoc.domain = FCK_RUNTIME_DOMAIN ;
+			document.domain = FCK_RUNTIME_DOMAIN ;
+		}
 
 		FCK.IECleanup.AddItem( this, FCKPanel_Cleanup ) ;
