Say you have a global function alert2:
function alert2(msg) { window.alert(msg); }
And you also have a reference to a second window obj
You can use childWindow.opener to get the window object that opened the child window.
childWindow.opener
window
alert2.call(childWindow.opener, "called from child using parent as context");
Demo: http://jsfiddle.net/hJ7uw/8/