win.contentWindow

var wsrc = w.contentWindow
The "contentWindow" property points to the DHTML source of the inner displayFrame of the window. In case the window has been created with a sixth (src) parameter, this variable will point to the base DHTML window of that source. When a WebServer request has returned, "contentWindow" will point to the the base window of the server-generated web page To address the first image in a window called "w", use:
w.contentWindow.document.getElementsByTagName("img")[0]