// Portent Click Logger, v1.6
var xmlhttp;
/*@cc_on @*/ /*@if (@_jscript_version >= 5) try { xmlhttp=new ActiveXObject("Msxml2.XMLHTTP") } catch (e) { try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP") } catch (E) { xmlhttp=false } } @else xmlhttp=false @end @*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } }
ns=(document.layers); ie=(document.all); ff=(document.getElementById); saf=(navigator.userAgent.toLowerCase().indexOf("safari")>=0);
var click_x; var click_y; var client_width; var site_cookie = document.cookie;
if (!ns) { if (ff && !ie) document.captureEvents(Event.MOUSEUP); document.onmouseup = portent_mouseUp; window.onunload = portent_unLoad; }
function portent_mouseUp(e) { click_target = (ie) ? event.srcElement : e.target; click_target = (saf && ! click_target.tagName) ? click_target.parentNode : click_target; if (click_target.tagName == "A" || click_target.tagName == "IMG" || click_target.tagName == "INPUT") {	click_x = (ie) ? event.x: e.pageX; click_y = (ie) ? event.y + document.documentElement.scrollTop : e.pageY; client_width = (document.documentElement && document.documentElement.clientHeight) ? document.documentElement.clientWidth : document.body.clientWidth; } return true; }
function portent_unLoad() { if (xmlhttp) { xmlhttp.open("POST", document.location.protocol + "//" + document.location.hostname + "/portent_click.cfm", true); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttp.send("s=" + document.location.hostname + "&t=" + document.location.pathname + "&x=" + click_x + "&y=" + click_y + "&w=" + client_width + "&c=" + document.cookie); } }