function piwikTracking1(){this.envRootUrlMap={DEV:"https://dev.citivelocity.com",QA:"https://qa.citivelocity.com",UAT:"https://uat.citivelocity.com",PROD:"https://www.citivelocity.com"};this.execQueue=window.piwikTrackingQueue;this.idSite=null;this.urlInInit=null;this.piwikTracker=null;this.urlOrLink=null;this.trackingJsonData=null;this.customVariableArray=null;this.DEFAULT_ROOTURL="https://dev.citivelocity.com";this.piwikVersion="3"}piwikTracking1.prototype.init=function(a,b,d,c){this.idSite=a;if(d){this.piwikVersion=d}this.urlInInit=this.getRequestUrl(b);if(Piwik){if(this.idSite){this.piwikTracker=Piwik.getTracker(this.urlInInit,this.idSite)}}if(this.piwikTracker&&this.urlInInit.indexOf(location.protocol+"//"+location.hostname+(location.port?":"+location.port:""))!=-1){this.piwikTracker.setRequestMethod("POST")}if(this.piwikTracker&&c){this.piwikTracker.disableQueueRequest()}};piwikTracking1.prototype.trackData=function(o,p){try{var d=p.trackingData;this.trackingJsonData=p;if(d){var r=d.idSite;if(!r){r=this.getSiteID();if(!r){this.getSiteIDFromBack(function(e){if(e){var i=JSON.parse(e);this.trackingJsonData.trackingData.idSite=i.SiteID;this.trackingJsonData.trackingData.loginId=i.LoginName;this.trackData(o,this.trackingJsonData)}else{this.trackingJsonData.trackingData.idSite="200";this.trackData(o,this.trackingJsonData)}});return}}this.urlOrLink=d.url||window.location.href;var k=d.url_ref;var t=d.loginId;var g=d.forcedLoginId;var j=d.documentTitle;var a=d.menuNavigationPath;if(!this.piwikTracker){if(!this.urlInInit){this.urlInInit=this.getRequestUrl(null)}if(Piwik){if(r){this.piwikTracker=Piwik.getTracker(this.urlInInit,r)}}if(this.piwikTracker&&this.urlInInit.indexOf(location.protocol+"//"+location.hostname+(location.port?":"+location.port:""))!=-1){this.piwikTracker.setRequestMethod("POST")}}if(r){this.piwikTracker.setSiteId(r)}if(this.urlOrLink){this.piwikTracker.setCustomUrl(this.urlOrLink)}if(k){this.piwikTracker.setReferrerUrl(k)}if(t&&g){this.piwikTracker.setCustomData({loginId:t,forcedLoginId:g});this.piwikTracker.setUserId(t)}else{if(t&&!g){this.piwikTracker.setCustomData({loginId:t});this.piwikTracker.setUserId(t)}else{if(!t&&g){this.piwikTracker.setCustomData({forcedLoginId:g});this.piwikTracker.setUserId(g)}}}if(j){this.piwikTracker.setDocumentTitle(j)}else{if(a){this.piwikTracker.setDocumentTitle(a)}else{this.piwikTracker.setDocumentTitle("unknown")}}}this.customVariableArray=p.customVariable;this.customVariableArraySize=this.customVariableArray.length;if(this.customVariableArray){for(var q=0;q0){var a=this.execQueue.shift();if(a){this.trackData.apply(this,a)}}}};piwikTracking1.prototype.getSiteIDFromFront=function(b,c,g,a){var f="0";try{if("SfsExternal"==b){switch(c){case"QA":f="36";break;case"UAT":f="36";break;case"PROD":f="36";break;default:f="1";break}return f}if(a=="intranet"||a=="ICG"){switch(c){case"QA":f="2";break;case"UAT":f="3";break;case"PROD":f="4";break;default:f="1";break}return f}else{if(b=="Internal"){switch(c){case"QA":f="7";break;case"UAT":f="9";break;case"PROD":f="11";break;default:f="5";break}}else{switch(c){case"QA":f=!g?"8":"15";break;case"UAT":f=!g?"10":"14";break;case"PROD":f=!g?"12":"14";break;default:f=!g?"6":"14";break}}}return f}catch(d){return null}};piwikTracking1.prototype.getSiteIDFromBack=function(d){var a="./getSiteID";var b=this.createXmlHttpRequest();var c=function(){if(b.readyState==4&&b.status==200){var e=b.responseText;d(e)}};b.onreadystatechange=c;b.open("post",a,true);b.send(null)};piwikTracking1.prototype.createXmlHttpRequest=function(){if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}else{if(window.XMLHttpRequest){return new XMLHttpRequest()}}};new piwikTracking1().cleanCachedQueue();(function(){var a=window.CVChatTrackerObject;var b=window[a].q;window[a]=function(){if(arguments&&typeof arguments[0]=="function"){arguments[0]();return}if(arguments&&arguments.length>=3&&arguments[0]=="create"){var i=arguments[1];var j=new piwikTracking1();arguments[2].piwikTracking=j;if(j){j.init(i.siteId,i.env,"1",i.disableBulk)}return}if(arguments&&arguments.length>=3&&arguments[0]=="pageview"||arguments&&arguments.length>=2&&arguments[0]=="event"){var h=arguments[1];var j=arguments[2].piwikTracking;if(!j){return}var g={APPLICATION:j.APPLICATION,DEVICE_TYPE:j.DEVICE_TYPE,ENV:j.ENV,PORTAL:j.PORTAL,SOURCE:j.SOURCE};if(j.ZONE){g.ZONE=j.ZONE}if(j.USER_TYPE){g.USER_TYPE=j.USER_TYPE}if(j.REQUEST_ID){g.REQUEST_ID=j.REQUEST_ID}if(j.PAGE_TITLE){g.PAGE_TITLE=j.PAGE_TITLE}if(j.PAGE_URL){g.PAGE_URL=j.PAGE_URL}for(var f in h){if(h[f]&&f!="trackingSource"&&f!="portletName"&&f!="portletCode"&&f!="menuCode"&&f!="eventCategory"&&f!="eventAction"&&f!="eventLabel"&&f!="eventValue"&&f!="menuNavigationPath"){g[f]=h[f]}}var d={idSite:j.idSite,menuNavigationPath:h.menuNavigationPath||j.menuNavigationPath||"",loginId:j.loginId};if(j.PAGE_URL){d.url=j.PAGE_URL}else{if(h.PAGE_URL){d.url=h.PAGE_URL}}var e=[];if(g){e.push({properties:JSON.stringify(g)})}else{e.push(null)}if(h.trackingSource||j.trackingSource){e.push({trackingSource:h.trackingSource})}else{e.push(null)}if(h.menuCode||j.menuCode){e.push({menuCode:h.menuCode||j.menuCode})}else{e.push(null)}if(h.tabName||j.tabName){if(arguments[0]=="event"){e.push({tabName:h.tabName||j.tabName})}if(h.trackingSource=="16"||j.trackingSource=="16"){e.push({tabName:h.tabName||j.tabName})}}else{e.push(null)}if(h.portletCode||j.portletCode){e.push({portletCode:h.portletCode||j.portletCode})}else{e.push(null)}if(h.portletName||j.portletName){e.push({portletName:h.portletName||j.portletName})}else{e.push(null)}if(h.contentId||j.contentId){e.push({contentId:h.contentId||j.contentId})}else{e.push(null)}if(h.contentSourceId||j.contentSourceId){e.push({contentSourceId:h.contentSourceId||j.contentSourceId})}else{e.push(null)}if(arguments&&arguments.length>=2&&arguments[0]=="event"){if(h.eventCategory){d.eventCategory=h.eventCategory.substring(0,200)}if(h.eventAction){d.eventAction=h.eventAction.substring(0,200)}if(h.eventLabel){d.eventLabel=h.eventLabel.substring(0,200)}d.eventValue=h.eventValue;j.trackData(2,{trackingData:d,customVariable:e})}else{j.trackData(0,{trackingData:d,customVariable:e})}return}if(arguments&&arguments.length>=3&&arguments[0]=="set"){var h=arguments[1];var j=arguments[2].piwikTracking;if(!j){return}for(var f in h){if(h[f]!==undefined){j[f]=h[f]}}j.tabName=h.tabName;return}};for(var c in b){window[a].apply(this,b[c])}})();