       insertedDialog.addClass 'loading'
       $.ajax
         url: options.url
-        success: (data)=> this.displayDialog(insertedDialog, data, options)
+        success: (data)=> this.displayDialog(insertedDialog, data)
     
     else if options.html?
-      this.displayDialog(insertedDialog, options.html, options)
+      this.displayDialog(insertedDialog, options.html)
     
     else
       # anything else won't work

    insertedDialog = dialogTemplate.appendTo($('body'))
    insertedDialog.css('z-index', 2000 + dialogID)
    
    overlayClass = ''
    overlayClass = 'invisible' if dialogID > 1
    theOverlay = $("<div class='niftyOverlay #{overlayClass}'></div>").insertBefore(insertedDialog).css('z-index', 2000 + dialogID - 1)
    theOverlay.fadeIn('fast')
    
      # if we have a width, set the width for the dialog
    if options.width?
      insertedDialog.css('width', "#{options.width}px")
      insertedDialog.css('margin-left', "-#{options.width / 2}px")

      false
    
  # Complete the opening of a dialog with the given HTML
  displayDialog: (dialog, content)->
    dialog.html(content)
    dialog.fadeIn('fast')
    dialog.removeClass 'loading'
    options = dialog.data('options')
    if options.behavior? && behavior = this.behaviors[options.behavior]
      behavior.onLoad.call(null, dialog, options) if behavior.onLoad?
    options.afterLoad.call(null, dialog) if options.afterLoad?
