 define (require) ->
+  router = require('cs!router')
   searchResults = require('cs!models/search-results')
   BaseView = require('cs!helpers/backbone/views/base')
   AdvancedSearchView = require('cs!./advanced/advanced')

      if location.search and location.search isnt '?q='
        @model = searchResults.load(location.search)

    regions:
      search: '.search'


        @regions.search.show(new SearchResultsView({model: @model}))
      else
        @regions.search.show(new AdvancedSearchView())

    displayError: () ->
      error = arguments[1] # @model.get('error')
      router.appView.render('error', {code: error}) if error
