/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80*/
/*global window, RSVP, rJS, document*/
(function (window, document, rJS, RSVP) {
  var gadget;
  rJS(window)

  .declareAcquiredMethod("updateHeader", "updateHeader")
  .declareAcquiredMethod("updatePanel", "updatePanel")
  .declareAcquiredMethod("getUrlFor", "getUrlFor")

  .onStateChange(function () {
  })

  .declareMethod("render", function (options) {
    var gadget = this;

    return gadget.updatePanel({view_action_dict: {}})
      .push(function () {
        return gadget.getUrlFor({command: 'display',
                                 options: {page: "mynij_search"}});
      })
      .push(function (previous_url) {
        return gadget.updateHeader({
          page_title: "Return to Search",
          selection_url: previous_url
        });
      });
  });

}(window, document, rJS, RSVP));