Index: /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js	(revision 1207)
+++ /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js	(revision 1208)
@@ -164,12 +164,15 @@
 	{
 		var element = evt.srcElement || evt.target ;
-		var view = element.ownerDocument.parentWindow || evt.view ;
+		var doc = FCKTools.GetElementDocument( element ) ;
+		var view = doc.parentWindow || evt.view ;
 		var retval = { 'x': evt.clientX, 'y': evt.clientY };
+
 		if ( view != _ownerWindow )
 		{
-			var offset = FCKTools.GetDocumentPosition( _ownerWindow, element.ownerDocument.documentElement ) ;
+			var offset = FCKTools.GetDocumentPosition( _ownerWindow, doc.documentElement ) ;
 			retval.x += offset.x ;
 			retval.y += offset.y ;
 		}
+
 		return retval ;
 	}
@@ -180,5 +183,5 @@
 		if ( !evt )
 		{
-			view = this.ownerDocument.parentWindow ;
+			view = FCKTools.GetElementDocument( this ).parentWindow ;
 			evt = view.event ;
 		}
@@ -200,5 +203,5 @@
 			return ;
 		if ( !evt )
-			evt = this.ownerDocument.parentWindow.event ;
+			evt = FCKTools.GetElementDocument( this ).parentWindow.event ;
 
 		var currentCoords = FCKDialog._GetMouseCoordinates( evt );
@@ -226,5 +229,5 @@
 			return ;
 		if ( !evt )
-			evt = this.ownerDocument.parentWindow.event ;
+			evt = FCKTools.GetElementDocument( this ).parentWindow.event ;
 		_dragDialog = null ;
 		_lastCoords = null ;
