Derived from that article is the simplified version we will use:
Currently this fires a new window with my site but with the prevelance of pop-up blockers don't expect this to be terribly effective.
var needToConfirm = false;
window.onbeforeunload = confirmExit;
//return "[Unremark this line to show the customized confirm dialog with OK/Cancel options.]";
needToConfirm = true;