     $confirmation = $('<div style="display: none" id="alchemyConfirmation" />')
     $confirmation.appendTo "body"
     $confirmation.html "<p>" + options.message + "</p>"
-    Alchemy.ConfirmationWindow = $confirmation.dialog(
+    Alchemy.ConfirmationWindow = $confirmation.dialog
       resizable: false
       minHeight: 100
       minWidth: 300


    # Opens the trash window
    open: (page_id, title) ->
      $dialog = $('<div style="display: none" id="alchemyTrashWindow" />')
      $dialog.appendTo("body")
      $dialog.html Alchemy.getOverlaySpinner({width: 380, height: 450})
      Alchemy.TrashWindow.current = $dialog.dialog(
        modal: false
        width: 380
        minHeight: 450
        maxHeight: $(window).height() - 50
        title: title
        resizable: false
        show: "fade"
        hide: "fade"
        open: (event, ui) ->
          $.ajax
            url: Alchemy.routes.admin_trash_path(page_id)
            success: (data, textStatus, XMLHttpRequest) ->
              $dialog.html data
              # Need this for DragnDrop elements into elements window.
              # Badly this is screwing up maxHeight option
              $dialog.css(overflow: "visible").dialog("widget").css overflow: "visible"
              Alchemy.overlayObserver "#alchemyTrashWindow"
              return
            error: (XMLHttpRequest, textStatus, errorThrown) ->
              Alchemy.AjaxErrorHandler $dialog, XMLHttpRequest.status, textStatus, errorThrown
              return
          return
        close: ->
          $dialog.remove()
          return
      )
      return

    # Refreshes the trash window
    refresh: (page_id) ->
      if $("#alchemyTrashWindow").length > 0
        $("#alchemyTrashWindow").html Alchemy.getOverlaySpinner(
          width: 380
          height: 270
        )
        $.get Alchemy.routes.admin_trash_path(page_id), (html) ->
          $("#alchemyTrashWindow").html html
          return
      return

  # Adds onClick events for Alchemy overlays
  #

      options.height = $(window).height() - 50
    $dialog = $('<div style="display: none" id="alchemyOverlay" />')
    $dialog.appendTo "body"
    $dialog.html Alchemy.getOverlaySpinner
      width: (if options.width is "auto" then 400 else options.width)
      height: (if options.height is "auto" then 300 else options.height)
    Alchemy.CurrentWindow = $dialog.dialog
      modal: options.modal
      minWidth: (if options.width is "auto" then 400 else options.width)
      minHeight: (if options.height is "auto" then 300 else options.height)
