fires when the popup is being hidden
myPop.attachEvent("onHide", function(){ console.log("The popup window is hidden"); });