title: Extend jQuery UI Dialog open function
body: <p>Is it possible to extend the "open" callback function for the jQuery UI dialog? For example, I am extending my modalDialog box with another called confirmDialog.  When opening the modalDialog dialog, I am running a couple of functions that I want to carry over to the confirmDialog but also add another function with it.  Here is the code:</p>
  
  <pre><code>// Default settings for the modal dialog
  moDefaults : {
      autoOpen: 'false',
      modal: true,
      draggable: false,
      resizable: false,
      buttons: {},
      title: 'Title',
      width: 'auto',
      open: function(getDataOnOpen){
          // Add open class
          jQuery(this).addClass('open_dialog');
  
          // Add classes to action button
          var buttonPane = jQuery(this).next();
          jQuery(buttonPane).find('button:first').addClass('accept').addClass('action');
  
          // Hide the default dialog close button
          jQuery('.ui-dialog-titlebar-close').hide();
  
          // IE hack
          jQuery(this).css('overflow','hidden');
  
          // Ajax call to make on open
          getDataOnOpen;
      },
      close: function(){
          // Remove open class
          jQuery('.ui-dialog').removeClass('open_dialog');
      }
  },
  
  modalDialog : function(options, dialogId){
  
      if(options){
          jQuery.extend(true, mw.moDefaults, options);
      }
  
      jQuery(dialogId).dialog(mw.moDefaults);
  },
  
  confirmDialog : function(options){
  
      var defaults = {
          dialogClass:'confirm_dialog',
          minWidth: 255,
          modal: true
      };
  
      var settings = $.extend(mw.moDefaults, defaults, options);
  
      $.extend(mw.modalDialog(settings,'#conf_dialog'));
  }
  </code></pre>
  
  <p>Thanks in advance SO!!</p>