Code cleanup, added support for mouse events capturing outside browser window in IE