Ideally what I want is to pop up the ad after user leaves the site or closes the window.
At least I want is to show single pop up in the whole guest session.
I place the ad code before </body> in page.tpl.php but it gets executed for every page.
I'm thinking to make it better by using this logic:
At least this will reduce pop up by 3 times.
Are there any better ideas?