   candidate: ''    #a value we will try to apply asa it becomes valid, if ever
   options: []      #list of valid options
   
+  _timeout: null   #auto-update timer
+  
   wish: (value) ->
     if value in @get 'options'
       @set 'value', value

  else
    ListController.extend {
      databaseurl: baseurl
      load: ( ->
        @_super()
        $.getJSON @get('databaseurl')+"/"+name+"s", (data) =>
          @set 'options', data
      )
    }
  controller.create(init)

Weathermaps.groups = createListController "group"
Weathermaps.maps = createListController "map", "group", {
  load: (->
    @_super (data) =>
       @set 'options', data
  ).observes 'parentValue'
}
Weathermaps.dates = createListController "date", "map", {
  default: 'first'
  load: (->
    @_super (data) =>
      data.sort()
      data.reverse()
      @set 'options', data
  ).observes 'parentValue'
}
Weathermaps.times = createListController "time", "date", {
  default: 'first'

  selected: (->
    @get('cache')[@get 'value']
  ).property 'value'
  load: ((parentChanged)->  
    @_super parentChanged, (data) =>
      k = keys data
      k.sort()
      k.reverse()
      if not k.compareArrays(@get 'options')
        @set 'options', k
        @set 'cache', data
      @_timeout = setTimeout (=> @load(false)), 60*1000#1 min
  )
  _load: (-> @load true).observes 'parentValue'
}

Weathermaps.current = Ember.Object.create {
