 
   ###*
    * You can't use CSS transitions through display states :(
-   * @return {jQuery Object} $catbusTail
   ###
   toggleTail = ->
     $catbusTail.toggleClass 'hide', !catbusOpen

   * Catbus init!
  ###
  init = ->
    transitionEnd = 'webkitTransitionEnd otransitionend msTransitionEnd transitionend'

    $clickables.on 'click', toggleCatbus
    $catbusTail.on transitionEnd, toggleTail

    if catbusPinned() then openCatbus() else closeCatbus()
    return

  do init

  return {
    openCatbus, closeCatbus
    catbusStatus: -> catbusOpen
  }

#

# This silly line is the require line and the jQuery function start
define 'doc', ->
  return document

define ['jquery', 'doc'], ($, doc) ->

  # jQuery Object References
  $body            =
  $catbus          =
  $catbusTail      =
  $clickables      = {}

  # Local storage constants
  LS_CATBUS_STATUS = 'catbus-status'
  LS_STORED_PINNED = 'pinned'
  LS_STORED_CLOSED = 'closed'

  # Other stuff.
  catbusOpen       = false

  ###*
   * Tells us if local storage says the catbus is pinned open or not.
