(function(){ function ua(a){ var b = 1, c = 0, d,e,f,g; if (!(g == a || "-" == a && !b || "" == a)){ b = "0"; g = 1; for (d = a.length - 1; d >= 0; d-=3) { c = a.charCodeAt(d), e = a.charCodeAt(d-1),f = a.charCodeAt(d-2), c = (g * c) + (e<<8) + (f<<15), b += c[t](36) + '_'; g = g%2==0? 1: g+1; } } return b } var W=window,J=document,g = void 0, h = true,i = null, j = false, ca = Infinity, t = "toString"; var E=new function(){ var a=[]; this.set = function(b) { a[b]=1 }; this.get = function() { for (var b=[],c=0; c < a.length; c++) a[c]&&(b[Math.floor(c/6)]=b[Math.floor(c/6)]^1< 2147483648 && (b = g); b > 0 && a.setPageReadyTime(); return b == g ? g : [b]; } }, Td = function(){ if (zz.length == 0) { return; } var dd = ua('{ "op":' + JSON.stringify(zz) + ', "r": ' + new Date().getTime() + '}'); zz = []; Yd(dd, function() { E.set(124); }); }, Yd = function (a, b){ var d = J.ps_image; if (!d) { d = new Image(1, 1); } d.src = "/p/utm.gif?" + a; d.onload = function () { d.onload = null; d.onerror = null; b(h) } d.onerror = function () { d.onload = null; d.onerror = null; b(j) } }; var b = j, c = function (){ !b && $d(a) && (E.set(124), b = h, ya(J, "webkitvisibilitychange", c)); }, d = new qc, e = i, f = function () { Td(); Yd(ua('{"e":' + JSON.stringify(E.get()) + ', "r": ' + new Date().getTime() + '}'), i); }, k = function() { }; var xa = function (a, b, c, d){ a.addEventListener ? a.addEventListener(b, c, !!d) : a.attachEvent && a.attachEvent("on" + b, c) }, ya = function (a, b, c, d){ a.removeEventListener ? a.removeEventListener(b, c, !!d) : a.detachEvent && a.detachEvent("on" + b, c) }; xa(J, "webkitvisibilitychange", c); xa(W, "beforeunload", f); xa(W, "load", function () { Id(); setInterval(Td, 1400); }, j); /*global window: true*/ var sd=new Date().getTime(),sx,sy,sz=sd,ww,wh,wz=sz,zz=[]; W.onscroll = function () { sx = document.documentElement.scrollLeft || document.body.scrollLeft; sy = document.documentElement.scrollTop || document.body.scrollTop; var td = new Date().getTime(); if (sz < td - 500) { zz.push({'sx':sx, 'sy':sy, 'td':td-sd}); } sz = td; }, W.onresize = function (e) { ww = window.innerWidth; wh = window.innerHeight; var td = new Date().getTime(); if (wz < td - 500) { zz.push({'ww':ww, 'wh':wh, 'td':td-sd}); } wz = td; }; var l, ld, lt; function Ld(e) { var c, element, x, y, w, h, winw, winh, scrollx, scrolly, clickTime, now, clickHeatImg, params, sent = false, xmlhttp = false; /* Use a try{} to avoid showing errors to users */ try { /* Look for the real event */ if (!e) { e = W.event; } c = e.which || e.button; element = e.srcElement || e.target || i; if (c === 0) { return true; } /* Filter for same iframe (focus on iframe => popup ad => close ad => new focus on same iframe) */ if (element !== null && element.tagName.toLowerCase() === 'iframe') { if (element.sourceIndex === l) { return true; } l = element.sourceIndex; } else { l = -1; } x = e.clientX; y = e.clientY; w = ld.clientWidth || W.innerWidth; h = ld.clientHeight || W.innerHeight; scrollx = W.pageXOffset || ld.scrollLeft; scrolly = W.pageYOffset || ld.scrollTop; winw = Math.max(ld.scrollWidth, ld.offsetWidth, w); winh = Math.max(ld.scrollHeight, ld.offsetHeight, h); px = e.pageX - W.pageXOffset; py = e.pageY - W.pageYOffset; /* Is the click in the viewing area? Not on scrollbars. The problem still exists for FF on the horizontal scrollbar */ if (x > w || y > h) { return true; } x += scrollx; y += scrolly; /* Is the click in the document area? */ if (x < 0 || y < 0 || x > winw || y > winh) { return true; } /* Check if last click was at least 1 second ago */ clickTime = new Date(); if (clickTime.getTime() - lt < 1000) { return true; } lt = clickTime.getTime(); var node = document.elementFromPoint(px, py); // Opera9.x has text-node if (node.nodeType === 3) { node = node.parentNode; } var xp = ''; for ( ; node && node.nodeType == 1; node = node.parentNode ) { var id = $(node.parentNode).children(node.tagName).index(node) + 1; id > 1 ? (id = '[' + id + ']') : (id = ''); xp = '/' + node.tagName.toLowerCase() + id + xp; } params = {'x': x, 'y': y, 'w': w, 'c': c, 'r': new Date(), 'xp': xp}; /* Local request (not starting with "http")? Try an ajax call */ Yd(ua(JSON.stringify(params)), function() { E.set(115); }); } catch (err) { console.debug(err.message); } return true; } /* If current website has the same domain as the script, we remove the domain so that the call is made using Ajax */ for( i = 0; i < document.getElementsByTagName("a").length; i++ ) { xa(document.getElementsByTagName("a")[i], 'mousedown', Ld); } for( i = 0; i < document.getElementsByTagName("input").length; i++ ) { xa(document.getElementsByTagName("input")[i], 'focus', Ld); } for( i = 0; i < document.getElementsByTagName("select").length; i++ ) { xa(document.getElementsByTagName("select")[i], 'focus', Ld); } for( i = 0; i < document.getElementsByTagName("textarea").length; i++ ) { xa(document.getElementsByTagName("textarea")[i], 'focus', Ld); } for( i = 0; i < document.getElementsByTagName("button").length; i++ ) { xa(document.getElementsByTagName("button")[i], 'mousedown', Ld); } xa(J, 'mousedown', Ld); /* Add onfocus event on iframes (mostly ads) - Does NOT work with Gecko-powered browsers, because onfocus doesn't exist on iframes */ var iFrames = document.getElementsByTagName('iframe'); for (i = 0; i < iFrames.length; i += 1) { xa(iFrames[i], 'focus', Ld); } ld = J.documentElement && J.documentElement.clientHeight !== 0 ? J.documentElement : J.body; /* Preparing main variables */ /* Also the User-Agent is not the best value to use, it's the only one that gives the real browser */ b = navigator.userAgent ? navigator.userAgent.toLowerCase().replace(/-/g, '') : ''; /* Always test Chrome before Safari */ browsers = ['chrome', 'firefox', 'safari', 'msie', 'opera']; clickHeatBrowser = 'unknown'; for (i = 0; i < browsers.length; i += 1) { if (b.indexOf(browsers[i]) !== -1) { clickHeatBrowser = browsers[i]; break; } } })();