First a warning
Do not get carried away with this. Having new windows popping open all the time when you are browsing, particularly just for adverts, can get extremely irritating. You will end up losing your viewers instead of attracting them. In addition, they can cause problems with accessibility. It is best to only open new windows if the user asks you to. Let them know that the link (or whatever) opens in a new window.
Many browsers have popup blockers that will block you from opening unrequested popups. Most will only allow popups to be opened if the user actually clicks on something on the page.
To see the script license and check details like browser compatibility, use the links on the navigation panel at the top of this page.