﻿
var initialized=initialized ? initialized : false;
MS.Support.MSS.Logging=function(){var mssUtils=MS.Support.MSS.Utils;var imgLoaded=false;encodeURL=function(strInput){if(typeof(strInput)=='undefined'){return "";}strInput=strInput.toString();var c;var EncodeUrl='';for(var cnt=0;cnt<strInput.length;cnt++){c=strInput.charCodeAt(cnt);if(((c>96)&&(c<123))||((c>64)&&(c<91))||((c>47)&&(c<58))||(c==46)||(c==45)||(c==95)){EncodeUrl=EncodeUrl+String.fromCharCode(c);}else if(c>127){EncodeUrl=EncodeUrl+'%u'+encodeTwoByteHex(c);}else{EncodeUrl=EncodeUrl+'%'+encodeSingleByteHex(c);}}return EncodeUrl;};encodeSingleByteHex=function(charC){var SingleByteHex=charC.toString(16);for(var cnt=SingleByteHex.length;cnt<2;cnt++){SingleByteHex="0"+SingleByteHex;}return SingleByteHex;};encodeTwoByteHex=function(charC){var TwoByteHex=charC.toString(16);for(var cnt=TwoByteHex.length;cnt<4;cnt++){TwoByteHex="0"+TwoByteHex;}return TwoByteHex;};getCookieIncrement=function(){var cookieKey='sdninc';var inc=mssUtils.getCookie(cookieKey);if(inc==''){inc='0';}inc=parseInt(inc);inc+=1;document.cookie=cookieKey+'='+inc+'; path=/;';return inc;};cleanId=function(str){try{return str.replace(DataCollectionObj.options.reCleanId,'');}catch(e){}return '';};
 isLogBitSet=function(number,flagbit){if(number==0||flagbit==0)return false;var binary=number.toString(2);if(binary.length>flagbit){if(binary.charAt(binary.length - flagbit - 1)=="1")return true;}return false;};setLogCollectionBit=function(collection,bit){if(!isLogBitSet(collection,bit)){collection+=Math.pow(2,bit);}return collection;};logPageOnLoad=function(){var dataCollImg=document.getElementById(DataCollectionObj.options.dataCollectionImg);if(!dataCollImg){return;}
 if(document.getElementById("acwkblink")){DataCollectionObj.options.OptionCollectionId=setLogCollectionBit(DataCollectionObj.options.OptionCollectionId,32);}DataCollectionObj.options.eventSeqNo=getCookieIncrement();

 var currentOpts=DataCollectionObj.options;var ltsUrl=window.location.protocol+'//'+currentOpts.host+'?';if(currentOpts.sessionId!=''){ltsUrl+='SessionID='+encodeURL(currentOpts.sessionId)+'&';}ltsUrl+='SSID='+encodeURL(currentOpts.ssId)+'&'+'EventCollectionID='+encodeURL(currentOpts.eventCollectionId)+'&'+'URL='+encodeURL(currentOpts.url)+'&'+'ContentType='+encodeURL(currentOpts.contentType)+'&'+'ContentLCID='+encodeURL(currentOpts.contentLn)+'&'+'ContentID='+encodeURL(currentOpts.contentId)+'&'+'BrandID='+encodeURL(currentOpts.siteBrandId)+'&'+'RefURL='+encodeURL(currentOpts.refUrl)+'&'+'OptionCollectionId='+encodeURL(currentOpts.OptionCollectionId)+'&'+'EventSeqNo='+encodeURL(currentOpts.eventSeqNo)+'&'+'SSversion='+encodeURL(currentOpts.SsVersion)+'&'+'ContentCulture='+encodeURL(currentOpts.ContentCulture)+'&'+'ContentProperties='+encodeURL(currentOpts.ContentProperties);mssUtils.AddEvent(dataCollImg,"load",function(){imgLoaded=true;});dataCollImg.src=ltsUrl;};logPageOnUnLoad=function(){var dataCollImg=document.getElementById(DataCollectionObj.options.dataCollectionImg);if(!dataCollImg)return;if(!imgLoaded)
 return;DataCollectionObj.options.dwellTime=new Date().getTime()- DataCollectionObj.options.startDate.getTime();if(DataCollectionObj.options.scrollUsed){DataCollectionObj.options.eventCollectionId=setLogCollectionBit(DataCollectionObj.options.eventCollectionId,27);}if(DataCollectionObj.options.eventSeqNo=='0')options.eventSeqNo=getCookieIncrement();mssUtils.setCookie("exitinfo",DataCollectionObj.options.contentType+"|"+DataCollectionObj.options.contentLn+"|"+DataCollectionObj.options.contentId+"|"+DataCollectionObj.options.ContentCulture+"|"+DataCollectionObj.options.exitContainerId+"|"+DataCollectionObj.options.exitLinkId,null,true);var currentOpts=DataCollectionObj.options;var ltsUrl=window.location.protocol+'//'+currentOpts.host+'?';if(currentOpts.sessionId!='')
 ltsUrl+='SessionID='+encodeURL(currentOpts.sessionId)+'&';ltsUrl+='SSID='+encodeURL(currentOpts.ssId)+'&'+'EventCollectionID='+encodeURL(currentOpts.eventCollectionId)+'&'+'OptionCollectionId='+encodeURL(currentOpts.OptionCollectionId)+'&'+'SSversion='+encodeURL(currentOpts.SsVersion)+'&'+'ContentType='+encodeURL(currentOpts.contentType)+'&'+'ContentLCID='+encodeURL(currentOpts.contentLn)+'&'+'ContentID='+encodeURL(currentOpts.contentId)+'&'+'ExitLinkID='+cleanId(currentOpts.exitLinkId)+'&'+'ExitContainerID='+cleanId(currentOpts.exitContainerId)+'&'+'DwellTime='+encodeURL(currentOpts.dwellTime)+'&'+'BrandID='+encodeURL(currentOpts.siteBrandId)+'&'+'TargetURL='+encodeURL(currentOpts.targetUrl)+'&'+'EventSeqNo='+encodeURL(currentOpts.eventSeqNo)+'&'+'ContentCulture='+encodeURL(currentOpts.ContentCulture)+'&'+'unload=true';if(window.exitTabValue)ltsUrl+="&ContentProperties="+encodeURL(exitTabID+"="+exitTabValue+"|");dataCollImg.src=ltsUrl;var today=new Date();var now=today.getTime();while(1){var today2=new Date();var now2=today2.getTime();if((now2 - now)>currentOpts.onUnloadTimeout)
 return;}};setExitLinks=function(e){var El=mssUtils.SrcEl(e);var elId=null;var parentId=null;if(!El){return;}if(!El.tagName){return;}if(El.tagName.toUpperCase()!='A'){if(El.parentNode&&El.parentNode.tagName&&El.parentNode.tagName.toUpperCase()=='A'){El=El.parentNode;}else{return;}}if(!El.href){return;}if(El.href.indexOf('javascript:')>-1){return;}if(El.href.indexOf('mailto:')>-1){return;}if(El.id){this.exitLinkId=El.id;}else{this.exitLinkId='';this.exitContainerId='';}DataCollectionObj.options.targetUrl=El.href;};scrollHandler=function(){DataCollectionObj.options.scrollUsed=true;mssUtils.RemoveEvent(window,"scroll",scrollHandler);};loggingOptions=function(logObject){this.startDate=new Date();this.disabled=true;this.dataCollectionImg='';this.host='/LTS/';this.scrollUsed=false;this.reCleanId = /[^0-9]*/i;this.eventCollectionId=0;this.OptionCollectionId=0;this.ContentProperties='';this.url=document.location&&document.location!='' ? document.location.toString(): '';this.contentType='';this.contentLn='';this.contentId='';this.ContentCulture='';this.exitContainerId='';this.exitLinkId='';this.siteBrandId='';this.refUrl=document.referrer&&document.referrer!='' ? document.referrer.toString(): '';this.eventSeqNo=0;this.targetUrl='';this.sessionId='';};this.options=null;this.Initialize=function(){if(initialized==true){return;}initialized=true;this.options=new loggingOptions();

 mssUtils.AddEvent(document.getElementById("kb_default"),"click",function(e){try{setExitLinks(e);}catch(err){}});mssUtils.AddEvent(window,"load",function(){try{logPageOnLoad();}catch(err){}});mssUtils.AddEvent(window,"unload",function(){try{logPageOnUnLoad();}catch(err){}});mssUtils.AddEvent(window,"scroll",scrollHandler);};};var DataCollectionObj=DataCollectionObj ? DataCollectionObj : new MS.Support.MSS.Logging();