   if !@find("#comments-search-input")?
     return
   if @data.text?
-    Session.set("comments_search_text",@data.text)
+    comments_search_text.set(@data.text)
   if @data.idid?
-    Session.set("flycircuit_search_text",@data.idid)
+    flycircuit_search_text.set(@data.idid)
   if @data.tags?
     atl = JSON.parse(@data.tags)
     taglist = {}
     for tag in atl
       taglist[tag] = true
-    Session.set("active_tags",taglist)
-  this.find("#comments-search-input").value = Session.get("comments_search_text")
-  this.find("#flycircuit-search-input").value = Session.get("flycircuit_search_text")
+    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: ->

      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=''

Template.Search.events
  "click .tag-name": (event, template) ->
    event.preventDefault()
    obj = active_tags.get()
    myname = this.name
    if myname of obj
      delete obj[myname]
    else
      # add item
      obj[myname] = true
    active_tags.set(obj)
    update_url_bar()

del = (obj, key) ->
