@App = Ember.Application.create
  LOG_TRANSITIONS: true
  LOG_VIEW_LOOKUPS: true
  rootElement: '#ember-app-container'
  store: -> @__container__.lookup('service:store')
@App.modals = Ember.Namespace.create()
@Modals = @App.modals

Ember.$.ajaxPrefilter (options) ->
  locale = $locale
  app_version = 0
  params =
    locale: $locale
    app_version: 0
  if options.type.toUpperCase() == 'GET'
    if options.data
      options.data += "&#{$.param(params)}"
    else
      options.data = $.param(params)
  if options.type.toUpperCase() == 'POST'
    if options.data
      if typeof(options.data) == 'string'
        if options.data[0] == '{' || options.data[0] == '[' # json
          object = JSON.parse(options.data)
          $.extend object, params
          options.data = JSON.stringify(object)
        else
          options.data += "&#{$.param(params)}"
      else
        options.data = params
    else
      options.data = $.param(params)
  true
