 up.tooltip = (($) ->
   
   u = up.util
+
+  ###*
+  Sets default options for future tooltips.
+
+  @method up.tooltip.config
+  @property
+  @param {String} [config.position]
+    The default position of tooltips relative to the element.
+    Can be either `"top"` or `"bottom"`.
+  @param {String} [config.openAnimation='fade-in']
+    The animation used to open a tooltip.
+  @param {String} [config.closeAnimation='fade-out']
+    The animation used to close a tooltip.
+  ###
+  config = u.config
+    position: 'top'
+    openAnimation: 'fade-in'
+    closeAnimation: 'fade-out'
+
+  reset = ->
+    config.reset()
 
   setPosition = ($link, $tooltip, position) ->
     linkBox = u.measure($link)

  # Close the tooltip when the user presses ESC.
  up.magic.onEscape(-> close())

  attach: attach
  close: close
  open: -> u.error('up.tooltip.open no longer exists. Use up.tooltip.attach instead.')

  close = (options) ->
    $tooltip = $('.up-tooltip')
    if $tooltip.length
      options = u.options(options, animation: config.closeAnimation)
      options = u.merge(options, up.motion.animateOptions(options))
      up.destroy($tooltip, options)

