             _nativeWindow.addEventListener("deactivate", nativeWindow_deactivateHandler, false, 0, true);
             
  			addEventListener(Event.ENTER_FRAME, enterFrameHandler);
- 			//debug
- 			var x:Object = StyleManager.stylesRoot;
+ 			
  			//'register' with WindowedSystemManager so it can cleanup when done.
  			sm.addWindow(this);
         }

		    	if (NativeWindow.supportsMenu)
		    		nativeWindow.menu = menu.nativeMenu;
		    }
        }

        if (titleBarFactoryChanged)

    private function window_closeHandler(event:Event):void
    {
        dispatchEvent(new Event("close"));
        
        // Event for Automation so we know when windows 
        // are created or destroyed.
        if (ApplicationGlobals.application)
        {
            ApplicationGlobals.application.dispatchEvent(
                new WindowExistenceEvent(WindowExistenceEvent.WINDOW_CLOSE, 
                                         false, false, this));
        }
    }
    
    /**
