 
 Template.Search.events window.okCancelEvents("#comments-search-input",
   ok: (value,evt) ->
-    Session.set "comments_search_text", value
+    comments_search_text.set(value)
     update_url_bar()
     return
 
   cancel: (evt) ->
-    Session.set "comments_search_text", null
+    comments_search_text.set(null)
     update_url_bar()
     return
 )
 
 Template.Search.events window.okCancelEvents("#flycircuit-search-input",
   ok: (value,evt) ->
-    Session.set "flycircuit_search_text", value
+    flycircuit_search_text.set(value)
     update_url_bar()
     return
 
   cancel: (evt) ->
-    Session.set "flycircuit_search_text", null
+    flycircuit_search_text.set(null)
     update_url_bar()
     return
 )

      result[tag]=true for tag in doc.tags
    Object.keys(result)
    lods = [] # list of dicts
    active_tags = Session.get("active_tags")
    for tag_name in Object.keys(result)
      tmp = {name:tag_name}
      if tag_name of active_tags
        tmp.is_active_css_class='active'
      else
        tmp.is_active_css_class=''

  if !@find("#comments-search-input")?
    return
  if @data.text?
    comments_search_text.set(@data.text)
  if @data.idid?
    flycircuit_search_text.set(@data.idid)
  if @data.tags?
    atl = JSON.parse(@data.tags)
    taglist = {}
    for tag in atl
      taglist[tag] = true
    active_tags.set(taglist)
  this.find("#comments-search-input").value = comments_search_text.get()
  this.find("#flycircuit-search-input").value = flycircuit_search_text.get()

Template.Search.helpers
  current_search: ->
