<p>// NB! You must manually change the value
</p><p>// of the following adlink variable!
</p><p>//
</p><p>// Unique part of the ad link(s), i.e.,
</p><p>// if the ad-link is myadvertiser.com,
</p><p>// you can use "myadvertiser":
</p><p>//
</p><p>var adlink="change this text!";
</p><p>//
</p><p>// Time in seconds until the ads come back
</p><p>// (default 24 hours):
</p><p>//
</p><p>var timeout=60*60*24;
</p><p>
</p><p>
// Do not change anything in the code below:
</p><p>var showads = 1;
</p><p>function adMessage(adcode) {
</p><p>if (document.cookie == "") {
</p><p>document.write(adcode);
</p><p>} else {
</p><p>var the_cookie = document.cookie;
</p><p>the_cookie = unescape(the_cookie);
</p><p>the_cookie_split = the_cookie.split(";");
</p><p>for (loop=0;loop<the_cookie_split.length;loop++) {
</p><p>var part_of_split = the_cookie_split[loop];
</p><p>var find_name = part_of_split.indexOf("ad");
</p><p>if (find_name!=-1) {
</p><p>break;
</p><p> }
</p><p>}
</p><p>if (find_name==-1) {
</p><p>document.write(adcode);
</p><p>} else {
</p><p>var ad_split = part_of_split.split("=");
</p><p>var last = ad_split[1];
</p><p>if (last!=0) {
</p><p>document.write(adcode);
</p><p>} else {
</p><p>showads=0;
</p><p> }
</p><p> }
</p><p> }
</p><p>}
</p><p>function writeCookie(show) {
</p><p>var today = new Date();
</p><p>var the_date = new Date();
</p><p>the_date.setTime(today.getTime() + 1000 * timeout);
</p><p>var the_cookie_date = the_date.toGMTString();
</p><p>var the_cookie = "ad="+show;
</p><p>var the_cookie = the_cookie + ";expires=" + the_cookie_date;
</p><p>document.cookie = the_cookie;
</p><p>location.reload(true);
</p><p>}
</p><p>function handleClick(evnt) {
</p><p>var targetstring = new String(evnt.target);
</p><p>if (targetstring.search(adlink) != -1) {
</p><p>writeCookie(0);
</p><p>}
</p><p>routeEvent(evnt);
</p><p>return true;
</p><p>}
</p><p>if (window.Event) {
</p><p>window.captureEvents(Event.CLICK);
</p><p>}
</p><p>window.onClick = handleClick;
</p><p>adMessage(<i>);</i>
</p>