This is known as a ‘pop-under’ (and is generally frowned upon… but I digress).. It should give you plenty to google about
You probably want to do something like:
var popup = window.open(...);
popup.blur();
window.focus();
Which should set the focus back to the original window (untested – pinched from google). Some browsers might block this technique.