function _SATracker() { this.init = function() { // globals this.doc = document; this.img = null; this.url = 'http://www.degaa.net/gather/WtbGG3HOeFTBVwNv4f79lg?'; this.uid = 'fd11978c-625a-4ce3-bad9-38f042b6a02e'; // get some extra info this.lang = window.navigator.systemLanguage ? window.navigator.systemLanguage : window.navigator.language; this.pixel = window.navigator.pixelDepth ? window.screen.pixelDepth : ""; this.cpu = navigator.platform ? navigator.platform : ""; this.timezone = ((new Date()).getTimezoneOffset) ? (new Date()).getTimezoneOffset() * -1 : ""; this.cookies = this.cookiesEnabled(); if (this.cookies == true) this.cookies = 1; else this.cookies = 0; this.java_enabled = navigator.javaEnabled(); if (this.java_enabled == true) this.java_enabled = 1; else this.java_enabled = 0; // get the js version this.js_version = "unknown"; try { document.write('SATracker.js_version = "1"'); document.write('SATracker.js_version = "1.1"'); document.write('SATracker.js_version = "1.2"'); document.write('SATracker.js_version = "1.3"'); document.write('SATracker.js_version = "1.4"'); document.write('SATracker.js_version = "1.5"'); document.write('SATracker.js_version = "1.6"'); document.write('SATracker.js_version = "1.7"'); document.write('SATracker.js_version = "1.8"'); document.write('SATracker.js_version = "1.9"'); document.write('SATracker.js_version = "2.0"'); } catch (e) { } // load / save visitor id (if no cookies then send blank) if (this.cookies == 1) { if (this.getCookie("sa_ui") != null) this.uid = this.getCookie("sa_ui"); else this.setCookie("sa_ui", this.uid, 9999); } else this.uid= ""; // get the title this.title = encodeURIComponent(this.doc.title); // see if we are in some frames if (typeof (top.document) == "object") this.ref = top.document; else this.ref = this.doc; if (this.doc.referrer.indexOf(this.ref.location.hostname) == -1) this.ref = this.doc; this.flash_version = GetSwfVer(); // event handler for tracking external clicks this.XBrowserAddHandler(document, "click", this.onClick); // event handler for tracking external clicks this.XBrowserAddHandler(window, "unload", this.onUnload); } this.setCookie = function(name, value, expiredays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + expiredays); document.cookie = name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()) + ";path=/"; } // this fixes an issue with the old method, ambiguous values // with this test document.cookie.indexOf( name + "=" ); this.getCookie = function(check_name) { var a_all_cookies = document.cookie.split(';'); var a_temp_cookie = ''; var cookie_name = ''; var cookie_value = ''; var b_cookie_found = false; // set boolean t/f default f for (i = 0; i < a_all_cookies.length; i++) { // now we'll split apart each name=value pair a_temp_cookie = a_all_cookies[i].split('='); // and trim left/right whitespace while we're at it cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, ''); // if the extracted name matches passed check_name if (cookie_name == check_name) { b_cookie_found = true; // we need to handle case where cookie has no value but exists (no = sign, that is): if (a_temp_cookie.length > 1) { cookie_value = unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g, '')); } // note that in cases where cookie is initialized but no value, null is returned return cookie_value; break; } a_temp_cookie = null; cookie_name = ''; } if (!b_cookie_found) { return null; } } // send the request to the server in the form of an image this.logVisit = function() { img = new Image(1, 1); img.src = this.getGatherUrl(1, null); // start the ping process this.startPing(); } // send the request to the server in the form of an image // for some reason browsers seemt to stop processing of // events when download is clicked // TODO, this probably wont work when the doc opens in the // current window this.logDownload = function(path) { setTimeout("SATracker._logDownload('" + path + "');", 100); } // send the request to the server in the form of an image this._logDownload = function(path) { var img = new Image(1, 1); img.src = this.getGatherUrl(4, path); } this.startPing = function() { setTimeout("SATracker.pingSession(true)", 60000 * 5); } this.pingSession = function(setTimer) { //img = new Image(1, 1); //img.src = this.getGatherUrl(-1, null); if (setTimer == true) this.startPing(); } this.XBrowserAddHandler = function(target, eventName, handlerName) { if (target.addEventListener) { target.addEventListener(eventName, handlerName, false); } else if (target.attachEvent) target.attachEvent("on" + eventName, handlerName); else target["on" + eventName] = handlerName; } this.cancelEvent = function(e) { if (!e) e = window.event; if (e.preventDefault) { e.preventDefault(); } else { e.returnValue = false; } } this.pause = function(milliseconds) { var time_now = new Date(); var time_expire = time_now.getTime() + milliseconds; while (time_now.getTime() < time_expire) time_now = new Date(); } this.cookiesEnabled = function() { var cookieEnabled = (navigator.cookieEnabled) ? true : false //if not IE4+ nor NS6+ if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled) { document.cookie = "testcookie" cookieEnabled = (document.cookie.indexOf("testcookie") != -1) ? true : false } // try writing a cookie to make sure! try { this.setCookie('sa_blob', 'a34jfk213', 1); if (this.getCookie('sa_blob') != 'a34jfk213') cookieEnabled = false; } catch (e) { cookieEnabled = false; } return cookieEnabled; } this.onUnload = function(e) { SATracker.pingSession(false); } this.onClick = function(e) { evnt_parent = null; if (typeof (e) != 'undefined' && e.target) { evnt = e; evnt_parent = evnt.target; } else { evnt = event.srcElement; evnt_parent = evnt.parentElement; } if (evnt_parent == null) return; if (evnt_parent.tagName == "A" || evnt_parent.tagName == "AREA") evnt = evnt_parent; else { if (evnt_parent.parentElement) { evnt_parent_p = evnt_parent.parentElement; if (evnt_parent_p.tagName == "A" || evnt_parent_p.tagName == "AREA") evnt = evnt_parent_p; } } isA = (evnt.tagName == "A" || evnt.tagName == "AREA") ? 1 : 0; isL = (isA && evnt.href) ? 1 : 0; if (!isL) return; if (evnt.href.indexOf("http") == -1) return; // see if its a download (even if its on another server) var fileTypes = new RegExp(/\.(docx*|xlsx*|pptx*|exe|zip|pdf|xpi)$/i); if (fileTypes.test(evnt.href)) { // track the event SATracker.logDownload(evnt.href); // let the request do its thing SATracker.pause(500); return; } domain_index = evnt.href.indexOf(SATracker.doc.domain); if ((domain_index < 9 && domain_index != -1) || evnt.href.indexOf("/") == 1) return; // send the reqeuest clk_img = new Image(1, 1); clk_img.src = this.getGatherUrl(2, evnt.href); } this.getGatherUrl = function(event_type, link_address) { new_url = this.url + 'ui=' + this.uid + '&et=' + event_type + '&ti=' + this.title + '&sh=' + screen.height + '&sw=' + screen.width + '&sc=' + screen.colorDepth + '&p=' + this.pixel + '&l=' + this.lang + '&c=' + this.cpu + '&t=' + this.timezone + '&ja=' + this.java_enabled + '&fv=' + this.flash_version + '&ref=' + escape(this.ref.referrer) + '&jv=' + this.js_version + '&ca=' + this.cookies + (link_address != null ? '&la=' + escape(link_address) : "") + '&v=' + Math.random(); return new_url; } } ///////////////////////////////////////////////////////////////////////////////////////////////// // Flash Player Version Detection - Rev 1.5 // Detect Client Browser type // Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved. function ControlVersion() { var version; var axo; var e; // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry try { // version will be set for 7.X or greater players axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); version = axo.GetVariable("$version"); } catch (e) { } if (!version) { try { // version will be set for 6.X players only axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); // installed player is some revision of 6.0 // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29, // so we have to be careful. // default to the first public version version = "WIN 6,0,21,0"; // throws if AllowScripAccess does not exist (introduced in 6.0r47) axo.AllowScriptAccess = "always"; // safe to call for 6.0r47 or greater version = axo.GetVariable("$version"); } catch (e) { } } if (!version) { try { // version will be set for 4.X or 5.X player axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); version = axo.GetVariable("$version"); } catch (e) { } } if (!version) { try { // version will be set for 3.X player axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); version = "WIN 3,0,18,0"; } catch (e) { } } if (!version) { try { // version will be set for 2.X player axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); version = "WIN 2,0,0,11"; } catch (e) { version = -1; } } return version; } // JavaScript helper required to detect Flash Player PlugIn version information function GetSwfVer() { // NS/Opera version >= 3 check for Flash plugin in plugin array var flashVer = -1; try { var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false; if (navigator.plugins != null && navigator.plugins.length > 0) { if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) { var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : ""; var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description; var descArray = flashDescription.split(" "); var tempArrayMajor = descArray[2].split("."); var versionMajor = tempArrayMajor[0]; var versionMinor = tempArrayMajor[1]; if (descArray[3] != "") { tempArrayMinor = descArray[3].split("r"); } else { tempArrayMinor = descArray[4].split("r"); } var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0; var flashVer = versionMajor + "." + versionMinor + "." + versionRevision; } } // MSN/WebTV 2.6 supports Flash 4 else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4; // WebTV 2.5 supports Flash 3 else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3; // older WebTV supports Flash 2 else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2; else if (isIE && isWin && !isOpera) { flashVer = ControlVersion(); } } catch (ex) { } return flashVer; } ///////////////////////////////////////////////////////////////////////////////////////////////// // create the object var SATracker = new _SATracker(); // get params SATracker.init(); // log the visit SATracker.logVisit();