I actually had this same question - here's a solution I found (I know this thread is old, but I know it can be useful to others)

I used:
Code:
ref=window.open().focus();
This will not work with all browsers, at least not yet, but it certainly will work with some, and it's worth a try!