Var scope on the same line
The modern way to attach onLoad and onUnload handlers is to use window.addEventListener('load', onloadFunction) and window.addEventListener('unload', onunloadFunction).  Unlike window.onload, you can attach multiple handlers, saving you the work of writing your own support for multiple handlers.

Unfortunately, Internet Explorer only added support for addEventListener() in IE 9.  Therefore, you'll probably need a shim.  That would be a common shim that supports a standard interface, rather than your own hack, so I would still consider it an improvement.