Index: /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdomtools.js
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdomtools.js	(revision 1207)
+++ /FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdomtools.js	(revision 1208)
@@ -957,5 +957,5 @@
 	{
 		var currentElement = element ;
-		while ( currentElement != currentElement.ownerDocument.documentElement )
+		while ( currentElement != FCKTools.GetElementDocument( currentElement ).documentElement )
 		{
 			if ( this.GetCurrentElementStyle( w, currentElement, 'position' ) != 'static' )
Index: /FCKeditor/branches/features/floating_dialog/editor/fckdialog.html
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/fckdialog.html	(revision 1207)
+++ /FCKeditor/branches/features/floating_dialog/editor/fckdialog.html	(revision 1208)
@@ -64,14 +64,23 @@
 var args = window.dialogArguments ;
 
+var FCKBrowserInfo	= args.Editor.FCKBrowserInfo ;
+var FCKConfig		= args.Editor.FCKConfig ;
+
 // Sets the Skin CSS
-document.write( '<link href="' + args.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
-document.write( '<link href="' + args.Editor.FCKConfig.SkinPath + 'fck_dialog_floating.css" type="text/css" rel="stylesheet">' ) ;
+document.write( '<link href="' + FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
+document.write( '<link href="' + FCKConfig.SkinPath + 'fck_dialog_floating.css" type="text/css" rel="stylesheet">' ) ;
 
 // Sets the language direction.
 window.document.dir = args.Editor.FCKLang.Dir ;
 
-// IE does not set the window name in showModalDialog(), let's set it here.
-if ( args.Editor.FCKBrowserInfo.IsIE )
+if ( FCKBrowserInfo.IsIE )
+{
+	// IE does not set the window name in showModalDialog(), let's set it here.
 	window.name = args.DialogName ;
+
+	// For IE6-, the fck_dialog_ie6.js is loaded, used to fix limitations in the browser.
+	if ( !FCKBrowserInfo.IsIE7 )
+		document.write( '<' + 'script type="text/javascript" src="' + FCKConfig.SkinPath + 'fck_dialog_ie6.js"><' + '\/script>' ) ;
+}
 
 var sTitle = args.Title ;
Index: Keditor/branches/features/floating_dialog/editor/skins/default/dialog_ie6.htc
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/skins/default/dialog_ie6.htc	(revision 1207)
+++ 	(revision )
@@ -1,80 +1,0 @@
-<script type="text/javascript">
-
-/**
- * On IE6-, some absolute positioning properties, like "right" and "bottom"
- * will have no/unexpected effects. We need to manually fix it when resizing
- * the window.
- *
- * We have choosen to use the IE Behavior feature to include this script in the
- * page, to avoid having to include a script in the dialog HTML page that could
- * not be needed by other skins, even if probably this HTC will always be
- * needed.
- *
- * The following fixes could be done with the "expression()" property in the
- * CSS, but it brings severe performance issues, which could even break the
- * browser.
- */
-
-;(function()
-{
-	var fixSizes = function()
-	{
-		var fckDlg = window.document.body ;
-		
-		for ( var i = 0 ; i < fckDlg.childNodes.length ; i++ )
-		{
-			var child = fckDlg.childNodes[i] ;
-			switch ( child.className )
-			{
-				case 'contents' :
-					child.style.width = Math.max( 0, fckDlg.offsetWidth - 16 - 16 ) ;	// -left -right
-					child.style.height = Math.max( 0, fckDlg.clientHeight - 20 - 2 ) ;	// -bottom -top
-					break ;
-
-				case 'blocker' :
-				case 'cover' :
-					child.style.width = Math.max( 0, fckDlg.offsetWidth - 16 - 16 + 4 ) ;	// -left -right + 4
-					child.style.height = Math.max( 0, fckDlg.clientHeight - 20 - 2 + 4 ) ;	// -bottom -top + 4
-					break ;
-				
-				case 'tr' :
-					child.style.left = Math.max( 0, fckDlg.clientWidth - 16 ) ;
-					break ;
-
-				case 'tc' :
-					child.style.width = Math.max( 0, fckDlg.clientWidth - 16 - 16 ) ;
-					break ;
-				
-				case 'ml' :
-					child.style.height = Math.max( 0, fckDlg.clientHeight - 16 - 51 ) ;
-					break ;
-				
-				case 'mr' :
-					child.style.left = Math.max( 0, fckDlg.clientWidth - 16 ) ;
-					child.style.height = Math.max( 0, fckDlg.clientHeight - 16 - 51 ) ;
-					break ;
-				
-				case 'bl' :
-					child.style.top = Math.max( 0, fckDlg.clientHeight - 51 ) ;
-					break ;
-				
-				case 'br' :
-					child.style.left = Math.max( 0, fckDlg.clientWidth - 30 ) ;
-					child.style.top = Math.max( 0, fckDlg.clientHeight - 51 ) ;
-					break ;
-				
-				case 'bc' :
-					child.style.width = Math.max( 0, fckDlg.clientWidth - 30 - 30 ) ;
-					child.style.top = Math.max( 0, fckDlg.clientHeight - 51 ) ;
-					break ;
-			}
-		}
-	}
-	
-	fixSizes() ;
-	
-	window.attachEvent( 'onresize', fixSizes ) ;
-
-})() ;
-
-</script>
Index: /FCKeditor/branches/features/floating_dialog/editor/skins/default/fck_dialog_floating.css
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/skins/default/fck_dialog_floating.css	(revision 1207)
+++ /FCKeditor/branches/features/floating_dialog/editor/skins/default/fck_dialog_floating.css	(revision 1208)
@@ -7,9 +7,4 @@
 	margin: 0px;
 	padding: 0px;
-}
-
-* html body
-{
-	behavior: url(dialog_ie6.htc);
 }
 
Index: /FCKeditor/branches/features/floating_dialog/editor/skins/default/fck_dialog_ie6.js
===================================================================
--- /FCKeditor/branches/features/floating_dialog/editor/skins/default/fck_dialog_ie6.js	(revision 1208)
+++ /FCKeditor/branches/features/floating_dialog/editor/skins/default/fck_dialog_ie6.js	(revision 1208)
@@ -0,0 +1,91 @@
+﻿/*
+ * FCKeditor - The text editor for Internet - http://www.fckeditor.net
+ * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ *
+ * == BEGIN LICENSE ==
+ *
+ * Licensed under the terms of any of the following licenses at your
+ * choice:
+ *
+ *  - GNU General Public License Version 2 or later (the "GPL")
+ *    http://www.gnu.org/licenses/gpl.html
+ *
+ *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
+ *    http://www.gnu.org/licenses/lgpl.html
+ *
+ *  - Mozilla Public License Version 1.1 or later (the "MPL")
+ *    http://www.mozilla.org/MPL/MPL-1.1.html
+ *
+ * == END LICENSE ==
+ */
+
+(function()
+{
+	// IE6 doens't handle absolute positioning properly (it is always in quirks
+	// mode). This function fixes the sizes and positions of many elements that
+	// compose the skin (this is skin specific).
+	var fixSizes = function()
+	{
+		var fckDlg = window.document.body ;
+		
+		for ( var i = 0 ; i < fckDlg.childNodes.length ; i++ )
+		{
+			var child = fckDlg.childNodes[i] ;
+			switch ( child.className )
+			{
+				case 'contents' :
+					child.style.width = Math.max( 0, fckDlg.offsetWidth - 16 - 16 ) ;	// -left -right
+					child.style.height = Math.max( 0, fckDlg.clientHeight - 20 - 2 ) ;	// -bottom -top
+					break ;
+
+				case 'blocker' :
+				case 'cover' :
+					child.style.width = Math.max( 0, fckDlg.offsetWidth - 16 - 16 + 4 ) ;	// -left -right + 4
+					child.style.height = Math.max( 0, fckDlg.clientHeight - 20 - 2 + 4 ) ;	// -bottom -top + 4
+					break ;
+				
+				case 'tr' :
+					child.style.left = Math.max( 0, fckDlg.clientWidth - 16 ) ;
+					break ;
+
+				case 'tc' :
+					child.style.width = Math.max( 0, fckDlg.clientWidth - 16 - 16 ) ;
+					break ;
+				
+				case 'ml' :
+					child.style.height = Math.max( 0, fckDlg.clientHeight - 16 - 51 ) ;
+					break ;
+				
+				case 'mr' :
+					child.style.left = Math.max( 0, fckDlg.clientWidth - 16 ) ;
+					child.style.height = Math.max( 0, fckDlg.clientHeight - 16 - 51 ) ;
+					break ;
+				
+				case 'bl' :
+					child.style.top = Math.max( 0, fckDlg.clientHeight - 51 ) ;
+					break ;
+				
+				case 'br' :
+					child.style.left = Math.max( 0, fckDlg.clientWidth - 30 ) ;
+					child.style.top = Math.max( 0, fckDlg.clientHeight - 51 ) ;
+					break ;
+				
+				case 'bc' :
+					child.style.width = Math.max( 0, fckDlg.clientWidth - 30 - 30 ) ;
+					child.style.top = Math.max( 0, fckDlg.clientHeight - 51 ) ;
+					break ;
+			}
+		}
+	}
+	
+	var onLoad = function()
+	{
+		fixSizes() ;
+		
+		window.attachEvent( 'onresize', fixSizes ) ;
+		window.detachEvent( 'onload', onLoad ) ;
+	}
+	
+	window.attachEvent( 'onload', onLoad ) ;
+
+})() ;
