   else
     time
 
+compileAnimations = (animations) ->
+  {}.tap (css) ->
+    for own propertyName, styleName of jQuery.styleProperties
+      css[styleName] = (
+        for own name, animation of animations
+          value = animation[propertyName]
+          if propertyName == 'delay' or propertyName is 'duration'
+            makeCSSTime value, 0
+          else
+            value ? 'initial'
+      ).join ', '
+
+jQuery.event.props.push 'animationName'
+
 jQuery.fn.cssFadeOut = (speed, easing, callback) ->
   {fadeIn, fadeOut} = jQuery.cssAnimations
+  {animationEnd} = jQuery.eventNames
   
   hideCallback = (event) ->
-    if event.originalEvent.animationName is fadeOut
-      $(this).css(display: 'none').unbind(event.type, hideCallback)
+    if event.animationName is fadeOut
+      $(this)
+      .css(display: 'none')
+      .unbind(event.type, hideCallback)
   
   $(this)
   .cssStop(fadeIn)
   .cssAnimate(fadeOut, speed, easing, callback)
-  .bind(eventNames.animationEnd, hideCallback)
+  .bind(animationEnd, hideCallback)
 
 jQuery.fn.cssFadeIn = (speed, easing, callback) ->
   {fadeIn, fadeOut} = jQuery.cssAnimations

  .cssAnimate(fadeIn, speed, easing, callback)

jQuery.fn.cssStop = (animationName) ->
  # TODO actually do this once multiple concurrent animations are supported
  this

jQuery.fn.cssAnimate = (animationName, speed, easing, callback) ->
  optall = jQuery.speed speed, easing, callback
  optall.duration = makeCSSTime optall.duration
  optall.delay    = makeCSSTime optall.delay, 0
  
  animation = {}
  noAnimation = {}
  
  realCallback = (event) ->
    $(this).unbind event.type, realCallback
    if event.originalEvent.animationName is animationName
      switch event.type
        when eventNames.animationEnd
          $(this).css noAnimation
          optall.old.call this, event if typeof optall.old is 'function'
  
  animation[styleProperties.name] = animationName
  noAnimation[styleProperties.name] = ''
  
  for optionName, styleName of styleProperties when optall[optionName]?
    animation[styleName] = "#{optall[optionName]}"
    noAnimation[styleName] = ''
  
  $(this).bind(eventNames.animationEnd, realCallback).css(animation)

jQuery.styleProperties =
  name: 'webkitAnimationName'
  delay: 'webkitAnimationDelay'
  direction: 'webkitAnimationDirection'
