Report question

Question: is it possible to open a popup with javascript and then detect when the user closes it?