This script opens a window on loading and closes automatically.
Set the amount of time the window remains open where you see:
clearID=defwin.setTimeout("self.close()",5000)
The 5000 is miliseconds so this window closes in 5 seconds.
You could change the script to open the window on exit.
Replace in body tag - onLoad="popdef()" with onUnLoad="popdef()".
Copy and Paste in your page: