cross-browser onbeforeunload: