function ddpzp(type) { var m, b; var W = document; var V = navigator; var flash = 0; var site_id = 1196519; var userid='fcbf20097bbc487528d31b6e65be37f3'; var reqId = 0; var uId = 0; var isSSL = ('https:' == document.location.protocol); var baseUrl = ('https:' == document.location.protocol ? 'https:' : 'http:') + '//sys.datadrivenpromotion.com/'; var IE = document.all ? true : false; var r = document.referrer; // ip: 158.181.28.5 function getXmlHttp() { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else if (IE) { xmlhttp = new XDomainRequest(); } return xmlhttp; } function sendData() { var xmlhttp = getXmlHttp(); var path = baseUrl + 't=1415253616/request?' + 'type=1&referrer=' + r + '&resol=' + screen.width + 'x' + screen.height + "&site_id=" + site_id; if (IE && window.XDomainRequest) { var xdr = new XDomainRequest(); xdr.open("GET", path); xdr.withCredentials = true; xdr.onload = function () { reqId = parseInt(xdr.responseText); localStorage.setItem("ddp_id", reqId); }; xdr.send(); } else { xmlhttp.open('GET', path, true); xmlhttp.withCredentials = true; xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4) { reqId = parseInt(xmlhttp.responseText); localStorage.setItem("ddp_id", reqId); } }; xmlhttp.send(); } } function sendEvent(param) { reqId=localStorage.getItem("ddp_id"); var path = baseUrl + "t=1415253616?requestId=" + reqId + '&' + param + ''; if (reqId > 0) { if (IE && window.XDomainRequest) { var xdr = new XDomainRequest(); xdr.open("get", path); xdr.send(); } else { var xmlhttp = getXmlHttp(); xmlhttp.open('POST', path, true); xmlhttp.send(); } } } document.onclick = function (e) { var x; var y; if (IE) { try { x = window.event.clientX; y = window.event.clientY; } catch (e) { x = 0; y = 0; } } else { x = e.pageX; y = e.pageY; } var b = "event=click"; b += "&x=" + x + "&y=" + y; // sendEvent(b); } function sendRequest() { if (u != document.URL) { sessP++; var str = ''; str += '&referrer=' + u; str += '&url=' + document.URL; str += '&display=' + screen.width + 'x' + screen.height; str += '&t=1415253616'; sendData(str); u = document.URL; } } function loadScript(path) { var ra = document.createElement('script'); ra.type = 'text/javascript'; ra.async = true; ra.src = (path); var st = document.getElementsByTagName('script')[0]; st.parentNode.insertBefore(ra, st); } function timeRequest() { ddp_timer = ddp_timer + 5000; var sy = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop; if (ddp_timer == 5000 || ddp_timer == 30000 || ddp_timer == 60000 || ddp_timer == 90000 || ddp_timer == 180000 || ddp_timer == 300000) { var b = "event=time"; b += "&time=" + ddp_timer + "&height=" + (document.height == null ? 0 : document.height) + "&sy=" + (sy == null ? 0 : sy); sendEvent(b); } } if (type == 1) { timeRequest(); } if (type == 0) { sendData(); if (flash == 1) { if (!IE) setInterval("sendRequest();", 1000); else window.setInterval("sendRequest();", 1000); } if (!isSSL) { loadScript('http://sys.datadrivenpromotion.com/t=1415253842?type=getZp&ishide=false'); } else { loadScript('https://sys.datadrivenpromotion.com/t1475387388?type=getZp&ishide=false&domain='+window.location.href); } } } var ddp_timer=0; if (document.all==null) setInterval("ddpzp(1);", 5000); else window.setInterval("ddpzp(1);", 5000); ddpzp(0);