 
     adviseProperty core.HTMLOptionElement, 'selected', (elem, value) ->
         if elem._attachedToDocument
-            DOM.emit 'DOMPropertyModified',
+            browser.emit 'DOMPropertyModified',
                 target   : elem
                 property : 'selected'
                 value    : value
 
     adviseProperty core.CharacterData, '_nodeValue', (elem, value) ->
         if elem._parentNode?._attachedToDocument
-            DOM.emit 'DOMCharacterDataModified',
+            browser.emit 'DOMCharacterDataModified',
                 target : elem
 
-exports.wrapStyle = (core, DOM) ->
+exports.wrapStyle = (core, browser) ->
     # JSDOM level2/style.js uses the style getter to lazily create the 
     # CSSStyleDeclaration object for the element.  To be able to emit
     # the right instruction in the style object advice, we need to have

    # var insertedElement = parentElement.insertBefore(newElement, referenceElement);
    advise core.Node, 'insertBefore', (parent, args, rv) ->
        elem = args[0]
        DOM.emit 'DOMNodeInserted',
            target : elem
            relatedNode : parent
        # Note: unlike the DOM, we only emit DOMNodeInsertedIntoDocument
        # on the root of a removed subtree, meaning the handler should check
        # to see if it has children.
        if parent._attachedToDocument
            DOM.emit 'DOMNodeInsertedIntoDocument',
                target : elem
                relatedNode : parent


advise = (obj, name, func) ->
    originalMethod = obj.prototype[name]
    obj.prototype[name] = () ->
