document.write ('Join the Bravenet 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)); } var today = new Date(); var thedate = new Date(); thedate.setTime(today.getTime() + (5*60*1000)); if (window.name=="bnetexchbottom") { setCookie('seen-bnet-exch', 'yes', thedate); } else { if (document.cookie != '') { if ( getCookie('seen-bnet-exch') == 'yes' ) { showpopup="no"; } else { setCookie('seen-bnet-exch', 'yes', thedate); showpopup="yes"; } } else { rnd.today=new Date(); rnd.seed=rnd.today.getTime(); if (rand() <= 10 ) { showpopup="yes"; } else { showpopup="no"; } } if (showpopup == "yes") { document.write (''); } else { // No Popup To Be Shown } }