       $.ajax
         url: options.url
         success: (data)=> this.setContent(data, id)
-  
+
   # Create a new overlay
   createOverlay: (options)->
     overlay = $("<div class='niftyOverlay invisible'></div>")

      insertedDialog.addClass 'loading'
      if options.behavior? && behavior = this.behaviors[options.behavior]
        behavior.beforeLoad.call(null, insertedDialog, options) if behavior.beforeLoad?
      
      $.ajax
        url: options.url
        success: (data)=> this.displayDialog(insertedDialog, data)
    
    else if options.html?
      this.displayDialog(insertedDialog, options.html)
    
    else
      # anything else won't work
      console.log "Dialog could not be displayed. Invalid options passed."

    else
      console.log "Must pass a 'name' option to the addBehavior method."
      false

  # Complete the opening of a dialog with the given HTML
  displayDialog: (dialog, content)->
    dialog.html(content)
