var target="http://affiliate.casinorewards.com/redirect.asp?aff_id=aff13501&casino_id=1"; var gonaexit = 1; var nsBrowser=false; var ieBrowser=false; function Set_Cookie(name,value,expires,path,domain,secure) { document.cookie = name + "=" +escape(value) + ( (expires) ? ";expires=" + expires.toGMTString() : "") + ( (path) ? ";path=" + path : "") + ( (domain) ? ";domain=" + domain : "") + ( (secure) ? ";secure" : ""); } function set_ce_exit(state) { var ce_cookiename="ce_xstate"; var expireit = new Date(); expireit.setTime(expireit.getTime() + (24*60*60*1000)); // set cookie for 24hrs if (state!="on" && state!="off") { state="on"; } Set_Cookie(ce_cookiename,state,expireit); } function GetCookie (CookieName) { var CookieFull = document.cookie; var CookieGroup = CookieFull.split (';'); var GroupCount = CookieGroup.length; var CookiePieces; var ReturnValue = ""; var i = 0; for (i = 0; ((i < GroupCount) && (ReturnValue == "")); i++) { CookiePieces = CookieGroup[i].split ('='); if (CookiePieces[0].substring (0,1) == ' ') { CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length); } if (CookiePieces[0] == CookieName) { ReturnValue = CookiePieces[1]; } } return ReturnValue; } function main_set_ce_exit(state) { var ce_cookiename="ce_xstate"; var expireit = new Date(); expireit.setTime(expireit.getTime() + (24*60*60*1000)); // set cookie for 24hrs if (state!="on" && state!="off") { state="on"; } Set_Cookie(ce_cookiename,state,expireit); } function ce_ReadCookie(){ var exitting="on"; exitting = GetCookie('ce_xstate'); if (exitting != "on" && exitting != "off") { exitting = "on"; } window.setTimeout('ce_ReadCookie()',1000); return exitting; } function PopUp(Display) { var mymote = window.open(Display,"CE_Ad", 'toolbar=yes,scrollbars=yes,resizable=yes,menubar=yes,status=yes,directories=yes,location=yes,width=800,height=600'); if (document.images){ mymote.blur(); } } function go_ce_exit(){ var xstate="on"; xstate=ce_ReadCookie(); if (xstate != "on" && xstate != "off") { xstate = "on"; } if (xstate!="off") { set_ce_exit('off'); PopUp(target); } } if (parseInt(navigator.appVersion) >= 4) { if (navigator.appName == "Netscape") { nsBrowser = true; } else { ieBrowser = true; } } if (nsBrowser) { document.captureEvents(Event.CLICK | Event.UNLOAD | Event.LOAD | Event.ERROR); } function errorCapture(e) { return true; } window.onerror = errorCapture; function clickCapture(e){ gonaexit=0; if (nsBrowser) { document.routeEvent(e); } return true; } function exitCapture(){ if (gonaexit) { go_ce_exit(); } return true; } function setup_exit(){ document.onclick = clickCapture; if (ieBrowser) { window.onunload = function bubye() { exitCapture(); } }else{ window.onunload = exitCapture; } } setup_exit(); set_ce_exit('on');