 
   touchCallback: (state, touchEvent) =>
     switch state
+      when utensils.MouseAndTouchTracker.state_start
+        @send('focusin')
       when utensils.MouseAndTouchTracker.state_start, utensils.MouseAndTouchTracker.state_move
         @updateInterface(@touchTracker.touchcurrent.x)
+        @send('change')
+      when utensils.MouseAndTouchTracker.state_end
+        @send('focusout')
     utensils.CursorHand.setCursorFromTouchTrackerState(@touchTracker, @cursor, state)
 
 

  options: ->
    @data.handle ?= @el.find('.slider-handle')
    @data.progress ?= @el.find('.slider-progress')
    @data.min ?= parseFloat(@data.min, 10) || 0
    @data.max ?= parseFloat(@data.max, 10) || 1
    @data.value ?= parseFloat(@data.value, 10) || 0.5


  initialize: ->
    @cursor = new utensils.CursorHand()
    @touchTracker = new utensils.MouseAndTouchTracker(@el[0], @touchCallback, false, "img div")
    @handleWidth = @data.handle.outerWidth() * 0.5

    @value = @data.min + percent * (@data.max - @data.min)
    @data.callback?.call(@, @value)


  send: (event_type) ->
    @dispatcher.trigger("#{@namespace}:#{event_type}", {value: Math.round(@value)})


utensils.Bindable.register 'slider', utensils.Slider
