/** Code by www.labsmedia.com */function addEvtListener(c,b,a){if(document.addEventListener){if(c){c.addEventListener(b,a,false)}else{addEventListener(b,a,false)}}else{if(attachEvent){if(c){c.attachEvent("on"+b,a)}else{attachEvent("on"+b,a)}}}}var clickHeatGroup="",clickHeatSite="",clickHeatServer="",clickHeatLastIframe=-1,clickHeatTime=0,clickHeatQuota=-1,clickHeatBrowser="",clickHeatDocument="",clickHeatWait=500,clickHeatLocalWait=0,clickHeatDebug=(document.location.href.indexOf("debugclickheat")!==-1);function showClickHeatDebug(a){if(clickHeatDebug===true){document.getElementById("clickHeatDebuggerSpan").innerHTML=a;document.getElementById("clickHeatDebuggerDiv").style.display="block"}}function catchClickHeat(o){var p,d,j,i,k,n,m,b,a,v,s,f,r,q,u=false,z=false;try{showClickHeatDebug("Gathering click data...");if(clickHeatQuota===0){showClickHeatDebug("Click not logged: quota reached");return true}if(clickHeatGroup===""){showClickHeatDebug("Click not logged: group name empty (clickHeatGroup)");return true}if(!o){o=window.event }p=o.which||o.button;d=o.srcElement||null;if(p===0){showClickHeatDebug("Click not logged: no button pressed");return true}if(d!==null&&d.tagName.toLowerCase()==="iframe"){if(d.sourceIndex===clickHeatLastIframe){showClickHeatDebug("Click not logged: same iframe (a click on iframe opens a popup and popup is closed => iframe gets the focus again)");return true}clickHeatLastIframe=d.sourceIndex}else{clickHeatLastIframe=-1}j=o.clientX;i=o.clientY;k=clickHeatDocument.clientWidth||window.innerWidth;n=clickHeatDocument.clientHeight||window.innerHeight;a=window.pageXOffset||clickHeatDocument.scrollLeft;v=window.pageYOffset||clickHeatDocument.scrollTop;m=Math.max(clickHeatDocument.scrollWidth,clickHeatDocument.offsetWidth,k);b=Math.max(clickHeatDocument.scrollHeight,clickHeatDocument.offsetHeight,n);if(j>k||i>n){showClickHeatDebug("Click not logged: out of document (should be a click on scrollbars)");return true}j+=a;i+=v;if(j<0||i<0||j>m||i>b){showClickHeatDebug("Click not logged: out of document (should be a click out of the document's body)"); return true}s=new Date();if(s.getTime()-clickHeatTime<1000){showClickHeatDebug("Click not logged: at least 1 second between clicks");return true}clickHeatTime=s.getTime();if(clickHeatQuota>0){clickHeatQuota=clickHeatQuota-1}q="s="+clickHeatSite+"&g="+clickHeatGroup+"&x="+j+"&y="+i+"&w="+k+"&b="+clickHeatBrowser+"&c="+p+"&random="+Date();showClickHeatDebug("Ready to send click data...");if(clickHeatServer.indexOf("http")!==0){try{z=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{z=new ActiveXObject("Microsoft.XMLHTTP")}catch(l){z=null}}if(!z&&typeof(XMLHttpRequest)!=="undefined"){z=new XMLHttpRequest()}if(z){if(clickHeatDebug===true){z.onreadystatechange=function(){if(z.readyState===4){if(z.status===200){showClickHeatDebug("Click recorded at "+clickHeatServer+" with the following parameters:
x = "+j+" ("+(j-a)+"px from left + "+a+"px of horizontal scrolling, max width = "+m+")
y = "+i+" ("+(i-v)+"px from top + "+v+"px of vertical scrolling, max height = "+b+")
width = "+k+"
browser = "+clickHeatBrowser+"
click = "+p+"
site = "+clickHeatSite+"
group = "+clickHeatGroup+"

Server answer: "+z.responseText) }else{if(z.status===404){showClickHeatDebug("click.php was not found at: "+(clickHeatServer!==""?clickHeatServer:"/clickheat/click.php")+" please set clickHeatServer value")}else{showClickHeatDebug("click.php returned a status code "+z.status+" with the following error: "+z.responseText)}}clickHeatLocalWait=0}}}z.open("GET",clickHeatServer+"?"+q,true);z.send(null);u=true}}if(u===false){if(clickHeatDebug===true){showClickHeatDebug("Click recorded at "+clickHeatServer+" with the following parameters:
x = "+(j+a)+" ("+j+"px from left + "+a+"px of horizontal scrolling)
y = "+(i+v)+" ("+i+"px from top + "+v+"px of vertical scrolling)
width = "+k+"
browser = "+clickHeatBrowser+"
click = "+p+"
site = "+clickHeatSite+"
group = "+clickHeatGroup+'

Server answer:
')}else{r=new Image();r.src=clickHeatServer+"?"+q}}f=new Date();clickHeatLocalWait=f.getTime()+clickHeatWait;while(clickHeatLocalWait>f.getTime()){f=new Date() }}catch(g){showClickHeatDebug("An error occurred while processing click (Javascript error): "+g.message)}return true}function initClickHeat(){var d,f,a,c,e,g;if(clickHeatDebug===true){g=document.createElement("div");g.id="clickHeatDebuggerDiv";g.style.padding="5px";g.style.display="none";g.style.position="absolute";g.style.top="200px";g.style.left="200px";g.style.border="1px solid #888";g.style.backgroundColor="#eee";g.style.color="#a00";g.style.zIndex=99;g.innerHTML='Rollover to closeClickHeat debug:

';document.body.appendChild(g)}if(clickHeatGroup===""||clickHeatServer===""){showClickHeatDebug("ClickHeat NOT initialised: either clickHeatGroup or clickHeatServer is empty");return false}e=document.location.protocol+"//"+document.location.host;if(clickHeatServer.indexOf(e)===0){clickHeatServer=clickHeatServer.substring(e.length,clickHeatServer.length) }addEvtListener(document,"mousedown",catchClickHeat);f=document.getElementsByTagName("iframe");for(d=0;dsite = "+clickHeatSite+"
group = "+clickHeatGroup+"
server = "+clickHeatServer+"
quota = "+(clickHeatQuota===-1?"unlimited":clickHeatQuota)+"
browser = "+clickHeatBrowser+"

Click in a blank area (not on a link) to test ClickHeat")};