/* I want to be able to reference a javascript function in the main window from the popup. Is this doable? */
Yes, it is possible if you're opening a file that already already exists, such as blah.html, with window.open().
From the child window, you can call a function such as parentWindowFunction() from the parent by using something like this in the child and using the "opener" property:
self.opener.parentWindowFunction();
This works in IE6 and Opera 7, I haven't tested it with any other browsers.
...........................................
I've been trying to figure out how to create script in a new window that is written on the fly but not having much luck. So, I'm opening an existing window that already contains the script.
For every problem, there's a solution and every solution brings it's own set of problems.