online / offline events should be attached to window rather than document.body

Issue #551

Reviewed By: Jeffrey Heifetz <jheifetz@rim.com>