Basically you need to do this with JS.
You will want to use the opener property:
The opener property sets or retrieves a reference to the window that created the current window. When a source document opens a destination window by calling the open() method, the opener property (of the destination window's window object) specifies the window of the source document. This property persists across document unload in the opened window, so it can be accessed even if the URL in the new window is changed
Lots of examples of this on the interwebs:
http://www.webreference.com/js/tutorial1/opener.html[
^]