     this
 
   start: (name) =>
-    # Choose a random variant
     if previous = @getVariantCookie()
       # Use the same variant as before, don't record anything
       variant = (v for v in @variants when v.name is previous)[0]

    else
      @reset()

    # Request complete now, or on the next request
    if @options.delay
      @setDelayCompleteCookie(name)
    else
      @recordComplete(name)

    this

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

  # Private


  removePersistCompleteCookie: =>
    setCookie("abbaPersistComplete_#{@name}", '', 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]