Here is a link to a couple of pop-under scripts that you should be able to modify to take place when someone leaves the page. They both use cookies so that they only popunder once per session. As far as when a browser window is closed or only if they go to a different site is probably not doable. http://www.javascriptkit.com/script/cutindex12.shtml
Bookmarks