Index: parent.js
===================================================================
--- parent.js	(revision 1298)
+++ parent.js	(working copy)
@@ -22,17 +22,15 @@
   if (self.isOpen || $('#modalframe-container').size()) {
     return false;
   }
-
-  // Build modal frame options structure.
-  self.options = {
-    url: options.url,
-    width: options.width,
-    height: options.height,
-    autoFit: (options.autoFit == undefined || options.autoFit ? true : false),
-    autoResize: (options.autoResize ? true : false),
-    draggable: (options.draggable == undefined || options.draggable ? true : false),
-    onSubmit: options.onSubmit
+  // apply user settings
+  self.options = options;
+  var defaults = {
+  		draggable: true,
+		autoFit:true,
+		buttons: {}
   };
+  // apply defaults
+  $.extend(true, self.options, defaults);   
 
   // Create the dialog and related DOM elements.
   self.create(options);
@@ -54,7 +52,9 @@
   // iframe element is defined.
   self.iframe.$element = $('<iframe id="modalframe-element" name="modalframe-element"'+ ($.browser.msie ? ' scrolling="yes"' : '') +'/>');
   self.iframe.$container = $('<div id="modalframe-container"/>').append(self.iframe.$element);
-  $('body').append(self.iframe.$container);
+
+  // add the loading class., to show the loading animation
+  $('body').append(self.iframe.$container.addClass('ui-dialog-loading'));  
 
   // Open callback for the jQuery UI dialog.
   var dialogOpen = function() {
@@ -66,6 +66,8 @@
     // We'll try to provide our own behavior from bindChild() method.
     $('.modalframe').unbind('keypress.ui-dialog');
 
+	self.iframe.$container.dialog('option', 'buttons', self.options.buttons);
+
     // Adjust close button features.
     $('.modalframe .ui-dialog-titlebar-close:not(.modalframe-processed)').addClass('modalframe-processed')
       .attr('href', 'javascript:void(0)')
@@ -118,6 +120,8 @@
         }
       });
     }
+	//if(self.options.buttons)
+
 
     self.isOpen = true;
   };
@@ -274,7 +278,8 @@
   if (isClosing) {
     return;
   }
-
+  // as the child called as, he is done loadin. Let remove the loading-animation background
+  $('#modalframe-container').removeClass("ui-dialog-loading");
   // Update the dirty forms warning on the child window.
   if (self.isObject(self.iframe.Drupal.dirtyForms)) {
     self.iframe.Drupal.dirtyForms.warning = self.dirtyFormsWarning;
@@ -492,14 +497,16 @@
   var self = this;
 
   // Compute frame and dialog size based on requested document size.
+  var buttonPaneSize = $('.modalframe .ui-dialog-buttonpane').outerHeight(true);
   var maxSize = self.sanitizeSize({}), titleBarHeight = $('.modalframe .ui-dialog-titlebar').outerHeight(true);
-  var frameSize = self.sanitizeSize(size), dialogSize = $.extend({}, frameSize);
+  var frameSize = self.sanitizeSize(size), dialogSize = $.extend({}, frameSize);  
+  	
   if ((dialogSize.height + titleBarHeight) <= maxSize.height) {
-    dialogSize.height += titleBarHeight;
+    dialogSize.height += titleBarHeight + buttonPaneSize;
   }
   else {
     dialogSize.height = maxSize.height;
-    frameSize.height = dialogSize.height - titleBarHeight;
+    frameSize.height = dialogSize.height - titleBarHeight -buttonPaneSize;
   }
 
   // Compute dialog position centered on viewport.
@@ -514,8 +521,10 @@
       // Resize the iframe element and container.
       $('.modalframe').width(dialogSize.width).height(dialogSize.height);
       self.iframe.$container.width(frameSize.width).height(frameSize.height);
+	  // fixing that height and min height is different
+	  self.iframe.$container.css('min-height',frameSize.height);
       self.iframe.$element.width(frameSize.width).height(frameSize.height);
-
+	
       // Update the dialog size so that UI internals are aware of the change.
       self.iframe.$container.dialog('option', {width: dialogSize.width, height: dialogSize.height});
     }
