document.write ('Join the TrafficZap Exchange!'); var showpopup="yes"; document.cookie = "Cookies=ON"; function rnd() { rnd.seed = (rnd.seed*9301+49297) % 233280; return rnd.seed/(233280.0); } function rand() { return Math.ceil(rnd()*10); // PART B } function setCookie(name, value, expires, path, domain, secure) { var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); document.cookie = curCookie; } function getCookie(name) { // use: getCookie("name"); var index = document.cookie.indexOf(name + "="); if (index == -1) return null; index = document.cookie.indexOf("=", index) + 1; var endstr = document.cookie.indexOf(";", index); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(index, endstr)); } if (window.parent.frames["tzapexchtop"] || window.parent.parent.frames["tzapexchtop"] || window.parent.parent.parent.frames["tzapexchtop"]) { // If we are here, we are inside the frame thedate = new Date(); thedate.setHours(thedate.getHours()+1); setCookie('seenpopup', 'yes', thedate); } else { // If we are here, we are NOT in the frame if (document.cookie != '') { // Cookie found. This user has cookies turned on thedate = new Date(); thedate.setHours(thedate.getHours()+1); if ( getCookie('seenpopup') == 'yes' ) { // Read the cookie and seenpopup=yes showpopup="no"; // WE CAN TURN COOKIES OFF WITH "yes" } else { // Just setting the cookie. Now seenpopup= yes. setCookie('seenpopup', 'yes', thedate); showpopup="yes"; } } else { // document.write ('User has cookies turned off. Going to rand 1-10.

'); // if user has cookies turned OFF, randomly show ad 1 out of 10 times (A out of B) rnd.today=new Date(); rnd.seed=rnd.today.getTime(); // Note: Below I disabled the randomization (by puttin 10) for now as it falls to IP checking. // put 1 for 1 in 10. (Switched it to 10 for all the time). if (rand() <= 10 ) { // PART A (LEAVE AT 10) // Rand pick is telling us to show a popup showpopup="yes"; } else { // Rand pick is telling us NOT to show a popup showpopup="no"; } } if (showpopup == "yes") { // show a popup but go check if IP in the dbase // sending to exit2.php?id=$id document.write (''); } else { // No Popup To Be Shown } }