Index: /CKEditor/trunk/_source/skins/kama/skin.js
===================================================================
--- /CKEditor/trunk/_source/skins/kama/skin.js	(revision 4867)
+++ /CKEditor/trunk/_source/skins/kama/skin.js	(revision 4868)
@@ -204,48 +204,53 @@
 })() );
 
-CKEDITOR.on( 'dialogPluginReady', function()
+(function()
 {
-	CKEDITOR.dialog.on( 'resize', function( evt )
-		{
-			var data = evt.data,
-				width = data.width,
-				height = data.height,
-				dialog = data.dialog,
-				contents = dialog.parts.contents;
-
-			if ( data.skin != 'kama' )
-				return;
-
-			contents.setStyles(
-				{
-					width : width + 'px',
-					height : height + 'px'
-				});
-
-			// Fix the size of the elements which have flexible lengths.
-			setTimeout( function()
-				{
-					var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ),
-						body = innerDialog.getChild( 0 );
-
-					// tc
-					var el = innerDialog.getChild( 2 );
-					el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );
-
-					// bc
-					el = innerDialog.getChild( 7 );
-					el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );
-
-					// ml
-					el = innerDialog.getChild( 4 );
-					el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
-
-					// mr
-					el = innerDialog.getChild( 5 );
-					el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
-				},
-				100 );
-		} );
-} );
+	CKEDITOR.dialog ? dialogSetup() : CKEDITOR.on( 'dialogPluginReady', dialogSetup );
+
+	function dialogSetup()
+	{
+		CKEDITOR.dialog.on( 'resize', function( evt )
+			{
+				var data = evt.data,
+					width = data.width,
+					height = data.height,
+					dialog = data.dialog,
+					contents = dialog.parts.contents;
+
+				if ( data.skin != 'kama' )
+					return;
+
+				contents.setStyles(
+					{
+						width : width + 'px',
+						height : height + 'px'
+					});
+
+				// Fix the size of the elements which have flexible lengths.
+				setTimeout( function()
+					{
+						var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ),
+							body = innerDialog.getChild( 0 );
+
+						// tc
+						var el = innerDialog.getChild( 2 );
+						el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );
+
+						// bc
+						el = innerDialog.getChild( 7 );
+						el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );
+
+						// ml
+						el = innerDialog.getChild( 4 );
+						el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
+
+						// mr
+						el = innerDialog.getChild( 5 );
+						el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
+					},
+					100 );
+			});
+	}
+})();
 
 /**
Index: /CKEditor/trunk/_source/skins/office2003/skin.js
===================================================================
--- /CKEditor/trunk/_source/skins/office2003/skin.js	(revision 4867)
+++ /CKEditor/trunk/_source/skins/office2003/skin.js	(revision 4868)
@@ -24,53 +24,58 @@
 })() );
 
-CKEDITOR.on( 'dialogPluginReady', function()
+(function()
 {
-	CKEDITOR.dialog.on( 'resize', function( evt )
-		{
-			var data = evt.data,
-				width = data.width,
-				height = data.height,
-				dialog = data.dialog,
-				contents = dialog.parts.contents;
+	CKEDITOR.dialog ? dialogSetup() : CKEDITOR.on( 'dialogPluginReady', dialogSetup );
 
-			if ( data.skin != 'office2003' )
-				return;
+	function dialogSetup()
+	{
+		CKEDITOR.dialog.on( 'resize', function( evt )
+			{
+				var data = evt.data,
+					width = data.width,
+					height = data.height,
+					dialog = data.dialog,
+					contents = dialog.parts.contents;
 
-			contents.setStyles(
-				{
-					width : width + 'px',
-					height : height + 'px'
-				});
+				if ( data.skin != 'office2003' )
+					return;
 
-			if ( !CKEDITOR.env.ie )
-				return;
+				contents.setStyles(
+					{
+						width : width + 'px',
+						height : height + 'px'
+					});
 
-			// Fix the size of the elements which have flexible lengths.
-			var fixSize = function()
-				{
-					var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ),
-						body = innerDialog.getChild( 0 );
+				if ( !CKEDITOR.env.ie )
+					return;
 
-					// tc
-					var el = innerDialog.getChild( 2 );
-					el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );
+				// Fix the size of the elements which have flexible lengths.
+				var fixSize = function()
+					{
+						var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ),
+							body = innerDialog.getChild( 0 );
 
-					// bc
-					el = innerDialog.getChild( 7 );
-					el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );
+						// tc
+						var el = innerDialog.getChild( 2 );
+						el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );
 
-					// ml
-					el = innerDialog.getChild( 4 );
-					el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
+						// bc
+						el = innerDialog.getChild( 7 );
+						el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );
 
-					// mr
-					el = innerDialog.getChild( 5 );
-					el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
-				};
-			setTimeout( fixSize, 100 );
+						// ml
+						el = innerDialog.getChild( 4 );
+						el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
 
-			// Ensure size is correct for RTL mode. (#4003)
-			if ( evt.editor.lang.dir == 'rtl' )
-				setTimeout( fixSize, 1000 );
-		} );
-} );
+						// mr
+						el = innerDialog.getChild( 5 );
+						el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
+					};
+				setTimeout( fixSize, 100 );
+
+				// Ensure size is correct for RTL mode. (#4003)
+				if ( evt.editor.lang.dir == 'rtl' )
+					setTimeout( fixSize, 1000 );
+			});
+	}
+})();
Index: /CKEditor/trunk/_source/skins/v2/skin.js
===================================================================
--- /CKEditor/trunk/_source/skins/v2/skin.js	(revision 4867)
+++ /CKEditor/trunk/_source/skins/v2/skin.js	(revision 4868)
@@ -24,49 +24,54 @@
 })() );
 
-CKEDITOR.on( 'dialogPluginReady', function()
+(function()
 {
-	CKEDITOR.dialog.on( 'resize', function( evt )
-		{
-			var data = evt.data,
-				width = data.width,
-				height = data.height,
-				dialog = data.dialog,
-				contents = dialog.parts.contents;
+	CKEDITOR.dialog ? dialogSetup() : CKEDITOR.on( 'dialogPluginReady', dialogSetup );
 
-			if ( data.skin != 'v2' )
-				return;
+	function dialogSetup()
+	{
+		CKEDITOR.dialog.on( 'resize', function( evt )
+			{
+				var data = evt.data,
+					width = data.width,
+					height = data.height,
+					dialog = data.dialog,
+					contents = dialog.parts.contents;
 
-			contents.setStyles(
-				{
-					width : width + 'px',
-					height : height + 'px'
-				});
+				if ( data.skin != 'v2' )
+					return;
 
-			if ( !CKEDITOR.env.ie )
-				return;
+				contents.setStyles(
+					{
+						width : width + 'px',
+						height : height + 'px'
+					});
 
-			// Fix the size of the elements which have flexible lengths.
-			setTimeout( function()
-				{
-					var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ),
-						body = innerDialog.getChild( 0 );
+				if ( !CKEDITOR.env.ie )
+					return;
 
-					// tc
-					var el = innerDialog.getChild( 2 );
-					el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );
+				// Fix the size of the elements which have flexible lengths.
+				setTimeout( function()
+					{
+						var innerDialog = dialog.parts.dialog.getChild( [ 0, 0, 0 ] ),
+							body = innerDialog.getChild( 0 );
 
-					// bc
-					el = innerDialog.getChild( 7 );
-					el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );
+						// tc
+						var el = innerDialog.getChild( 2 );
+						el.setStyle( 'width', ( body.$.offsetWidth ) + 'px' );
 
-					// ml
-					el = innerDialog.getChild( 4 );
-					el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
+						// bc
+						el = innerDialog.getChild( 7 );
+						el.setStyle( 'width', ( body.$.offsetWidth - 28 ) + 'px' );
 
-					// mr
-					el = innerDialog.getChild( 5 );
-					el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
-				},
-				100 );
-		} );
-} );
+						// ml
+						el = innerDialog.getChild( 4 );
+						el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
+
+						// mr
+						el = innerDialog.getChild( 5 );
+						el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
+					},
+					100 );
+			});
+	}
+})();
