diff --git a/dialog.js b/dialog.js
index f1db996..0d41799 100644
--- a/dialog.js
+++ b/dialog.js
@@ -17,12 +17,7 @@
    */
   Drupal.Dialog.show = function() {
     if (!Drupal.Dialog.dialog) {
-      var o = {
-        modal: true,
-        height: Drupal.settings.Dialog.height,
-        width: Drupal.settings.Dialog.width,
-        position: 'center'
-      };
+      var o = $.extend({modal: true}, Drupal.settings.Dialog.defaults);
       Drupal.Dialog.dialog = $(Drupal.theme('DialogMain')).dialog(o);
 
       // Completely remove the dialog every time it is closed.  This is the
@@ -226,31 +221,30 @@
    * AJAX responder command to place HTML within the modal.
    */
   Drupal.CTools.AJAX.commands.dialog_display = function(command) {
-    var $el = Drupal.Dialog.dialog;
+    var $el = Drupal.Dialog.dialog,
+      o = {},
+      overrides = {};
 
     // Ensure that the dialog wasn't closed before the request completed.
     if ($el) {
-      $el.html(command.output)
-        // remove any previously added buttons
-        .dialog('option', 'buttons', {})
-        .dialog('option', 'title', command.title)
-        .dialog('show');
-
-      var defaultOptions = {
-        height: Drupal.settings.Dialog.height,
-        width: Drupal.settings.Dialog.width,
-        position: 'center',
-        maxHeight: Math.floor($(window).height() * .8)
+      $el.html(command.output).dialog('show');
+
+      // Merge all of the options together: defaults, overrides, and options
+      // specified by the command, then apply them.
+      overrides = {
+        // Remove any previously added buttons.
+        'buttons': {},
+        'title': command.title,
+        'maxHeight': Math.floor($(window).height() * .8)
       };
-      var o = $.extend(defaultOptions, command.options);
-      for (i in o) {
-        $el.dialog('option', i, o[i]);
-      }
+      o = $.extend({}, Drupal.settings.Dialog.defaults, overrides, command.options);
+      $.each(o, function (i, v) { $el.dialog('option', i, v); });
+
       if ($el.height() > o.maxHeight) {
         $el.dialog('option', 'height', o.maxHeight);
         $el.dialog('option', 'position', o.position);
-        // This is really ugly, but dialog gives us no way to call
-        // _size() in a sane way!
+        // This is really ugly, but dialog gives us no way to call _size() in a
+        // sane way!
         $el.data('dialog')._size();
       }
 
diff --git a/dialog.module b/dialog.module
index e497af4..dbf37b7 100644
--- a/dialog.module
+++ b/dialog.module
@@ -50,8 +50,11 @@ function dialog_add_js() {
   $settings = array(
     'Dialog' => array(
       'throbber' => theme('image', ctools_image_path('throbber.gif'), t('Loading...'), t('Loading')),
-      'height' => variable_get('dialog_default_height', 'auto'),
-      'width' => variable_get('dialog_default_width', '600px'),
+      'defaults' => array(
+        'height' => variable_get('dialog_default_height', 'auto'),
+        'width' => variable_get('dialog_default_width', '600px'),
+        'position' => 'center',
+      ),
     )
   );
 
