Index: /FCKeditor/trunk/_dev/browserbugs/ie/createpopupleak.html
===================================================================
--- /FCKeditor/trunk/_dev/browserbugs/ie/createpopupleak.html	(revision 780)
+++ /FCKeditor/trunk/_dev/browserbugs/ie/createpopupleak.html	(revision 780)
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+	<title></title>
+	<script type="text/javascript">
+
+window.onload = function()
+{
+	var popup = window.createPopup() ;
+	popup = window.createPopup() ;
+	popup = window.createPopup() ;
+	popup = window.createPopup() ;
+	popup = window.createPopup() ;
+	popup = window.createPopup() ;
+	popup = window.createPopup() ;
+	popup = window.createPopup() ;
+	popup = window.createPopup() ;
+	popup = window.createPopup() ;
+	popup = window.createPopup() ;
+	popup = window.createPopup() ;
+	popup = window.createPopup() ;
+}
+
+	</script>
+</head>
+<body>
+	<p>
+		Just open this page on IE. Each page refresh will leak about 1Mb (exactly 80Kb per
+		createPopup() call).
+	</p>
+</body>
+</html>
Index: /FCKeditor/trunk/_test/manual/fckpanel/test1.html
===================================================================
--- /FCKeditor/trunk/_test/manual/fckpanel/test1.html	(revision 779)
+++ /FCKeditor/trunk/_test/manual/fckpanel/test1.html	(revision 780)
@@ -27,26 +27,21 @@
 
 // Used by FCKPanel.
