I am asking a small percentage of users on a site if they would take a short survey. If they click 'yes' I would like to close the little pop-up window i have open that is asking them, and launch a new window in the background that comes to the forefront once they leave my domain - or close their browser.
Right now I am using a form:
<form>
<input type="button" value="Yes" name="Yes" onclick="javascript:openSurvey();">
<input type="button" value="No Thanks" name="No" onclick="javascript:closeSurvey();">
</form>
I'm having trouble with this though. I think I can launch the new window OK, but I can't figure out how to close the other window and put the new window in the background. Any tips?