 
   # Complete Cookie
 
-  setDelayCompleteCookie: (value) =>
-    setCookie('abbaDelayComplete', "#{@name}##{value}")
-
   setPersistCompleteCookie: =>
     setCookie("abbaPersistComplete_#{@name}", '1', expires: 600)
 

  removePersistCompleteCookie: =>
    setCookie("abbaPersistComplete_#{@name}", '', expires: true)

  @delayComplete: =>
    if result = getCookie('abbaDelayComplete')
      [name, value] = result.split('#')
      new this(name).requestComplete(value)
      setCookie('abbaDelayComplete', '', expires: true)

do ->
  # Find Abba's endpoint from the script tag
  scripts = document.getElementsByTagName('script')
  scripts = (script.src for script in scripts when /\/abba\.js$/.test(script.src))
  Abba.endpoint = "//#{host(scripts[0])}" if scripts[0]

bind(window, 'load', Abba.delayComplete)
    else
      @reset()

    @recordComplete(name)
    this

  reset: =>
    @removeVariantCookie()
    @removePersistCompleteCookie()
    @result = null
    this

  # Private

