 
   ttCounter = 0
 
+  #returns an object with a close method which when called
+  #removes all open tooltips
   Backbone.Factlink.TooltipJQ = (cfg) ->
     uid = ttCounter++
     uidStr = 'tooltipUid-' + uid


      check = -> remove() if !(inTarget || inTooltip)
      remove = ->
        console.log 'remove', uidStr, instId
        delete instances[instId]
        cfg.rmTooltip $el, $target, $tooltip
        $target.removeData(uidStr)

      setTargetHover = (state) ->
        inTarget = state
        check()

      instances[instId] =
        remove: remove
        setTargetHover: setTargetHover

      $target.data(uidStr, instId)


      selector: 'a'
      mkTooltip: ($el, $target) ->
        $('<span class="testTooltip">This is a <a href="#">Link!</a></span>')
          .append($('<b>kill</b>').on('click', (e) ->
            e.stopPropagation()
            $target.remove()))
          .insertAfter($target)
      rmTooltip: ($el, $target, $tooltip) ->
        $tooltip.remove()
