if(typeof pstr=="undefined"||!pstr){var pstr={};pstr.psid='ec5d0d42-2fdc-11e5-95f6-12313916f4be';pstr.useguid='1';pstr.pswecdom='.pswec.com';pstr.client_id='5ef9c85569';pstr.ckdomain='compasonline.com';pstr.wecsubdom='t';pstr.clientax='gg';pstr.test='XX_TEST_XX';pstr.cookie_name='psrw';pstr.emailRegex=/[\w!#$%&'*+\/=\?^_`{|}~-]+(?:\.[\w!#$%&'*+\/=\?^_`{|}~-]+)*@(?:(?:[\w-]*\w)?\.)+(?:com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum|[a-z]{2})/i;pstr.naturalKeyName="nkid";pstr.events_off='XX_WEC_EVENTS_OFF_XX';pstr.auto_browse='XX_AUTO_BROWSE_XX';pstr.ifsend_only='XX_IFRAME_ONLY_XX';pstr.ckidparam='__'+pstr.cookie_name;pstr.jsidparam='__psrj';pstr.cidparam='__psc';pstr.eparam='e';pstr.__p_ver="3.0";pstr.__p_show_log=false;pstr.head=document.getElementsByTagName('head').item(0);pstr.debug='';pstr.psessid=(function(){return(new Date()).getTime()+'.'+(''+Math.random()).substring(2)})();if(pstr.useguid.indexOf('XX_')!=-1)pstr.useguid=true;if(pstr.wecsubdom.indexOf('XX_')!=-1)pstr.wecsubdom='wecqa';if(pstr.pswecdom.indexOf('XX_')!=-1)pstr.pswecdom='pswec.com';if(pstr.clientax.indexOf('XX_')!=-1)pstr.clientax='';if(pstr.test.indexOf('XX_')!=-1)pstr.test='0';if(pstr.debug.indexOf('XX_')!=-1||pstr.debug=='')pstr.debug=false;pstr.auto_browse=(pstr.auto_browse.indexOf('XX_')==-1&&pstr.auto_browse=='1')?true:false;pstr.events_off=(pstr.events_off.indexOf('XX_')==-1&&pstr.events_off=='1')?true:false;pstr.ifsend_only=(pstr.ifsend_only.indexOf('XX_')==-1&&pstr.ifsend_only=='1')?true:false}if(typeof pstr.util=="undefined"||!pstr.util){pstr.util={img:new Image(1,1),srcId:(function(h){return function(){++h;return'ps_scr_'+h+'_'+(''+Math.random()).substring(2,10)}})(0),__p_log:"",__p_lvl:2,log:function(n,q){var h=['D','I','W','E'];q=(arguments.length!=2)?0:q;if(q>=pstr.util.__p_lvl){pstr.util.__p_log+=pstr.util.prclv_dt()+'['+h[q]+']: '+n+((pstr.util.isIE())?'</br>':'\n');pstr.util.__refreshLog()}},d:function(h){pstr.util.log(h,0)},i:function(h){pstr.util.log(h,1)},w:function(h){pstr.util.log(h,2)},e:function(h){pstr.util.log(h,3)},showLog:function(h){if(arguments.length==0)return pstr.__p_show_log;pstr.__p_show_log=h},__refreshLog:function(){if(pstr.__p_show_log==false){return}if(document&&document.body){var h=document.getElementById('__ps_log_area');if(h==null){document.body.innerHTML+='\n\n\n<br/><br/>';document.body.innerHTML+='<table border="1"><tr><td> <pre id="__ps_log_area"> Log Area: </pre> </td></tr></table>';h=document.getElementById('__ps_log_area')}h.innerHTML=pstr.util.__p_log}},url:function(q,a,n,t,h){a=(a)?a.replace(/\.+$/,''):a;n=n.replace(/^\.+/,'');return q+'://'+((a)?a+'.':'')+n+'/'+t+'?'+h},rpc:function(q){var h=document.createElement('script');h.id=pstr.util.srcId();h.type='text/javascript';h.defer=false;h.src=q;void(pstr.head.appendChild(h));pstr.util.log('rpc() sending '+h.id+' to  :  '+h.src);return h.id},removeScript:function(h){var q=document.getElementById(h);if(q)pstr.head.removeChild(q)},isSafariRe:new RegExp('Safari/\\d{1,3}\.\\d{1,3}'),isChromeRe:new RegExp('Chrome/\\d{1,3}\.\\d{1,3}'),isAndroidRe:new RegExp('Android/\\d{1,3}\.\\d{1,3}'),isIERe:new RegExp('MSIE'),isSafari:function(){var h=navigator.userAgent;if(h.match(pstr.util.isSafariRe)){if(!h.match(pstr.util.isChromeRe)&&!h.match(pstr.util.isAndroidRe))return true;else return false}else{return false}},isIE:function(){return(navigator.userAgent.match(pstr.util.isIERe))?true:false},getIf:function(){var h=document.createElement('iframe');h.width=0;h.height=0;h.frameborder=0;h.hidden=true;return h},imgSend:function(h){var n=new Image(1,1);var q=pstr.util.srcId();n.id=q;n.onload=function(){pstr.util.d('removing image w/ id : '+q+'. URL='+h);delete n};n.src=h},iframeSend:function(q){if(pstr.ifsend_only||pstr.util.isSafari()){var h=pstr.util.getIf();var a=pstr.util.srcId();h.name=a;h.id=a;h.src=q;var n=(document.body==null)?true:false;var t=function(){pstr.util.d('iFrame cleaning up with id/name : '+a+' ...');if(n){void(pstr.head.removeChild(h))}else{void(document.body.removeChild(h))}delete h;pstr.util.d('... done removing iFrame with id/name : '+a)};if(h.attachEvent&&pstr.util.isIE()){h.attachEvent("onload",t)}else{h.onload=t}if(n){pstr.util.d('appeneding to head : '+a+". URL: "+q);void(pstr.head.appendChild(h))}else{pstr.util.d('appeneding to body : '+a+". URL: "+q);void(document.body.appendChild(h))}}else{pstr.util.imgSend(q)}},oldIframeSend:function(q){if(pstr.ifsend_only||pstr.util.isSafari()){var h=pstr.util.getIf();var t=pstr.util.srcId();h.name=t;var a=document.createElement('form');a.action=q;a.method='POST';a.target=t;var n=false;if(document.body==null){void(pstr.head.appendChild(a));void(pstr.head.appendChild(h));n=true}else{void(document.body.appendChild(a));void(document.body.appendChild(h))}if(a.submit()){if(n){void(document.head.removeChild(h));void(document.head.removeChild(a))}else{void(document.body.removeChild(h));void(document.body.removeChild(a))}}}else{pstr.util.imgSend(q)}},getParams:function(){var h={},qs="",qq=window.location.href.split('?');if(qq.length==2){qs=qq[1]}if(qs==""){return h}var n=qs.split('&');for(var a=0,len=n.length;a<len;a++){var q=n[a].split('=');h[q[0]]=q[1]}return h},getCookies:function(){var h=document.cookie.split(';'),ch={},re=/\s*(.+)\s*\=\s*(.+)\s*/;for(var n=0;n<h.length;n++){var q=h[n].match(re);if(q&&q[1].indexOf('__utm')<0){ch[q[1]]=q[2]}}return ch},cookieExpireDays:365*2,setCookie:function(n,t,q,h){var s=new Date();if(!h){h=this.cookieExpireDays}s.setDate(s.getDate()+h);if(!q){q=pstr.ckdomain}if(!q||document.location.hostname.indexOf(q)==-1){q=document.location.hostname}var a=n+"="+escape(t);a+="; path=/";a+=((q==null)?"":"; domain="+q);a+=((h==null)?"":"; expires="+s.toGMTString());this.log(a);document.cookie=a},inarr:function(h,n){for(var q=0,l=n.length;q<l;q++){if(h===n[q]){return true}}return false},getPageAndRef:function(){var h=document.location.href,ref=document.referrer;if(h.indexOf('://')==-1){h=''}if(ref.indexOf('://')==-1){ref=''}return{'page':h,'ref':ref}},checksum:function(h){if(!h||h=="")return-1;var n=0;for(var q=0;q<h.length;q++){n+=h.charCodeAt(q)}return n},trim:function(h){if(h&&typeof h=='string'){return(typeof h.trim=='function')?h.trim():h.replace(/^\s*/,"").replace(/\s*$/,"")}else return h},_Sk:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",rev:function(h){if(!h||h=="")return"";h=""+h;var q,b,c,d="",_1,_2,_3,_4,i=0;(function(){_1=q,_2=b,_3=c,_4=d})();do{q=h.charCodeAt(i++);b=h.charCodeAt(i++);c=h.charCodeAt(i++);_1=q>>2;_2=((q&3)<<4)|(b>>4);_3=((b&15)<<2)|(c>>6);_4=c&63;if(isNaN(b)){_3=_4='@'.charCodeAt(0)}else if(isNaN(c)){_4='@'.charCodeAt(0)}d=d+this._Sk.charAt(_1)+this._Sk.charAt(_2)+this._Sk.charAt(_3)+this._Sk.charAt(_4)}while(i<h.length);return d},padZero:function(h){if(h<10)return"0"+h;return h},prclv_dt:function(h){if(h==null)h=new Date();var q=''+h.getFullYear()+'-'+this.padZero(h.getMonth()+1)+'-'+this.padZero(h.getDate());q+=' '+h.getHours()+':'+this.padZero(h.getMinutes())+':'+this.padZero(h.getSeconds());return q},isDate:function(h){return(h instanceof Date)},isArray:function(h){return(h instanceof Array)},isEmail:function(h){if(h){return pstr.emailRegex.test(pstr.util.trim(h.toLowerCase()))}return false},isEmpty:function(h){return(h==null)?true:(pstr.util.trim(h)=="")?true:false},isOffline:function(){if(pstr.util.trim(document.location.href.toLowerCase()).indexOf("file")==0){return true}return false},aflatten:function aflatten(h){var a=[];if(pstr.util.isArray(h)){for(var n=0,l=h.length;n<l;n++){var q=Object.prototype.toString.call(h[n]).split(' ').pop().split(']').shift().toLowerCase();if(q){a=a.concat(/^(array|collection|arguments|object)$/.test(q)?aflatten(h[n]):h[n])}}}else{a.push(h)}return a},maskPiiEmail:function(h){if(!pstr.emailRegex.test(h)){return h}var r=null;var a=h.split('?');if(a){r=a[0]}else{return h}var u=h.match(/\?.*$/);if((!u)||(u.length!=1)){console.log("WARNING! Malformed URL ["+h+"]");return h}else{query=u[0]}var s=query.split('&');for(ind=0,len=s.length;ind<len;ind++){if(ind>0){r+='&'}var p=s[ind].indexOf("=");if((p>0)&&(s[ind].length>p)){var t=s[ind].substr(0,p);var n=s[ind].substr(p+1,s[ind].length);var q=n.match(pstr.emailRegex);if(q){r+=t+'=';r+=pstr.util.md5.hex_md5(q[0].toLowerCase())}else{r+=s[ind]}}else{r+=s[ind]}}return r},hpii:function(h){var o=h.split('&');var m='';for(var k=0,len=o.length;k<len;k++){var s=o[k];var u=s.split('=');var r=u[0];if(pstr.util.isPii(r)){m+=r+'=';var q=o[k].split('=');var p=decodeURIComponent(q[1]);var a=p.split(';');var n='';for(var t=0,len_v_varr=a.length;t<len_v_varr;t++){if(r=="email"){if(pstr.util.isEmail(a[t])){n+=pstr.util.md5.hex_md5(pstr.util.trim(a[t].toLowerCase()));m+=encodeURIComponent(n);m+='&sha1=';n=pstr.util.sha1.encrypt(pstr.util.trim(a[t].toLowerCase()))}else{n+=a[t]}}else{n+=pstr.util.md5.hex_md5(a[t])}if(t!=(len_v_varr-1)){n+=';'}}m+=encodeURIComponent(n)}else{m+=o[k]}if(k!=(o.length-1)){m+='&'}}return m},isPii:function(h){h=pstr.util.trim(h).toLowerCase();var n=['email','npi_id'];for(var q=0,len=n.length;q<len;q++){if(h==n[q]){return true}}return false}};pstr.util.md5={hexcase:0,hex_md5:function(h){return this.rstr2hex(this.rstr_md5(this.str2rstr_utf8(h)))},hex_hmac_md5:function(h,q){return this.rstr2hex(this.rstr_hmac_md5(this.str2rstr_utf8(h),this.str2rstr_utf8(q)))},md5_vm_test:function(){return this.hex_md5("abc").toLowerCase()=="900150983cd24fb0d6963f7d28e17f72"},rstr_md5:function(h){return this.binl2rstr(this.binl_md5(this.rstr2binl(h),h.length*8))},rstr_hmac_md5:function(q,s){var h=this.rstr2binl(q);if(h.length>16){h=this.binl_md5(h,q.length*8)}var n=Array(16),d=Array(16);for(var t=0;t<16;t++){n[t]=h[t]^909522486;d[t]=h[t]^1549556828}var a=this.binl_md5(n.concat(this.rstr2binl(s)),512+s.length*8);return this.binl2rstr(this.binl_md5(d.concat(a),512+128))},rstr2hex:function(h){try{pstr.util.md5.hexcase}catch(g){pstr.util.md5.hexcase=0}var t=pstr.util.md5.hexcase?"0123456789ABCDEF":"0123456789abcdef";var n="";var q;for(var a=0;a<h.length;a++){q=h.charCodeAt(a);n+=t.charAt((q>>>4)&15)+t.charAt(q&15)}return n},str2rstr_utf8:function(n){var a="";var q=-1;var h,e;while(++q<n.length){h=n.charCodeAt(q);e=q+1<n.length?n.charCodeAt(q+1):0;if(55296<=h&&h<=56319&&56320<=e&&e<=57343){h=65536+((h&1023)<<10)+(e&1023);q++}if(h<=127){a+=String.fromCharCode(h)}else{if(h<=2047){a+=String.fromCharCode(192|((h>>>6)&31),128|(h&63))}else{if(h<=65535){a+=String.fromCharCode(224|((h>>>12)&15),128|((h>>>6)&63),128|(h&63))}else{if(h<=2097151){a+=String.fromCharCode(240|((h>>>18)&7),128|((h>>>12)&63),128|((h>>>6)&63),128|(h&63))}}}}}return a},rstr2binl:function(n){var q=Array(n.length>>2);for(var h=0;h<q.length;h++){q[h]=0}for(var h=0;h<n.length*8;h+=8){q[h>>5]|=(n.charCodeAt(h/8)&255)<<(h%32)}return q},binl2rstr:function(n){var q="";for(var h=0;h<n.length*32;h+=8){q+=String.fromCharCode((n[h>>5]>>>(h%32))&255)}return q},binl_md5:function(s,r){s[r>>5]|=128<<((r)%32);s[(((r+64)>>>9)<<4)+14]=r;var k=1732584193;var q=-271733879;var n=-1732584194;var t=271733878;for(var p=0;p<s.length;p+=16){var a=k;var u=q;var m=n;var h=t;k=this.md5_ff(k,q,n,t,s[p+0],7,-680876936);t=this.md5_ff(t,k,q,n,s[p+1],12,-389564586);n=this.md5_ff(n,t,k,q,s[p+2],17,606105819);q=this.md5_ff(q,n,t,k,s[p+3],22,-1044525330);k=this.md5_ff(k,q,n,t,s[p+4],7,-176418897);t=this.md5_ff(t,k,q,n,s[p+5],12,1200080426);n=this.md5_ff(n,t,k,q,s[p+6],17,-1473231341);q=this.md5_ff(q,n,t,k,s[p+7],22,-45705983);k=this.md5_ff(k,q,n,t,s[p+8],7,1770035416);t=this.md5_ff(t,k,q,n,s[p+9],12,-1958414417);n=this.md5_ff(n,t,k,q,s[p+10],17,-42063);q=this.md5_ff(q,n,t,k,s[p+11],22,-1990404162);k=this.md5_ff(k,q,n,t,s[p+12],7,1804603682);t=this.md5_ff(t,k,q,n,s[p+13],12,-40341101);n=this.md5_ff(n,t,k,q,s[p+14],17,-1502002290);q=this.md5_ff(q,n,t,k,s[p+15],22,1236535329);k=this.md5_gg(k,q,n,t,s[p+1],5,-165796510);t=this.md5_gg(t,k,q,n,s[p+6],9,-1069501632);n=this.md5_gg(n,t,k,q,s[p+11],14,643717713);q=this.md5_gg(q,n,t,k,s[p+0],20,-373897302);k=this.md5_gg(k,q,n,t,s[p+5],5,-701558691);t=this.md5_gg(t,k,q,n,s[p+10],9,38016083);n=this.md5_gg(n,t,k,q,s[p+15],14,-660478335);q=this.md5_gg(q,n,t,k,s[p+4],20,-405537848);k=this.md5_gg(k,q,n,t,s[p+9],5,568446438);t=this.md5_gg(t,k,q,n,s[p+14],9,-1019803690);n=this.md5_gg(n,t,k,q,s[p+3],14,-187363961);q=this.md5_gg(q,n,t,k,s[p+8],20,1163531501);k=this.md5_gg(k,q,n,t,s[p+13],5,-1444681467);t=this.md5_gg(t,k,q,n,s[p+2],9,-51403784);n=this.md5_gg(n,t,k,q,s[p+7],14,1735328473);q=this.md5_gg(q,n,t,k,s[p+12],20,-1926607734);k=this.md5_hh(k,q,n,t,s[p+5],4,-378558);t=this.md5_hh(t,k,q,n,s[p+8],11,-2022574463);n=this.md5_hh(n,t,k,q,s[p+11],16,1839030562);q=this.md5_hh(q,n,t,k,s[p+14],23,-35309556);k=this.md5_hh(k,q,n,t,s[p+1],4,-1530992060);t=this.md5_hh(t,k,q,n,s[p+4],11,1272893353);n=this.md5_hh(n,t,k,q,s[p+7],16,-155497632);q=this.md5_hh(q,n,t,k,s[p+10],23,-1094730640);k=this.md5_hh(k,q,n,t,s[p+13],4,681279174);t=this.md5_hh(t,k,q,n,s[p+0],11,-358537222);n=this.md5_hh(n,t,k,q,s[p+3],16,-722521979);q=this.md5_hh(q,n,t,k,s[p+6],23,76029189);k=this.md5_hh(k,q,n,t,s[p+9],4,-640364487);t=this.md5_hh(t,k,q,n,s[p+12],11,-421815835);n=this.md5_hh(n,t,k,q,s[p+15],16,530742520);q=this.md5_hh(q,n,t,k,s[p+2],23,-995338651);k=this.md5_ii(k,q,n,t,s[p+0],6,-198630844);t=this.md5_ii(t,k,q,n,s[p+7],10,1126891415);n=this.md5_ii(n,t,k,q,s[p+14],15,-1416354905);q=this.md5_ii(q,n,t,k,s[p+5],21,-57434055);k=this.md5_ii(k,q,n,t,s[p+12],6,1700485571);t=this.md5_ii(t,k,q,n,s[p+3],10,-1894986606);n=this.md5_ii(n,t,k,q,s[p+10],15,-1051523);q=this.md5_ii(q,n,t,k,s[p+1],21,-2054922799);k=this.md5_ii(k,q,n,t,s[p+8],6,1873313359);t=this.md5_ii(t,k,q,n,s[p+15],10,-30611744);n=this.md5_ii(n,t,k,q,s[p+6],15,-1560198380);q=this.md5_ii(q,n,t,k,s[p+13],21,1309151649);k=this.md5_ii(k,q,n,t,s[p+4],6,-145523070);t=this.md5_ii(t,k,q,n,s[p+11],10,-1120210379);n=this.md5_ii(n,t,k,q,s[p+2],15,718787259);q=this.md5_ii(q,n,t,k,s[p+9],21,-343485551);k=this.safe_add(k,a);q=this.safe_add(q,u);n=this.safe_add(n,m);t=this.safe_add(t,h)}return Array(k,q,n,t)},md5_cmn:function(n,h,t,q,a,s){return this.safe_add(this.bit_rol(this.safe_add(this.safe_add(h,n),this.safe_add(q,s)),a),t)},md5_ff:function(a,t,n,r,h,s,q){return this.md5_cmn((t&n)|((~t)&r),a,t,h,s,q)},md5_gg:function(a,t,n,r,h,s,q){return this.md5_cmn((t&r)|(n&(~r)),a,t,h,s,q)},md5_hh:function(a,t,n,r,h,s,q){return this.md5_cmn(t^n^r,a,t,h,s,q)},md5_ii:function(a,t,n,r,h,s,q){return this.md5_cmn(n^(t|(~r)),a,t,h,s,q)},safe_add:function(q,a){var h=(q&65535)+(a&65535);var n=(q>>16)+(a>>16)+(h>>16);return(n<<16)|(h&65535)},bit_rol:function(h,q){return(h<<q)|(h>>>(32-q))}};pstr.util.sha1={rotate_left:function(h,n){var q=(h<<n)|(h>>>(32-n));return q},lsb_hex:function(n){var h="";var t;var a;var q;for(t=0;t<=6;t+=2){a=(n>>>(t*4+4))&0x0f;q=(n>>>(t*4))&0x0f;h+=a.toString(16)+q.toString(16)}return h},cvt_hex:function(q){var h="";var a;var n;for(a=7;a>=0;a--){n=(q>>>(a*4))&0x0f;h+=n.toString(16)}return h},Utf8Encode:function(n){n=n.replace(/\r\n/g,"\n");var h="";for(var q=0;q<n.length;q++){var a=n.charCodeAt(q);if(a<128){h+=String.fromCharCode(a)}else if((a>127)&&(a<2048)){h+=String.fromCharCode((a>>6)|192);h+=String.fromCharCode((a&63)|128)}else{h+=String.fromCharCode((a>>12)|224);h+=String.fromCharCode(((a>>6)&63)|128);h+=String.fromCharCode((a&63)|128)}}return h},encrypt:function(h){var k;var f,j;var s=new Array(80);var t=0x67452301;var a=0xEFCDAB89;var u=0x98BADCFE;var o=0x10325476;var p=0xC3D2E1F0;var n,B,C,D,E;var m;h=this.Utf8Encode(h);var q=h.length;var r=new Array();for(f=0;f<q-3;f+=4){j=h.charCodeAt(f)<<24|h.charCodeAt(f+1)<<16|h.charCodeAt(f+2)<<8|h.charCodeAt(f+3);r.push(j)}switch(q%4){case 0:f=0x080000000;break;case 1:f=h.charCodeAt(q-1)<<24|0x0800000;break;case 2:f=h.charCodeAt(q-2)<<24|h.charCodeAt(q-1)<<16|0x08000;break;case 3:f=h.charCodeAt(q-3)<<24|h.charCodeAt(q-2)<<16|h.charCodeAt(q-1)<<8|0x80;break}r.push(f);while((r.length%16)!=14)r.push(0);r.push(q>>>29);r.push((q<<3)&0x0ffffffff);for(k=0;k<r.length;k+=16){for(f=0;f<16;f++)s[f]=r[k+f];for(f=16;f<=79;f++)s[f]=this.rotate_left(s[f-3]^s[f-8]^s[f-14]^s[f-16],1);n=t;B=a;C=u;D=o;E=p;for(f=0;f<=19;f++){m=(this.rotate_left(n,5)+((B&C)|(~B&D))+E+s[f]+0x5A827999)&0x0ffffffff;E=D;D=C;C=this.rotate_left(B,30);B=n;n=m}for(f=20;f<=39;f++){m=(this.rotate_left(n,5)+(B^C^D)+E+s[f]+0x6ED9EBA1)&0x0ffffffff;E=D;D=C;C=this.rotate_left(B,30);B=n;n=m}for(f=40;f<=59;f++){m=(this.rotate_left(n,5)+((B&C)|(B&D)|(C&D))+E+s[f]+0x8F1BBCDC)&0x0ffffffff;E=D;D=C;C=this.rotate_left(B,30);B=n;n=m}for(f=60;f<=79;f++){m=(this.rotate_left(n,5)+(B^C^D)+E+s[f]+0xCA62C1D6)&0x0ffffffff;E=D;D=C;C=this.rotate_left(B,30);B=n;n=m}t=(t+n)&0x0ffffffff;a=(a+B)&0x0ffffffff;u=(u+C)&0x0ffffffff;o=(o+D)&0x0ffffffff;p=(p+E)&0x0ffffffff}var m=this.cvt_hex(t)+this.cvt_hex(a)+this.cvt_hex(u)+this.cvt_hex(o)+this.cvt_hex(p);return m.toLowerCase()}};pstr.util.params=pstr.util.getParams();pstr.util.send=pstr.util.iframeSend;if(pstr.debug){pstr.util.send=pstr.util.rpc}Object.size=function(h){var q=0,key;for(key in h){if(h.hasOwnProperty(key))q++}return q};if('__ps_show_log'in pstr.util.params){pstr.util.showLog(true)}if('__ps_debug'in pstr.util.params){pstr.debug=true;pstr.util.__p_lvl=1}if(window.location.href.indexOf('test_ie.html')>=0){pstr.debug=true;pstr.util.__p_lvl=0;pstr.util.showLog(true)}}if(pstr.useguid){var guidCookie=pstr.util.getCookies()[pstr.ckidparam];pstr.util.log('guidCookie = '+guidCookie);if(guidCookie==undefined||guidCookie==null){pstr.util.log('tryin to set cookie');if(pstr.psid!='OO'){pstr.util.setCookie(pstr.ckidparam,pstr.psid,pstr.ckdomain,pstr.util.cookieExpireDays)}}}if(typeof pstr.mwec=="undefined"||!pstr.mwec){pstr.mwec={protocol:("https"==document.location.protocol.substring(0,5))?"https":"http",collect:'collect',valcollect:'validate'};pstr.mwec.getCurr=(function(h){return function(){return h}})({});pstr.mwec.initCurr=function(){var h={};pstr.mwec.getCurr=function(){return h}};pstr.mwec.currcoll=pstr.mwec.collect;pstr.mwec.collectUrl=function(h){return pstr.util.url(pstr.mwec.protocol,pstr.wecsubdom,pstr.pswecdom,pstr.mwec.currcoll,h)};pstr.mwec.obj_add=function obj_add(h,a,n){a=pstr.util.trim(a.toString().toLowerCase());pstr.util.log('obj_add adding '+a+'='+n);if(a in h){if(n==='undefined')return;var q=h[a];var t=typeof q;if(t==='object'&&pstr.util.isArray(q)){h[a].push(n)}else{h[a]=[q,n]}}else{h[a]=n}};pstr.mwec.obj_update=function obj_update(h,n,q){n=pstr.util.trim(n.toString().toLowerCase());pstr.util.log('obj_overwrite putting  '+n+'='+q);if(!(n in h)){h[n]=q}};pstr.mwec.obj_overwrite=function obj_overwrite(h,n,q){n=pstr.util.trim(n.toString().toLowerCase());pstr.util.log('obj_overwrite putting  '+n+'='+q);h[n]=q};pstr.mwec.sflatten=function sflatten(h,q){if(q==null)return;if(q===pstr||q===wec||q===pstr.mwec||q===pstr.util||q===pstr.ax){pstr.util.e('Attempt to add self to self!');return}if(arguments.length>2){for(var n=1,l=arguments.length;n<l;n++){sflatten(h,arguments[n])}return}var u=typeof q;switch(u){case'string':if(q.indexOf('=')==-1){this.obj_add(h,q,'')}else{var a=q.split('=');if(a.length==2){this.obj_add(h,a[0],a[1])}else{this.obj_add(h,a[0],q.substring(q.indexOf('=')+1))}}return;case'object':if(pstr.util.isArray(q)){for(var r in q){pstr.mwec.sflatten(h,q[r])}}else{for(var s in q){var t=q[s];switch(typeof t){case'string':case'number':case'boolean':this.obj_add(h,s,t);break;case'object':if(pstr.util.isArray(t)){this.obj_add(h,s,pstr.util.aflatten(t));break}default:pstr.util.w('WEC.add: Throwing away bad value in hash! Got Key: ['+s+'] Value: '+((typeof t=='function')?'function':t));break}}}return;case'function':default:return}};pstr.mwec.h2s=function(r){var p=function p(h){var a=pstr.util.aflatten(h);var n='';for(var q=0,l=a.length;q<l;q++){n+=a[q]+';'}return n.substring(0,n.length-1)};var s="";for(var u in r){var t=(r[u]===undefined)?'':p(r[u]).toString();s+=(u+'='+encodeURIComponent(t)+'&')}pstr.util.log('h2s: '+s);return s.substring(0,s.length-1)};pstr.mwec.prepSend=function prepSend(h){var t=pstr.util.getPageAndRef();pstr.mwec.obj_update(pstr.mwec.getCurr(),'current_url',pstr.util.maskPiiEmail(t['page']));pstr.mwec.obj_update(pstr.mwec.getCurr(),'referrer',pstr.util.maskPiiEmail(t['ref']));pstr.mwec.obj_update(pstr.mwec.getCurr(),'browser_ts',pstr.util.prclv_dt());pstr.mwec.obj_update(pstr.mwec.getCurr(),'ps_page_id',pstr.psessid);var a=pstr.mwec.h2s(pstr.mwec.getCurr());var q=pstr.util.hpii(a);var n='data='+pstr.util.rev(q)+'|'+pstr.util.checksum(q)+'|'+pstr.__p_ver;n+='&'+pstr.ckidparam+'='+pstr.util.getCookies()[pstr.ckidparam];n+='&'+pstr.jsidparam+'='+pstr.psid;n+='&'+pstr.cidparam+'='+pstr.client_id;n+='&'+pstr.eparam+'='+h;n+='&nosync';if(parseInt(pstr.test)==1){n+='&dev=1'}return n};pstr.mwec.s=function(q,t){if(pstr.events_off===true){return 0}var n=pstr.mwec.prepSend(q);var a=pstr.mwec.collectUrl(n);if(t){a+=t}var h=a;a=pstr.util.maskPiiEmail(h);try{if(a.length>4096){pstr.util.e('URI length is too long: '+a.length,3);pstr.util.e(a,3);pstr.util.send(a.substring(0,a.length-4096))}else{pstr.util.log('URI length is OK: '+a.length);pstr.util.send(a)}pstr.mwec.initCurr()}catch(e){pstr.util.e(' Failed to send() data: '+e)}return a.length};pstr.mwec.getNaturalKey=function(h){if(!h){return null}var q="";var n=pstr.mwec.getCurr()[h];if(n){q=pstr.mwec.wrapNkid(n)}return q};pstr.mwec.wrapNkid=function(h){if(h){h=encodeURIComponent(h);return pstr.mwec.wrapNaturalKey(pstr.naturalKeyName,h)}else{return null}};pstr.mwec.wrapNaturalKey=function(h,q){return'&'+h+'='+q};pstr.mwec.isRepeatOrder=function(h){if(pstr.util.isEmpty(h)){return false}var q=pstr.mwec.getExistingOrders();return pstr.util.inarr(h,q)};pstr.mwec.getExistingOrders=function(){var r=wec.getCookie('__psord');if(pstr.util.isEmpty(r)){return[]}var a=r.split('|');var t=[];for(var s=0;s<a.length;s++){t.push(unescape(a[s]))}return t.filter(function(h,q,n){return!pstr.util.isEmpty(h)})};pstr.mwec.saveOrderID=function(h){var q=wec.getCookie('__psord');if(pstr.util.isEmpty(q)){q=''}q+=escape(h)+"|";pstr.util.setCookie('__psord',q,null,null)};pstr.mwec.getOrderID=function(){return pstr.mwec.getCurr()["order_id"]}}if(!pstr.ax||typeof pstr.ax=='undefined'){pstr.ax={aup:'add_user'};pstr.ax.axUrl=function(h){return pstr.util.url(pstr.mwec.protocol,pstr.wecsubdom,pstr.pswecdom,pstr.ax.aup,h)};pstr.ax.au=function(h){var q='ax='+h+'&s='+pstr.client_id;if(parseInt(pstr.test)==1){q+='&dev=1'}return pstr.ax.axUrl(q)};pstr.ax.cn=function(){if(pstr.clientax=="")return;var n=pstr.clientax.split(',');for(var h=0,len=n.length;h<len;h++){var q=pstr.util.trim(n[h]);if(q){q=pstr.ax.au(q);pstr.util.log(q);pstr.util.send(q)}}};pstr.ax.cn()}if(typeof wec=='undefined'||!wec){var wec={};wec.__validate=function(h){pstr.debug=(h)?true:false;pstr.util.__p_lvl=(pstr.debug)?1:2;pstr.util.showLog(pstr.debug);pstr.mwec.currcoll=(pstr.debug)?pstr.mwec.valcollect:pstr.mwec.collect;pstr.util.send=(pstr.debug)?pstr.util.rpc:pstr.util.imgSend};wec.__log=function(h,q){pstr.util.log(h,q)};wec.getById=function(h){return document.getElementById(h)};wec.getCookie=function(q){var h=pstr.util.getCookies()[q];return(h)?unescape(h):h};wec.getParam=function(h){return pstr.util.params[h]};wec.addCookieByName=function(h){return wec.add({cookie:wec.getCookie(h)})};wec.addCookieId=function(h){return wec.add({cookie:h})};wec.addSessionByName=function(h){return wec.add({session:wec.getCookie(h)})};wec.addSessionId=function(h){return wec.add({session:h})};wec.addServerTs=function(h){return wec.add({server_ts:((pstr.util.isDate(h))?pstr.util.prclv_dt(h):h)})};wec.addHeir=function(h){return wec.add({heir:h})};wec.addPageType=function(h){return wec.add({page_type:h})};wec.addPageName=function(h){return wec.add({page_name:h})};wec.add=function add(){for(var h=0,l=arguments.length;h<l;h++){pstr.mwec.sflatten(pstr.mwec.getCurr(),arguments[h])}return wec};pstr.mwec.getValidator=function(t){var s={required:function(h){var q=t['required'];var n=t['req_values'];if(q){pstr.util.i("checking required values ...");for(var a=0,l=q.length;a<l;a++){if(!(q[a]in h)){pstr.util.w(q[a]+" param not found in input.");return false}pstr.util.i(q[a]+" param found in input.");if(n){if(q[a]in n){pstr.util.i("Checking "+q[a]+"'s value ...");if(!pstr.util.inarr(h[q[a]],n[q[a]])){pstr.util.e(q[a]+"'s value ["+h[q[a]]+"] is not in allowed fields ["+n[q[a]]+"]");return false}pstr.util.i(q[a]+"'s value ["+h[q[a]]+"] is OK.")}}}}return true},short_hand:function(){return false},run:function(h){var q=false;if(this.required(h)){q=true}return(q==true)?true:this.short_hand(h)}};if(t['short_hand']&&typeof t['short_hand']=='function'){s.short_hand=t['short_hand']}return s};wec.browse=function(){wec.add.apply(null,arguments);pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'event','browse');var t=pstr.mwec.getValidator({required:['viewtype','viewid'],req_values:{'viewtype':['dept','cat','sub_cat','brand','prod','page','token']},short_hand:function(h){for(var q in h){if(pstr.util.inarr(q,['dept','cat','sub_cat','prod','page','token'])){pstr.util.i('Found acceptable short hand value `'+q+'` in input');wec.add({viewtype:q,viewid:h[q]});delete pstr.mwec.getCurr()[q];return true}}return false}}).run(pstr.mwec.getCurr());if(!t){wec.add({jserr:1});if(pstr.debug){pstr.util.e('WEC ERROR: wec.browse() is missing required fields!')}}var a=null;var s='b';if('viewtype'in pstr.mwec.getCurr()){var n=pstr.mwec.getCurr().viewtype;n=n.toString();switch(n){case'dept':s='bd';a=pstr.mwec.getNaturalKey("viewid");break;case'cat':s='bc';a=pstr.mwec.getNaturalKey("viewid");break;case'sub_cat':s='bsc';break;case'brand':s='bb';break;case'prod':s='bp';a=pstr.mwec.getNaturalKey("viewid");break;case'page':s='p';a=pstr.mwec.getNaturalKey("viewid");break;case'token':s='bt';a='&node='+pstr.mwec.getCurr()['viewid'];break;default:s='b';break}}pstr.mwec.s(s,a);return t};wec.search=function(){wec.add.apply(null,arguments);pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'event','search');var h=pstr.mwec.getValidator({required:['term']}).run(pstr.mwec.getCurr());if(!h){wec.add({jserr:1});if(pstr.debug){pstr.util.e('WEC ERROR: wec.search() is missing required fields!')}}else{delete pstr.mwec.getCurr()['jserr']}pstr.mwec.s('s');return h};wec.cart_insert=function(){wec.add.apply(null,arguments);pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'event','cart');pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'cart','add');var n=pstr.mwec.getValidator({required:['sku','price','qty'],short_hand:function(h){if('cartitem'in h){pstr.util.i('Found acceptable short hand value `cartitem` in input');return true}return false}}).run(pstr.mwec.getCurr());if(!n){wec.add({jserr:1});if(pstr.debug){pstr.util.e('WEC ERROR: wec.cart_insert() is missing required fields!')}}else{delete pstr.mwec.getCurr()['jserr']}var q=pstr.mwec.getNaturalKey('sku');if(q==null&&'cartitem'in pstr.mwec.getCurr()){var a=pstr.mwec.getCurr()['cartitem'];if(a.indexOf(',')>=0){pstr.mwec.wrapNkid(a.split(",")[0])}}pstr.mwec.s('ci',q);return n};wec.cart_remove=function(){wec.add.apply(null,arguments);pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'event','cart');pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'cart','remove');var q=pstr.mwec.getValidator({required:['sku','qty'],short_hand:function(h){return('cartitem'in h)}}).run(pstr.mwec.getCurr());if(!q){wec.add({jserr:1});if(pstr.debug){pstr.util.e('WEC ERROR: wec.cart_remove() is missing required fields!')}}else{delete pstr.mwec.getCurr()['jserr']}pstr.mwec.s('cr');return q};wec.cart_reset=function(){wec.add.apply(null,arguments);pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'event','cart');pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'cart','reset');var h=pstr.mwec.getValidator({required:['cartitem']}).run(pstr.mwec.getCurr());if(!h){wec.add({jserr:1});if(pstr.debug){pstr.util.e('WEC ERROR: wec.cart_reset() is missing required fields!')}}else{delete pstr.mwec.getCurr()['jserr']}pstr.mwec.s('crs');return h};wec.order=function(){wec.add.apply(null,arguments);pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'event','order');var u=pstr.mwec.getValidator({required:['lineitems','order_total','order_id']}).run(pstr.mwec.getCurr());if(!u){wec.add({jserr:1});if(pstr.debug){pstr.util.e('WEC ERROR: wec.order() is missing required fields!')}}else{delete pstr.mwec.getCurr()['jserr']}var o=pstr.mwec.getOrderID();if(pstr.mwec.isRepeatOrder(o)){pstr.util.w('Detected repeat wec.order() event with order id ['+o+'] from existing order in cookie');pstr.mwec.s('or','&repeat_order=true');return false}if(pstr.util.isOffline()){pstr.util.w('Detected wec.order() event with order id ['+o+'] from a saved file');pstr.mwec.s('or','&offline_order=true');return false}var k=pstr.mwec.getCurr()['order_total'];var s="";if(k){s="&tpr="+pstr.util.rev(k)}var r=function(q,h){var a="";if(q){var n=q.split(';');for(ind=0,len=n.length;ind<len;ind++){a+=n[ind].split(',')[0]+","}if(h){a=a.substring(0,a.length-1)}}return a};if('lineitems'in pstr.mwec.getCurr()){var p=pstr.mwec.getCurr()['lineitems'];var m="";if(pstr.util.isArray(p)){for(var t=0,len=p.length;t<len;t++){if(p[t].indexOf(";")>-1){m+=r(p[t])}else{m+=p[t].split(',')[0]+','}}m=m.substring(0,m.length-1)}else{if(p.indexOf(";")>0){m=r(p,true)}else{m=p.split(',')[0]}}s+=pstr.mwec.wrapNkid(m)}var f=pstr.mwec.getCurr()['token'];if(f){s+="&label="+encodeURIComponent(f)}pstr.mwec.s('o',s);pstr.mwec.saveOrderID(o);return u};wec.register=function(){wec.add.apply(null,arguments);pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'event','register');var q=pstr.mwec.getValidator({required:['email','user_id'],short_hand:function(h){return('email'in h||'user_id'in h)}}).run(pstr.mwec.getCurr());if(!q){wec.add({jserr:1});if(pstr.debug){pstr.util.e('WEC ERROR: wec.register() is missing required fields!')}}else{delete pstr.mwec.getCurr()['jserr']}pstr.mwec.s('r');return q};wec.login=function(){wec.add.apply(null,arguments);pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'event','login');var n=pstr.mwec.getValidator({required:['login_type','login_id'],req_values:{'login_type':['email','user_id']},short_hand:function(h){for(var q in h){if(pstr.util.inarr(q,['email','user_id'])){return true}}return false}}).run(pstr.mwec.getCurr());if(!n){wec.add({jserr:1});if(pstr.debug){pstr.util.e('WEC ERROR: wec.login() is missing required fields!')}}else{delete pstr.mwec.getCurr()['jserr']}pstr.mwec.s('l');return n};if('__ps_validate'in pstr.util.params){wec.__validate(true)}}(function(){var q=function(){var h=wec.getParam('email');if(!h)h=wec.getParam('email_address');if(h){if('utm_medium'in pstr.util.params&&wec.getParam('utm_medium')=='email'){wec.send({event:'em_url',email:h})}}};var a=function(){if(pstr.auto_browse===true){pstr.util.log('Auto browsing current page');if(typeof ps_token_id!='undefined'){if(pstr.util.isEmpty(ps_token_id)){wec.add({token:""})}else{wec.add({token:pstr.util.trim(ps_token_id)})}}else{wec.add({page:'auto_browse'})}wec.browse()}};a();var n=function(){if(typeof _pswf=='string'&&typeof _pswa!='undefined'){_pswf=_pswf.toLowerCase();if(wec.hasOwnProperty(_pswf)&&pstr.util.inarr(_pswf,['browse','cart_insert','cart_remove','cart_reset','order','login','register','search'])){return wec[_pswf](_pswa)}}};n()})();