-var FCKFocusManager = {
+var FCKFocusManager =
+{
 	Lock : function() {},
 	Unlock : function() {}
 } ;
 
+var FCKLang =
+{
+	Dir : 'ltr'
+} ;
+
 	</script>
-	<script src="../../../editor/_source/fckjscoreextensions.js" type="text/javascript"></script>
-	<script src="../../../editor/_source/internals/fckbrowserinfo.js" type="text/javascript"></script>
 	<script src="../../../editor/_source/classes/fckiecleanup.js" type="text/javascript"></script>
-	<script src="../../../editor/_source/internals/fckconfig.js" type="text/javascript"></script>
-	<script src="../../../editor/_source/internals/fcktools.js" type="text/javascript"></script>
-	<script src="../../../editor/lang/en.js" type="text/javascript"></script>
-	<script src="../../../editor/_source/classes/fckpanel.js" type="text/javascript"></script>
-	<script src="../../../editor/_source/internals/fckdebug.js" type="text/javascript"></script>
+	<script src="../../../editor/_source/fckscriptloader.js" type="text/javascript"></script>
 	<script type="text/javascript">
 
-function LoadScript( url )
-{
-	document.write( '<script type="text/javascript" src="' + url + '"><\/script>' ) ;
-}
-var sSuffix = /msie/.test( navigator.userAgent.toLowerCase() ) ? 'ie' : 'gecko' ;
-LoadScript( '../../../editor/_source/internals/fcktools_' + sSuffix + '.js' ) ;
+FCKScriptLoader.Load( 'FCKPanel' ) ;
 
 	</script>
@@ -55,4 +50,6 @@
 if ( FCKBrowserInfo.IsIE )
 	FCK.IECleanup = new FCKIECleanup( window ) ;
+
+window.FCKUnloadFlag = true ;
 
 var oPanel ;
@@ -68,4 +65,5 @@
 
 	FCKConfig.FloatingPanelsZIndex = 10000 ;
+
 	// Automatically calculates the editor base path based on the _test directory.
 	var sBasePath = document.location.pathname.substring(0, document.location.pathname.lastIndexOf('_test')) ;
Index: /FCKeditor/trunk/editor/_source/classes/fckpanel.js
===================================================================
--- /FCKeditor/trunk/editor/_source/classes/fckpanel.js	(revision 779)
+++ /FCKeditor/trunk/editor/_source/classes/fckpanel.js	(revision 780)
@@ -120,4 +120,5 @@
 {
 	var iMainWidth ;
+	var eMainNode = this.MainNode ;
 
 	if ( this._Popup )
@@ -130,7 +131,7 @@
 		// The following lines must be place after the above "show", otherwise it
 		// doesn't has the desired effect.
-		FCKTools.SetNodeStyles( this.MainNode, { 'width' : ( width ? width + 'px' : '' ), 'height' : ( height ? height + 'px' : '' )  } ) ;
-
-		iMainWidth = this.MainNode.offsetWidth ;
+		FCKTools.SetNodeStyles( eMainNode, { 'width' : ( width ? width + 'px' : '' ), 'height' : ( height ? height + 'px' : '' )  } ) ;
+
+		iMainWidth = eMainNode.offsetWidth ;
 
 		if ( this.IsRTL )
@@ -143,5 +144,5 @@
 
 		// Second call: Show the Popup at the specified location, with the correct size.
-		this._Popup.show( x, y, iMainWidth, this.MainNode.offsetHeight, relElement ) ;
+		this._Popup.show( x, y, iMainWidth, eMainNode.offsetHeight, relElement ) ;
 
 		if ( this.OnHide )
@@ -162,7 +163,7 @@
 			this.ParentPanel.Lock() ;
 
-		FCKTools.SetNodeStyles( this.MainNode, { 'width' : ( width ? width + 'px' : '' ), 'height' : ( height ? height + 'px' : '' )  } ) ;
-
-		iMainWidth = this.MainNode.offsetWidth ;
+		FCKTools.SetNodeStyles( eMainNode, { 'width' : ( width ? width + 'px' : '' ), 'height' : ( height ? height + 'px' : '' )  } ) ;
+
+		iMainWidth = eMainNode.offsetWidth ;
 
 		if ( !width )	this._IFrame.width	= 1 ;
@@ -174,7 +175,7 @@
 		// work when the editor is in RTL.
 		//
-		// The "|| this.MainNode.firstChild.offsetWidth" part has been added
+		// The "|| eMainNode.firstChild.offsetWidth" part has been added
 		// for Opera compatibility (see #570).
-		iMainWidth = this.MainNode.offsetWidth || this.MainNode.firstChild.offsetWidth ;
+		iMainWidth = eMainNode.offsetWidth || eMainNode.firstChild.offsetWidth ;
 
 		var oPos = FCKTools.GetElementPosition(
@@ -208,6 +209,6 @@
 				x -= x + iMainWidth - iViewPaneWidth ;
 
-			if ( ( y + this.MainNode.offsetHeight ) > iViewPaneHeight )
-				y -= y + this.MainNode.offsetHeight - iViewPaneHeight ;
+			if ( ( y + eMainNode.offsetHeight ) > iViewPaneHeight )
+				y -= y + eMainNode.offsetHeight - iViewPaneHeight ;
 		}
 
@@ -219,5 +220,5 @@
 
 		var iWidth	= iMainWidth ;
-		var iHeight	= this.MainNode.offsetHeight ;
+		var iHeight	= eMainNode.offsetHeight ;
 
 		this._IFrame.width	= iWidth ;
Index: /FCKeditor/trunk/editor/_source/fckscriptloader.js
===================================================================
--- /FCKeditor/trunk/editor/_source/fckscriptloader.js	(revision 779)
+++ /FCKeditor/trunk/editor/_source/fckscriptloader.js	(revision 780)
@@ -100,4 +100,5 @@
 FCKScriptLoader.AddScript( 'FCKElementPath'		, 'classes/'	, ['FCKListsLib'], FCK_GENERIC ) ;
 FCKScriptLoader.AddScript( 'FCKEnterKey'		, 'classes/'	, ['FCKDomRange','FCKDomTools','FCKTools','FCKKeystrokeHandler','FCKListHandler'], FCK_GENERIC ) ;
+FCKScriptLoader.AddScript( 'FCKPanel'			, 'classes/'	, ['FCKBrowserInfo','FCKConfig','FCKTools'], FCK_GENERIC ) ;
 FCKScriptLoader.AddScript( 'FCKImagePreloader'	, 'classes/' ) ;
 FCKScriptLoader.AddScript( 'FCKKeystrokeHandler', 'classes/'	, ['FCKConstants','FCKBrowserInfo','FCKTools'], FCK_GENERIC ) ;
