Targeting parent windows with javascript?

Ok, I’m no javascript boffin, but I’ve seen it done where a script launches a popup window and you can tell the parent window to do a behaviour (In my case I want it to refresh when the popup is closed). Am I totally off track? I’m not sure if the script is fired from the parent window or the child.

I guess what I’m asking is, please… how is it done?