[javascript] How to run function of parent window when child window closes?