       @_name        = pluginName
 
       @$element     = $(@element)
-      @options      = $.extend {}, defaults, (option if typeof option is 'object')
-      @action       = option if typeof option is 'string'
+      @options      = $.extend {}, defaults, (option if typeof option is "object")
+      @action       = option if typeof option is "string"
       @uri          = window.location.host + window.location.pathname
-      @storageKey   = [ @options.namespace, @uri, @element.tagName, @element.id, @element.name ].join('.')
-      @storageIndexKey = [ @options.namespace, 'index', window.location.host ].join('.')
+      @storageKey   = [ @options.namespace, @uri, @element.tagName, @element.id, @element.name ].join(".")
+      @storageIndexKey = [ @options.namespace, "index", window.location.host ].join(".")
 
       @init()
 

      self = @
      saveTimer = setInterval (-> self.save()), self.options.saveInterval
      saveTimers.push(saveTimer)
      e = $.Event('phnx.started')
      @$element.trigger(e)

    stop: ->
      saveTimers.forEach (t) -> clearInterval(t)
      e = $.Event('phnx.stopped')
      @$element.trigger(e)

    init: ->
      localStorage[@storageIndexKey] = "[]" if localStorage[@storageIndexKey] == undefined
      switch @action
        when 'remove' then @remove()
        when 'start' then @start()
        when 'stop' then @stop()
        when 'load' then @load()
        when 'save' then @save()
        else
          @load()
          @start()

          @element.checked = JSON.parse savedValue
        else if @element.tagName is "SELECT"
          self = @
          @$element.find("option").prop("selected", false)
          $.each JSON.parse(savedValue), (i, value) ->
            self.$element.find("option[value='#{value}']").prop("selected", true)
        else
          @element.value = savedValue
        e = $.Event("phnx.loaded")
        @$element.trigger(e)

    save: ->
