You've probably seen this on some web sites. When you enter the site, but more frequently when you leave the site, a console pops up with some additional info or ads, or a poll etc. This can be done using Java script.
To Open A Console When Someone Enters Your Site:
window.open('http://www.freewebmastertips.com','HB','toolbar=1, location=1,status=1,menubar=1, scrollbars=1,resizable=1, width=500,height=300');
Just place the above code within the BODY tags.
To Open A Console When Someone Leaves Your Site:
Place the following attribute in the <body> tag: onunload="leave()"
<body bgcolor="#000000" onunload="leave()">
Place the following code between the "</head>" and <body> tag.
open("http://www.freewebmastertips.com",'HBexit','toolbar=1,location=1, status=1,menubar=1,scrollbars=1,resizable=1, width=500,height=300');
Now you will have a console popping up everytime you leave the site. So make sure you use the below attribute in the <a href> tag on links to avoid the exit console from popping up on sponsors and other links where this is not desired.
<A HREF="http://www.anydomain.com" onclick="exit=false">
NOTE: Make sure you keep the long string of codes intact; if you break them, they won't work (and that's why this page is different also). To customize the codes, replace the URL in red with the one of your choice. Oh, don't overdo this because your visitors will get annoyed.