Index: _whatsnew.html
===================================================================
--- _whatsnew.html	(revision 1684)
+++ _whatsnew.html	(working copy)
@@ -53,6 +53,9 @@
 			an issue in FCKTools.FixCssUrls that, other than wrong, was breaking Opera.</li>
 		<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>
 		Version 2.6 Beta 1</h3>
Index: editor/_source/classes/fckpanel.js
===================================================================
--- editor/_source/classes/fckpanel.js	(revision 1683)
+++ editor/_source/classes/fckpanel.js	(working copy)
@@ -34,19 +34,32 @@
 
 	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 ) ;
 	}
