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