Popup window.. RW or build my own

I have a page with lots of stats on it and a “plot” button that calls another window with some graphical info about the stats. I’m careful here as I know popups get blocked so I’m calling a new window.

I would really like the main page to keep control of the “child” window in that when the main page closes or the user goes to another page the “child” window closes.

Also should I build my own page using javascript or have an RW page that is called via it’s URL?

Anyone have any experience with this and would care to share please?