Index: /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2455)
+++ /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2456)
@@ -199,12 +199,9 @@
 			elements = contents.elements;
 
-		for ( var i = 0 ; i < elements.length ; i++ )
-		{
-			var item = elements[i],
-				builder = CKEDITOR.dialog._.uiElementBuilders[ item.type ];
-			if ( !builder )
-				continue;
-			builder.build( this, item, pageHtml );
-		}
+		CKEDITOR.dialog._.uiElementBuilders.vbox.build( this,
+				{
+					type : 'vbox',
+					children : contents.elements
+				}, pageHtml );
 		pageHtml.push( '</div>' );
 
@@ -306,5 +303,5 @@
 						elements : [
 							{
-								type : 'vbox',
+								type : 'hbox',
 								children : []
 							}
@@ -319,5 +316,5 @@
 						elements : [
 							{
-								type : 'vbox',
+								type : 'hbox',
 								children : []
 							}
@@ -332,5 +329,5 @@
 						elements : [
 							{
-								type : 'vbox',
+								type : 'hbox',
 								children : []
 							}
@@ -381,8 +378,9 @@
 
 		// Write the inline CSS styles.
-		html.push( 'style="' );
+		var styleStr = [];
 		for ( var i in styles )
-			html.push( i + ':' + styles[i] + ';' );
-		html.push( '" ' );
+			styleStr.push( i + ':' + styles[i] );
+		if ( styleStr.length > 0 )
+			html.push( 'style="', styleStr.join( '; ' ), '" ' );
 
 		// Write the attributes.
@@ -417,5 +415,5 @@
 				if ( innerDefinition.height && isFinite( parseFloat( innerDefinition.height ) ) )
 					html.push( 'height:' + innerDefinition.height + 'px;' );
-				html.push( '">' );
+				html.push( '" class="cke_dialog_ui_hbox_child">' );
 				children.push( CKEDITOR.dialog._.uiElementBuilders[type].build( dialog, child, html ) );
 				html.push( '</div>' );
@@ -440,11 +438,14 @@
 			{
 				var child = innerDefinition.children[i],
-					type = child.type;
-				html.push( '<div style="' );
+					type = child.type,
+					styles = [];
+				html.push( '<div ' );
 				if ( innerDefinition.width && isFinite( parseFloat( innerDefinition.width ) ) )
-					html.push( 'width:' + innerDefinition.width + 'px;' );
+					styles.push( 'width:' + innerDefinition.width + 'px' );
 				if ( innerDefinition.heights && isFinite( parseFloat( innerDefinition.heights[i] ) ) )
-					html.push( 'height:' + innerDefinition.heights[i] + 'px;' );
-				html.push( '">' );
+					styles.push( 'height:' + innerDefinition.heights[i] + 'px' );
+				if ( styles.length > 0 )
+					html.push( 'style="', styles.join( '; ' ), '" ' );
+				html.push( ' class="cke_dialog_ui_vbox_child">' );
 				children.push( CKEDITOR.dialog._.uiElementBuilders[type].build( dialog, child, html ) );
 				html.push( '</div>' );
@@ -541,20 +542,17 @@
 	});
 
-(function()
-{
-	CKEDITOR.dialog.addUIElement( 'hbox',
+CKEDITOR.dialog.addUIElement( 'hbox',
+		{
+			build : function( dialog, elementDefinition, output )
 			{
-				build : function( dialog, elementDefinition, output )
-				{
-					return new CKEDITOR.ui.dialog.hbox( dialog, elementDefinition, output );
-				}
-			});
-
-	CKEDITOR.dialog.addUIElement( 'vbox',
+				return new CKEDITOR.ui.dialog.hbox( dialog, elementDefinition, output );
+			}
+		});
+
+CKEDITOR.dialog.addUIElement( 'vbox',
+		{
+			build : function( dialog, elementDefinition, output )
 			{
-				build : function( dialog, elementDefinition, output )
-				{
-					return new CKEDITOR.ui.dialog.vbox( dialog, elementDefinition, output );
-				}
-			});
-})();
+				return new CKEDITOR.ui.dialog.vbox( dialog, elementDefinition, output );
+			}
+		});
