     switch event
       when 'init' then handler()
       when 'load', 'resize'
-        widgets.subscribe name, window, event, handler
+        agt.widgets.subscribe name, window, event, handler
       else
-        widgets.subscribe name, document, event, handler
+        agt.widgets.subscribe name, document, event, handler
 
 # The `widgets.define` is used to create a new widget usable through the
 # `widgets` method. Basically, a widget is defined using a `name`, and a

# of the given `name` from the page.
# It's the widget responsibility to clean up its dependencies during
# the `dispose` call.
widgets.release = (names...) ->
  names = Object.keys(__instances__) if names.length is 0
  for name in names
    __instances__[name].each (value) -> value.dispose()

# Activates all the widgets instances of type `name`.
widgets.activate = (names...) ->
  names = Object.keys(__instances__) if names.length is 0
  for name in names
    __instances__[name].each (value) -> value.activate()

# Deactivates all the widgets instances of type `name`.
widgets.deactivate = (names...) ->
  names = Object.keys(__instances__) if names.length is 0
  for name in names
    __instances__[name].each (value) -> value.deactivate()

#
# The `options` object will contains all the options passed to the `widgets`
# method except the `on`, `if`, `unless` and `media` ones.
agt.widgets.define = (name, block) -> __widgets__[name] = block

# A shorthand method to register a jQuery widget.
agt.widgets.$define = (name, baseOptions={}, block) ->
  [baseOptions, block] = [{}, baseOptions] if typeof baseOptions is 'function'
  throw new Error "#{name} jquery widget isn't defined" unless $.fn[name]
  __widgets__[name] = (element, options={}) ->
