function _SATracker() { this.init = function () { // globals this.doc = document; this.img = null; this.url = 'https://v1.degaa.net/gather/WtbGG3HOeFTBVwNv4f79lg?'; this.uid = 'fb60817a-8c45-4303-80a5-ce31f367b2a2'; this.sid = 'WtbGG3HOeFTBVwNv4f79lg' // 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; } ///////////////////////////////////////////////////////////////////////////////////////////////// // DA Survey loader.. var _DA = []; _DA.get = function (id) { return document.getElementById(id); } _DA.remove = function (id) { // remove existing element var existing = _DA.get(id); if (existing != null) { // delete from parent if (existing.parentNode != null) existing.parentNode.removeChild(existing); } } _DA.getClientSize = function () { var width = 0; var height = 0; if (typeof (window.innerWidth) == 'number') { width = window.innerWidth; height = window.innerHeight; } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { width = document.documentElement.clientWidth; height = document.documentElement.clientHeight; } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) { width = document.body.clientWidth; height = document.body.clientHeight; } return { width: width, height: height }; } _DA.setHtml = function (obj, html) { obj.innerHTML = html; } _DA.timerCallback = function (obj, msec, proc) { var internalProc = function () { var result = proc(obj); if (result) setTimeout(internalProc, msec); }; setTimeout(internalProc, msec); } _DA.create = function (id, deleteOld, parent) { if (deleteOld) { _DA.remove(id); } // create the element var newElement = document.createElement('div'); newElement.id = id; // append to document if (parent != null) parent.appendChild(newElement); return newElement; } _DA.setCss = function (elem, p, v) { if (p == 'opacity') { // IE uses a whole number as a percent if (document.all) { elem.style.filter = 'alpha(opacity=' + (v * 100) + ')'; } // Moz/compat uses a decimal value else { var d = v / 1; elem.style.opacity = d; } } else if (p == 'clip' || p.toLowerCase().indexOf('color') > -1) { elem.style[p] = v; } else { elem.style[p] = v; // document.all ? parseInt(v, 10) + 'px' : v + 'px'; } return true; }; _DA.setCookie = function (name, value, optParam) { var opts = optParam || {}; var path = '/'; var days = 0; var hours = 0; var minutes = 0; var exp = ''; var t = 0; if (typeof optParam == 'object') { path = opts.path || '/'; days = opts.days || 0; hours = opts.hours || 0; minutes = opts.minutes || 0; } else { path = optParam || '/'; } t += days ? days * 24 * 60 * 60 * 1000 : 0; t += hours ? hours * 60 * 60 * 1000 : 0; t += minutes ? minutes * 60 * 1000 : 0; if (t) { var dt = new Date(); dt.setTime(dt.getTime() + t); exp = '; expires=' + dt.toGMTString(); } else { exp = ''; } document.cookie = name + '=' + value + exp + '; path=' + path; }; _DA.getCookie = function (name) { var nameEq = name + '='; var arr = document.cookie.split(';'); for (var i = 0; i < arr.length; i++) { var c = arr[i]; while (c.charAt(0) == ' ') { c = c.substring(1, c.length); } if (c.indexOf(nameEq) === 0) { return c.substring(nameEq.length, c.length); } } return null; }; _DA.setBackgroundColor = function (elem, c) { elem.style.backgroundColor = c; } _DA.setBackgroundImage = function (elem, c) { elem.style.backgroundImage = c; } _DA.setFontFamily = function (elem, c) { elem.style.fontFamily = c; } _DA.setFontSize = function (elem, c) { elem.style.fontSize = c; } _DA.setTextAlign = function (elem, c) { elem.style.textAlign = c; } _DA.setBackgroundRepeat = function (elem, c) { elem.style.backgroundRepeat = c; } _DA.setZIndex = function (elem, c) { elem.style.zIndex = c; } _DA.setPosition = function (elem, c) { elem.style.position = c; } _DA.setBackgroundPosition = function (elem, c) { elem.style.backgroundPosition = c; } _DA.setVerticalAlign = function (elem, c) { elem.style.verticalAlign = c; } _DA.setFontWeight = function (elem, c) { elem.style.fontWeight = c; } _DA.setColor = function (elem, c) { elem.style.color = c; } _DA.setPaddingTop = function (elem, c) { elem.style.paddingTop = c; } function DASurveyInvite(askTypeId, loadTypeId, data, questionCount, isDark, isPreview) { // record some bits this.askTypeId = askTypeId; this.loadTypeId = loadTypeId; this.data = data; this.questionCount = questionCount; this.isDark = isDark; this.isPreview = isPreview; // generate the image url (needs something sorting out so it works both relative and on live) this.imageUrl = "https://live.degaa.net/surveyinvite/" + data; // ./surveyinvite/" + data; // store the survey url this.surveyUrl = "https://live.degaa.net/survey/" + data; // pre load the image.. this.image = new Image(); this.image.src = this.imageUrl; // remove list this.toRemove = []; // set the tag name this.tagName = "_degaa_survey_invite"; this.modalTagName = "_degaa_survey_invite_modal"; // remove existing invites this.close(); } DASurveyInvite.prototype.setTrackerId = function (sid) { if (typeof _daTrackers == "undefined" || _daTrackers == null) return; this.sid = sid; // chekc each of the trackers loaded for (var i = 0; i < _daTrackers.length; i++) { // check the site id if (_daTrackers[i].sid == sid) { this.tracker = _daTrackers[i]; // add the uid to the thingy.. this.surveyUrl += "?uid=" + this.tracker.uid + "&meta=" + _DA.getCookie('da-meta-' + this.sid); return; } } } DASurveyInvite.prototype.show = function () { switch (this.askTypeId) { case 1: this.showSlideInvite(); break; case 2: this.showLayerInvite(); break; } } DASurveyInvite.prototype.showSlideInvite = function () { this.createInvite(document.body, this.tagName); this.slide(); } DASurveyInvite.prototype.createInvite = function (parent, tagName) { var self = this; // create / get the layer.. this.layer = _DA.create(tagName, true, parent); _DA.setCss(this.layer, "font-family", "Helvetica, Arial, sans-serif"); _DA.setCss(this.layer, "font-size", "13px"); // add to remove list this.toRemove.push(tagName); var textColor = "#131423"; if (self.isDark == true) textColor = "white"; // set the css _DA.setBackgroundRepeat(this.layer, "no-repeat"); _DA.setBackgroundPosition(this.layer, "0px 0px"); _DA.setBackgroundImage(this.layer, "url('" + this.imageUrl + "')"); _DA.setPosition(this.layer, "fixed"); _DA.setZIndex(this.layer, "5000"); _DA.setTextAlign(this.layer, "left"); _DA.setFontWeight(this.layer, "bold"); _DA.setCss(this.layer, "bottom", "10px"); _DA.setCss(this.layer, "height", "0px"); _DA.setCss(this.layer, "width", "350px"); _DA.setCss(this.layer, "right", "20px"); // hide the layer _DA.setCss(this.layer, "display", "none"); // add the button controls.. this.yesButton = _DA.create("", true, this.layer); _DA.setCss(this.yesButton, "width", "115px"); _DA.setCss(this.yesButton, "height", "28px"); _DA.setCss(this.yesButton, "cursor", "pointer"); _DA.setCss(this.yesButton, "display", "inline-block"); _DA.setTextAlign(this.yesButton, "center"); _DA.setPaddingTop(this.yesButton, "8px"); _DA.setFontSize(this.yesButton, "15px"); _DA.setFontWeight(this.yesButton, "bold"); _DA.setColor(this.yesButton, "#131423"); _DA.setHtml(this.yesButton, this.getYesText()); // set the poisition _DA.setPosition(this.yesButton, "absolute"); _DA.setCss(this.yesButton, "top", "190px"); _DA.setCss(this.yesButton, "left", "45px"); this.yesButton.onclick = function (event) { self.launch(); self.close(true); } // add the button controls.. this.noButton = _DA.create("", true, this.layer); _DA.setPosition(this.noButton, "absolute"); _DA.setCss(this.noButton, "display", "inline-block"); _DA.setCss(this.noButton, "top", "190px"); _DA.setCss(this.noButton, "left", "195px"); _DA.setCss(this.noButton, "width", "115px"); _DA.setCss(this.noButton, "height", "28px"); _DA.setCss(this.noButton, "cursor", "pointer"); _DA.setTextAlign(this.noButton, "center"); _DA.setPaddingTop(this.noButton, "8px"); _DA.setFontSize(this.noButton, "15px"); _DA.setFontWeight(this.noButton, "bold"); _DA.setColor(this.noButton, "#131423"); _DA.setHtml(this.noButton, this.getNoText()); this.noButton.onclick = function (event) { self.close(true); } // add the button controls.. this.closeButton = _DA.create("", true, this.layer); _DA.setPosition(this.closeButton, "absolute"); _DA.setCss(this.closeButton, "display", "inline-block"); _DA.setCss(this.closeButton, "top", "0px"); _DA.setCss(this.closeButton, "right", "0px"); _DA.setCss(this.closeButton, "width", "20px"); _DA.setCss(this.closeButton, "height", "20px"); _DA.setCss(this.closeButton, "cursor", "pointer"); this.closeButton.onclick = function (event) { self.close(true); } // add the button controls.. this.welcomeText = _DA.create("", true, this.layer); _DA.setPosition(this.welcomeText, "absolute"); _DA.setCss(this.welcomeText, "display", "inline-block"); _DA.setCss(this.welcomeText, "top", "103px"); _DA.setCss(this.welcomeText, "left", "25px"); _DA.setCss(this.welcomeText, "width", "120px"); _DA.setCss(this.welcomeText, "height", "20px"); _DA.setFontSize(this.welcomeText, "15px"); _DA.setFontWeight(this.welcomeText, "bold"); _DA.setColor(this.welcomeText, textColor); _DA.setHtml(this.welcomeText, this.getWelcomeText()); // finally add the main text this.inviteText = _DA.create("", true, this.layer); _DA.setPosition(this.inviteText, "absolute"); _DA.setCss(this.inviteText, "display", "inline-block"); _DA.setCss(this.inviteText, "top", "123px"); _DA.setCss(this.inviteText, "left", "25px"); _DA.setCss(this.inviteText, "width", "280px"); _DA.setCss(this.inviteText, "height", "20px"); _DA.setFontSize(this.inviteText, "11px"); _DA.setColor(this.inviteText, textColor); _DA.setFontWeight(this.inviteText, "bold"); _DA.setHtml(this.inviteText, this.getInviteText()); } DASurveyInvite.prototype.launch = function () { // don't do anything in preview mode.. if (this.isPreview == true) return; // tell analytics this user pressed yes.. if (this.tracker != null) this.tracker.setSurveyClickYes(); // load the window as appropriate switch (this.loadTypeId) { case 1: //this.loadIFrameLayer(); break; case 2: this.loadPopupWindow(); break; } } DASurveyInvite.prototype.loadPopupWindow = function () { var left = (screen.width - 600 - 100); var top = (screen.height - 375 - 150); var winHdle = window.open(this.surveyUrl, "degaasurvey", "width=600, height=375, left=" + left + ", top=" + top + ", resizable=no, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no") } DASurveyInvite.prototype.slide = function () { var self = this; var currentHeight = 0; // hide the layer _DA.setCss(this.layer, "display", "block"); // start the animation _DA.timerCallback(this.layer, 5, function (obj) { currentHeight += 5; _DA.setCss(self.layer, "height", currentHeight + "px"); if (currentHeight >= 250) { return false; } return true; }); } DASurveyInvite.prototype.getYesText = function () { return "Yes"; } DASurveyInvite.prototype.getNoText = function () { return "No"; } DASurveyInvite.prototype.getWelcomeText = function () { return "Welcome!"; } DASurveyInvite.prototype.getInviteText = function () { return "Your opinion is important to us. After your visit would you be willing to answer " + this.questionCount + " questions?"; } DASurveyInvite.prototype.showLayerInvite = function () { // create the modal part.. this.modalFrame = _DA.create(this.modalTagName, true, document.body); // add to remove list this.toRemove.push(this.tagName + "_modal"); // get the window size var bounds = _DA.getClientSize(); // create the control this.modalFrame.style.opacity = "0.5"; _DA.setCss(this.modalFrame, "position", "fixed"); _DA.setCss(this.modalFrame, "top", "0px"); _DA.setCss(this.modalFrame, "left", "0px"); _DA.setZIndex(this.modalFrame, "4999"); _DA.setBackgroundColor(this.modalFrame, "black"); _DA.setCss(this.modalFrame, "width", "100%"); _DA.setCss(this.modalFrame, "height", bounds.height + "px"); // create the invite as a child of the modal frame this.createInvite(document.body, this.tagName); // modalize the frame this.modal(); } DASurveyInvite.prototype.modal = function () { var self = this; // set the poisition _DA.setCss(this.layer, "position", "absolute"); _DA.setCss(this.layer, "top", "50%"); _DA.setCss(this.layer, "left", "50%"); _DA.setCss(this.layer, "height", "250px"); this.layer.style.marginLeft = "-161px"; this.layer.style.marginTop = "-122px"; // hide the layer _DA.setCss(this.layer, "display", "block"); var onResize = function () { // get the window size var bounds = _DA.getClientSize(); // update the height _DA.setCss(self.modalFrame, "height", bounds.height + "px"); } // attach events for resize to move scroll if (window.addEventListener) { window.addEventListener("resize", onResize, true); } else if (window.attachEvent) { window.attachEvent("onresize", onResize); } } DASurveyInvite.prototype.close = function (setCookie) { // remove existing invites _DA.remove(this.tagName); _DA.remove(this.modalTagName); // remove teh objects for (var i = 0; i < this.toRemove.length; i++) _DA.remove(this.toRemove[i]); if (setCookie == true) { // set cookie so we are not asked again for the next 30 days _DA.setCookie("da-disable-survey-" + this.sid, "1", { days: 30 }); } } // Analytics tracker var EventType = { PingSession: -1, PageLoad: 1, ExitLinkClick: 2, Referrer: 3, Download: 4, TriggerGoal: 5, Custom: 6, SurveyClickYes: 8 }; // get the js version _daJsVersion = "unknown"; try { document.write('_daJsVersion = "1"'); document.write('_daJsVersion = "1.1"'); document.write('_daJsVersion = "1.2"'); document.write('_daJsVersion = "1.3"'); document.write('_daJsVersion = "1.4"'); document.write('_daJsVersion = "1.5"'); document.write('_daJsVersion = "1.6"'); document.write('_daJsVersion = "1.7"'); document.write('_daJsVersion = "1.8"'); document.write('_daJsVersion = "1.9"'); document.write('_daJsVersion = "2.0"'); } catch (e) { } var _daTrackers = []; var _userLastActive = new Date(); var _pingCount = 0; var _pingInc = 0; function _DAClearPolls(poll) { _daPolls = []; } function _DACheckPing() { // itereate the current objects and ping all of them // _pingInc++; var sendPing = false; // first ping sent after 2 seconds to check for sureys if (_pingCount == 0 && _pingInc >= 2) sendPing = true; if (_pingInc >= 10) sendPing = true; // send the ping if (sendPing) { for (var index = 0; index < _daTrackers.length; index++) { _daTrackers[index].pingSession(); } // inc the sent ping count _pingCount++; _pingInc = 0; } // set the timer again // setTimeout("_DACheckPing()", 1000); } // start the ping code.. // _DACheckPing(); function DATracker() { this.init = function (sid) { // add to the list.. _daTrackers.push(this); // globals this.doc = document; this.img = null; this.url = 'https://live.degaa.net/gather?sid=' + sid + "&"; this.uid = 'fb60817a-8c45-4303-80a5-ce31f367b2a2'; this.sid = sid; this.uiCookie = "da-ui-" + this.sid; // current ping count this.pingCount = 0; // last active time and idle time this.idleTime = 0; this.lastActive = new Date(); // 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; // load / save visitor id (if no cookies then send blank) if (this.cookies == 1) { if (this.getCookie(this.uiCookie) != null) this.uid = this.getCookie(this.uiCookie); else this.setCookie(this.uiCookie, 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); // add the event listeners if (document.addEventListener) { document.addEventListener("mousedown", this.clicked, false); document.addEventListener("mousemove", this.moved, false); document.addEventListener("keydown", this.typed, false); } else { document.attachEvent("onmousedown", this.clicked); document.attachEvent("onmousemove", this.moved); document.attachEvent("onkeydown", this.typed); } } // event handlers for user input this.clicked = function () { _userLastActive = new Date(); } this.moved = function () { _userLastActive = new Date(); } this.typed = function () { _userLastActive = new Date(); } this.setCookie = function (name, value, expiredays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + expiredays); if (expiredays != -1) document.cookie = name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()) + ";path=/"; else document.cookie = name + "=" + escape(value) + ";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.trackPageView = function (page, title) { var params = []; // pass the page? if (page != null && page.length > 0) { params.push({ Name: "la", Value: escape(page) }); } if (title != null && title.length > 0) { params.push({ Name: "ti2", Value: escape(title) }); } this.sendRequest(this.getGatherUrl(EventType.PageLoad, params)); } // 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("DATracker._logDownload('" + path + "');", 100); setTimeout(function (thisObj) { thisObj._logDownload(path); }, 100, this); } // send the request to the server in the form of an image this._logDownload = function (path) { var url = this.getGatherUrl(EventType.Download, [ { Name: "la", Value: escape(path) } ]); this.sendRequest(url); } this.trackEvent = function (eventCategory, eventName) { var url = this.getGatherUrl(EventType.Custom, [ { Name: "ce1", Value: eventCategory }, { Name: "ce2", Value: eventName } ]); this.sendRequest(url); } this.triggerGoal = function (goalCode, goalValue) { var url = this.getGatherUrl(EventType.TriggerGoal, [ { Name: "gv", Value: Number(goalValue) }, { Name: "gc", Value: goalCode } ]); this.sendRequest(url); } this.pingSession = function () { // calculate the idle time var idleTime = (new Date()) - _userLastActive; // make sure we have not been idle for too long var timeout = 5 * 60 * 1000; // don't send any more pings if the user has not done anythign for 5 mins if (idleTime >= timeout) return; // record the idle time with the server (in seconds) this.idleTime = idleTime / 1000; // send the request to the server this.sendRequest(this.getGatherUrl(EventType.PingSession, [ { Name: "pc", Value: this.pingCount++ } ])); } this.setSurveyClickYes = function () { // send the request to the server this.sendRequest(this.getGatherUrl(EventType.SurveyClickYes, null)); } this.sendRequest = function (url) { // create the script element var script = document.createElement('script'); // setup the params script.type = 'text/javascript'; script.src = url; // make the call.. var msc = document.getElementsByTagName('script')[0]; msc.parentNode.insertBefore(script, msc); } 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('da-blob', 'a34jfk213', 1); if (this.getCookie('da-blob') != 'a34jfk213') cookieEnabled = false; } catch (e) { cookieEnabled = false; } return cookieEnabled; } this.onUnload = function (e) { for (var index = 0; index < _daTrackers.length; index++) { _daTrackers[index].pingSession(); } } 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; // don't trigger for anchors 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|doc|eps|jpg|png|svg|xls|ppt|pdf|xls|zip|txt|vsd|vxd|js|css|rar|exe|wma|mov|avi|wmv|mp3)$/i); if (fileTypes.test(evnt.href)) { var lastTracker = null; // track the event with all active trackers for (var index = 0; index < _daTrackers.length; index++) { _daTrackers[index]._logDownload(evnt.href); lastTracker = _daTrackers[index]; } // let the request do its thing if (lastTracker != null) lastTracker.pause(250); return; } domain_index = evnt.href.indexOf(document.domain); if ((domain_index < 9 && domain_index != -1) || evnt.href.indexOf("/") == 1) return; var lastTracker = null; // track the event with all active trackers for (var index = 0; index < _daTrackers.length; index++) { // generate the url var requestUrl = _daTrackers[index].getGatherUrl(EventType.ExitLinkClick, [ { Name: "la", Value: escape(evnt.href) } ]); // enqueue the request _daTrackers[index].sendRequest(requestUrl); // record the last tracker lastTracker = _daTrackers[index]; } if (lastTracker != null) lastTracker.pause(500); } this.getGatherUrl = function (event_type, extra) { var meta = this.getCookie('da-meta-' + this.sid); var disableCookies = this.getCookie("da-disable-survey-" + this.sid); fullUrl = 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=' + _daJsVersion + '&ca=' + this.cookies + '&it=' + this.idleTime + '&ds=' + disableCookies + '&meta=' + meta; // add the extra if (extra != null) { for (var extraIndex = 0; extraIndex < extra.length; extraIndex++) { fullUrl += '&' + extra[extraIndex].Name + '=' + extra[extraIndex].Value; } } // add the random fullUrl += '&v=' + Math.random(); return fullUrl; } } ///////////////////////////////////////////////////////////////////////////////////////////////// // 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(); try { var tracker = new DATracker(); tracker.init(SATracker.sid); tracker.trackPageView(); } catch (err) { // // create the script element // var script = document.createElement('script'); // // setup the params // script.type = 'text/javascript'; // script.src = "https://www.degaa.net/scripterror2?" + err; // // make the call.. // var msc = document.getElementsByTagName('script')[0]; // msc.parentNode.insertBefore(script, msc); } // log the visit SATracker.logVisit(); //////////////////////////////////////////////////////////////////////////////////////////////////