Allow multiple events to be bound to onbeforeunload even

Using the raw assignment for window.onbeforeunload prevents other events from being bound to that event.  Using jquery's "on" method should alleviate this issue as well as any event binding issues with IE.