     node = node.parentNode
   false
 
-Batman.setImmediate = Batman.clearImmediate = null
 _implementImmediates = (container) ->
   canUsePostMessage = ->
     return false unless container.postMessage

  count = 0
  getHandle = -> "go#{++count}"

  if container.setImmediate
    Batman.setImmediate = container.setImmediate
    Batman.clearImmediate = container.clearImmediate
  else if container.msSetImmediate
    Batman.setImmediate = msSetImmediate
    Batman.clearImmediate = msClearImmediate
  else if canUsePostMessage()

    Batman.setImmediate = (f) -> setTimeout(f, 0)
    Batman.clearImmediate = (handle) -> clearTimeout(handle)

Batman.setImmediate = ->
  _implementImmediates(Batman.container)
  Batman.setImmediate.apply(@, arguments)
