if(typeof pstr=="undefined"||!pstr){var pstr={};pstr.psid='e780990e-9475-11ee-847e-0242ac110003';pstr.useguid='1';pstr.pswecdom='.pswec.com';pstr.client_id='04062d3838';pstr.ckdomain='frontline.com';pstr.wecsubdom='t';pstr.clientax='gg';pstr.test='XX_TEST_XX';pstr.cookie_name='psrw';pstr.usergroup_cookie='psugroup';pstr.conf_usergroup='XX_USERGROUP_XX';pstr.conf_usergroup_npi='2';pstr.conf_usergroup_no_npi='1';pstr.ug_cookie_val='XX_USERGROUP_COOKIE_VAL_XX';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.usergroup_order=[-1,1,2];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.cugroupparam='__'+pstr.usergroup_cookie;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;if(pstr.conf_usergroup.indexOf('XX_')!=-1||pstr.conf_usergroup=='')pstr.conf_usergroup=-1;if(pstr.conf_usergroup_npi.indexOf('XX_')!=-1||pstr.conf_usergroup_npi=='')pstr.conf_usergroup_npi=-1;if(pstr.conf_usergroup_no_npi.indexOf('XX_')!=-1||pstr.conf_usergroup_no_npi=='')pstr.conf_usergroup_no_npi=-1;if(pstr.ug_cookie_val.indexOf('XX_')!=-1||pstr.ug_cookie_val=='')pstr.ug_cookie_val=-1;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;pstr.is_user_npi=false;pstr.ug_skip_2nd_phase=false;pstr.ug_value_to_send=-1;pstr.ug_log=''}if(typeof pstr.util=="undefined"||!pstr.util){pstr.util={img:new Image(1,1),srcId:(function(scrNum){return function(){++scrNum;return'ps_scr_'+scrNum+'_'+(''+Math.random()).substring(2,10)}})(0),__p_log:"",__p_lvl:2,log:function(str,lvl){var lh=['D','I','W','E'];lvl=(arguments.length!=2)?0:lvl;if(lvl>=pstr.util.__p_lvl){pstr.util.__p_log+=pstr.util.prclv_dt()+'['+lh[lvl]+']: '+str+((pstr.util.isIE())?'</br>':'\n');pstr.util.__refreshLog()}},d:function(str){pstr.util.log(str,0)},i:function(str){pstr.util.log(str,1)},w:function(str){pstr.util.log(str,2)},e:function(str){pstr.util.log(str,3)},showLog:function(bool){if(arguments.length==0)return pstr.__p_show_log;pstr.__p_show_log=bool},__refreshLog:function(){if(pstr.__p_show_log==false){return}if(document&&document.body){var tt=document.getElementById('__ps_log_area');if(tt==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>';tt=document.getElementById('__ps_log_area')}tt.innerHTML=pstr.util.__p_log}},url:function(pro,sub,dom,path,qry){sub=(sub)?sub.replace(/\.+$/,''):sub;dom=dom.replace(/^\.+/,'');return pro+'://'+((sub)?sub+'.':'')+dom+'/'+path+'?'+qry},rpc:function(url){var script=document.createElement('script');script.id=pstr.util.srcId();script.type='text/javascript';script.defer=false;script.src=url;void(pstr.head.appendChild(script));pstr.util.log('rpc() sending '+script.id+' to  :  '+script.src);return script.id},removeScript:function(scriptid){var old=document.getElementById(scriptid);if(old)pstr.head.removeChild(old)},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 agent=navigator.userAgent;if(agent.match(pstr.util.isSafariRe)){if(!agent.match(pstr.util.isChromeRe)&&!agent.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 iff=document.createElement('iframe');iff.width=0;iff.height=0;iff.frameborder=0;iff.hidden=true;return iff},imgSend:function(src){var i=new Image(1,1);var img_id=pstr.util.srcId();i.id=img_id;i.onload=function(){pstr.util.d('removing image w/ id : '+img_id+'. URL='+src);delete i};i.src=src},iframeSend:function(src){if(pstr.ifsend_only||pstr.util.isSafari()){var iff=pstr.util.getIf();var iff_name_id=pstr.util.srcId();iff.name=iff_name_id;iff.id=iff_name_id;iff.src=src;var appendToHead=(document.body==null)?true:false;var cleanUp=function(){pstr.util.d('iFrame cleaning up with id/name : '+iff_name_id+' ...');if(appendToHead){void(pstr.head.removeChild(iff))}else{void(document.body.removeChild(iff))}delete iff;pstr.util.d('... done removing iFrame with id/name : '+iff_name_id)};if(iff.attachEvent&&pstr.util.isIE()){iff.attachEvent("onload",cleanUp)}else{iff.onload=cleanUp}if(appendToHead){pstr.util.d('appending to head : '+iff_name_id+". URL: "+src);void(pstr.head.appendChild(iff))}else{pstr.util.d('appending to body : '+iff_name_id+". URL: "+src);void(document.body.appendChild(iff))}}else{pstr.util.imgSend(src)}},oldIframeSend:function(src){if(pstr.ifsend_only||pstr.util.isSafari()){var iff=pstr.util.getIf();var iff_name=pstr.util.srcId();iff.name=iff_name;var pswf=document.createElement('form');pswf.action=src;pswf.method='POST';pswf.target=iff_name;var appendedToHead=false;if(document.body==null){void(pstr.head.appendChild(pswf));void(pstr.head.appendChild(iff));appendedToHead=true}else{void(document.body.appendChild(pswf));void(document.body.appendChild(iff))}if(pswf.submit()){if(appendedToHead){void(document.head.removeChild(iff));void(document.head.removeChild(pswf))}else{void(document.body.removeChild(iff));void(document.body.removeChild(pswf))}}}else{pstr.util.imgSend(src)}},getParams:function(){var tuples={},qs="",qq=window.location.href.split('?');if(qq.length==2){qs=qq[1]}if(qs==""){return tuples}var param_array=qs.split('&');for(var i=0,len=param_array.length;i<len;i++){var valueSplit=param_array[i].split('=');tuples[valueSplit[0]]=valueSplit[1]}return tuples},getCookies:function(){var cs=document.cookie.split(';'),ch={},re=/\s*(.+)\s*\=\s*(.+)\s*/;for(var i=0;i<cs.length;i++){var tuple=cs[i].match(re);if(tuple&&tuple[1].indexOf('__utm')<0){ch[tuple[1]]=tuple[2]}}return ch},cookieExpireDays:365*2,setCookie:function(c_name,value,domain,expiredays){var exdate=new Date();if(!expiredays){expiredays=this.cookieExpireDays}exdate.setDate(exdate.getDate()+expiredays);if(!domain){domain=pstr.ckdomain}if(!domain||document.location.hostname.indexOf(domain)==-1){domain=document.location.hostname}var cc=c_name+"="+escape(value);cc+="; path=/";cc+=((domain==null)?"":"; domain="+domain);cc+=((expiredays==null)?"":"; expires="+exdate.toGMTString());this.log(cc);document.cookie=cc},inarr:function(e,arr){for(var ii=0,l=arr.length;ii<l;ii++){if(e===arr[ii]){return true}}return false},getPageAndRef:function(){var page=document.location.href,ref=document.referrer;if(page.indexOf('://')==-1){page=''}if(ref.indexOf('://')==-1){ref=''}return{'page':page,'ref':ref}},checksum:function(str){if(!str||str=="")return-1;var sum=0;for(var ii=0;ii<str.length;ii++){sum+=str.charCodeAt(ii)}return sum},trim:function(str){if(str&&typeof str=='string'){return(typeof str.trim=='function')?str.trim():str.replace(/^\s*/,"").replace(/\s*$/,"")}else return str},_Sk:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",rev:function(input){if(!input||input=="")return"";input=""+input;var a,b,c,d="",_1,_2,_3,_4,i=0;(function(){_1=a,_2=b,_3=c,_4=d})();do{a=input.charCodeAt(i++);b=input.charCodeAt(i++);c=input.charCodeAt(i++);_1=a>>2;_2=((a&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<input.length);return d},padZero:function(n){if(n<10)return"0"+n;return n},prclv_dt:function(date){if(date==null)date=new Date();var sd=''+date.getFullYear()+'-'+this.padZero(date.getMonth()+1)+'-'+this.padZero(date.getDate());sd+=' '+date.getHours()+':'+this.padZero(date.getMinutes())+':'+this.padZero(date.getSeconds());return sd},isDate:function(date){return(date instanceof Date)},isArray:function(arr){return(arr instanceof Array)},isEmail:function(e){if(e){return pstr.emailRegex.test(pstr.util.trim(e.toLowerCase()))}return false},isEmpty:function(s){return(s==null)?true:(pstr.util.trim(s)=="")?true:false},isOffline:function(){if(pstr.util.trim(document.location.href.toLowerCase()).indexOf("file")==0){return true}return false},aflatten:function aflatten(array){var flat=[];if(pstr.util.isArray(array)){for(var i=0,l=array.length;i<l;i++){var type=Object.prototype.toString.call(array[i]).split(' ').pop().split(']').shift().toLowerCase();if(type){flat=flat.concat(/^(array|collection|arguments|object)$/.test(type)?aflatten(array[i]):array[i])}}}else{flat.push(array)}return flat},maskPiiEmail:function(urlString){if(!pstr.emailRegex.test(urlString)){return urlString}var newUrl=null;var checkStr=urlString.split('?');if(checkStr){newUrl=checkStr[0]}else{return urlString}var splitString=urlString.match(/\?.*$/);if((!splitString)||(splitString.length!=1)){console.log("WARNING! Malformed URL ["+urlString+"]");return urlString}else{query=splitString[0]}var queryKeyValues=query.split('&');for(ind=0,len=queryKeyValues.length;ind<len;ind++){if(ind>0){newUrl+='&'}var equalInd=queryKeyValues[ind].indexOf("=");if((equalInd>0)&&(queryKeyValues[ind].length>equalInd)){var key=queryKeyValues[ind].substr(0,equalInd);var value=queryKeyValues[ind].substr(equalInd+1,queryKeyValues[ind].length);var regexResult=value.match(pstr.emailRegex);if(regexResult){newUrl+=key+'=';newUrl+=pstr.util.md5.hex_md5(regexResult[0].toLowerCase())}else{newUrl+=queryKeyValues[ind]}}else{newUrl+=queryKeyValues[ind]}}return newUrl},hpii:function(str){var kv_arr=str.split('&');var fs='';for(var i=0,len=kv_arr.length;i<len;i++){var equalSplitValue=kv_arr[i];var equalSplit=equalSplitValue.split('=');var k=equalSplit[0];if(pstr.util.isPii(k,kv_arr[i])){fs+=k+'=';var keyValue=kv_arr[i].split('=');var decodedValue=decodeURIComponent(keyValue[1]);var v_arr=decodedValue.split(';');var v='';for(var j=0,len_v_varr=v_arr.length;j<len_v_varr;j++){if(k=="email"){if(pstr.util.isEmail(v_arr[j])){v+=pstr.util.md5.hex_md5(pstr.util.trim(v_arr[j].toLowerCase()));fs+=encodeURIComponent(v);fs+='&sha1=';v=pstr.util.sha1.encrypt(pstr.util.trim(v_arr[j].toLowerCase()))}else{v+=v_arr[j]}}else{v+=pstr.util.md5.hex_md5(v_arr[j])}if(j!=(len_v_varr-1)){v+=';'}}fs+=encodeURIComponent(v)}else{fs+=kv_arr[i]}if(i!=(kv_arr.length-1)){fs+='&'}}return fs},isPii:function(str,key_value){var ret_val=false;str=pstr.util.trim(str).toLowerCase();var pii_keys=['email','npi_id'];for(var ii=0,len=pii_keys.length;ii<len;ii++){if(str==pii_keys[ii]){ret_val=true}if(str=='user_id'){var value=key_value.split('=')[1];if(value!='e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'&&value!='9a271f2a916b0b6ee6cecb2426f0b3206ef074578be55d9bc94f6f3fe3ab86aa'&&value!=''){pstr.is_user_npi=true;console.log('user is an NPI; value = '+value)}else{console.log('empty user_id value')}}}return ret_val}};pstr.util.md5={hexcase:0,hex_md5:function(a){return this.rstr2hex(this.rstr_md5(this.str2rstr_utf8(a)))},hex_hmac_md5:function(a,b){return this.rstr2hex(this.rstr_hmac_md5(this.str2rstr_utf8(a),this.str2rstr_utf8(b)))},md5_vm_test:function(){return this.hex_md5("abc").toLowerCase()=="900150983cd24fb0d6963f7d28e17f72"},rstr_md5:function(a){return this.binl2rstr(this.binl_md5(this.rstr2binl(a),a.length*8))},rstr_hmac_md5:function(c,f){var e=this.rstr2binl(c);if(e.length>16){e=this.binl_md5(e,c.length*8)}var a=Array(16),d=Array(16);for(var b=0;b<16;b++){a[b]=e[b]^909522486;d[b]=e[b]^1549556828}var g=this.binl_md5(a.concat(this.rstr2binl(f)),512+f.length*8);return this.binl2rstr(this.binl_md5(d.concat(g),512+128))},rstr2hex:function(c){try{pstr.util.md5.hexcase}catch(g){pstr.util.md5.hexcase=0}var f=pstr.util.md5.hexcase?"0123456789ABCDEF":"0123456789abcdef";var b="";var a;for(var d=0;d<c.length;d++){a=c.charCodeAt(d);b+=f.charAt((a>>>4)&15)+f.charAt(a&15)}return b},str2rstr_utf8:function(c){var b="";var d=-1;var a,e;while(++d<c.length){a=c.charCodeAt(d);e=d+1<c.length?c.charCodeAt(d+1):0;if(55296<=a&&a<=56319&&56320<=e&&e<=57343){a=65536+((a&1023)<<10)+(e&1023);d++}if(a<=127){b+=String.fromCharCode(a)}else{if(a<=2047){b+=String.fromCharCode(192|((a>>>6)&31),128|(a&63))}else{if(a<=65535){b+=String.fromCharCode(224|((a>>>12)&15),128|((a>>>6)&63),128|(a&63))}else{if(a<=2097151){b+=String.fromCharCode(240|((a>>>18)&7),128|((a>>>12)&63),128|((a>>>6)&63),128|(a&63))}}}}}return b},rstr2binl:function(b){var a=Array(b.length>>2);for(var c=0;c<a.length;c++){a[c]=0}for(var c=0;c<b.length*8;c+=8){a[c>>5]|=(b.charCodeAt(c/8)&255)<<(c%32)}return a},binl2rstr:function(b){var a="";for(var c=0;c<b.length*32;c+=8){a+=String.fromCharCode((b[c>>5]>>>(c%32))&255)}return a},binl_md5:function(p,k){p[k>>5]|=128<<((k)%32);p[(((k+64)>>>9)<<4)+14]=k;var o=1732584193;var n=-271733879;var m=-1732584194;var l=271733878;for(var g=0;g<p.length;g+=16){var j=o;var h=n;var f=m;var e=l;o=this.md5_ff(o,n,m,l,p[g+0],7,-680876936);l=this.md5_ff(l,o,n,m,p[g+1],12,-389564586);m=this.md5_ff(m,l,o,n,p[g+2],17,606105819);n=this.md5_ff(n,m,l,o,p[g+3],22,-1044525330);o=this.md5_ff(o,n,m,l,p[g+4],7,-176418897);l=this.md5_ff(l,o,n,m,p[g+5],12,1200080426);m=this.md5_ff(m,l,o,n,p[g+6],17,-1473231341);n=this.md5_ff(n,m,l,o,p[g+7],22,-45705983);o=this.md5_ff(o,n,m,l,p[g+8],7,1770035416);l=this.md5_ff(l,o,n,m,p[g+9],12,-1958414417);m=this.md5_ff(m,l,o,n,p[g+10],17,-42063);n=this.md5_ff(n,m,l,o,p[g+11],22,-1990404162);o=this.md5_ff(o,n,m,l,p[g+12],7,1804603682);l=this.md5_ff(l,o,n,m,p[g+13],12,-40341101);m=this.md5_ff(m,l,o,n,p[g+14],17,-1502002290);n=this.md5_ff(n,m,l,o,p[g+15],22,1236535329);o=this.md5_gg(o,n,m,l,p[g+1],5,-165796510);l=this.md5_gg(l,o,n,m,p[g+6],9,-1069501632);m=this.md5_gg(m,l,o,n,p[g+11],14,643717713);n=this.md5_gg(n,m,l,o,p[g+0],20,-373897302);o=this.md5_gg(o,n,m,l,p[g+5],5,-701558691);l=this.md5_gg(l,o,n,m,p[g+10],9,38016083);m=this.md5_gg(m,l,o,n,p[g+15],14,-660478335);n=this.md5_gg(n,m,l,o,p[g+4],20,-405537848);o=this.md5_gg(o,n,m,l,p[g+9],5,568446438);l=this.md5_gg(l,o,n,m,p[g+14],9,-1019803690);m=this.md5_gg(m,l,o,n,p[g+3],14,-187363961);n=this.md5_gg(n,m,l,o,p[g+8],20,1163531501);o=this.md5_gg(o,n,m,l,p[g+13],5,-1444681467);l=this.md5_gg(l,o,n,m,p[g+2],9,-51403784);m=this.md5_gg(m,l,o,n,p[g+7],14,1735328473);n=this.md5_gg(n,m,l,o,p[g+12],20,-1926607734);o=this.md5_hh(o,n,m,l,p[g+5],4,-378558);l=this.md5_hh(l,o,n,m,p[g+8],11,-2022574463);m=this.md5_hh(m,l,o,n,p[g+11],16,1839030562);n=this.md5_hh(n,m,l,o,p[g+14],23,-35309556);o=this.md5_hh(o,n,m,l,p[g+1],4,-1530992060);l=this.md5_hh(l,o,n,m,p[g+4],11,1272893353);m=this.md5_hh(m,l,o,n,p[g+7],16,-155497632);n=this.md5_hh(n,m,l,o,p[g+10],23,-1094730640);o=this.md5_hh(o,n,m,l,p[g+13],4,681279174);l=this.md5_hh(l,o,n,m,p[g+0],11,-358537222);m=this.md5_hh(m,l,o,n,p[g+3],16,-722521979);n=this.md5_hh(n,m,l,o,p[g+6],23,76029189);o=this.md5_hh(o,n,m,l,p[g+9],4,-640364487);l=this.md5_hh(l,o,n,m,p[g+12],11,-421815835);m=this.md5_hh(m,l,o,n,p[g+15],16,530742520);n=this.md5_hh(n,m,l,o,p[g+2],23,-995338651);o=this.md5_ii(o,n,m,l,p[g+0],6,-198630844);l=this.md5_ii(l,o,n,m,p[g+7],10,1126891415);m=this.md5_ii(m,l,o,n,p[g+14],15,-1416354905);n=this.md5_ii(n,m,l,o,p[g+5],21,-57434055);o=this.md5_ii(o,n,m,l,p[g+12],6,1700485571);l=this.md5_ii(l,o,n,m,p[g+3],10,-1894986606);m=this.md5_ii(m,l,o,n,p[g+10],15,-1051523);n=this.md5_ii(n,m,l,o,p[g+1],21,-2054922799);o=this.md5_ii(o,n,m,l,p[g+8],6,1873313359);l=this.md5_ii(l,o,n,m,p[g+15],10,-30611744);m=this.md5_ii(m,l,o,n,p[g+6],15,-1560198380);n=this.md5_ii(n,m,l,o,p[g+13],21,1309151649);o=this.md5_ii(o,n,m,l,p[g+4],6,-145523070);l=this.md5_ii(l,o,n,m,p[g+11],10,-1120210379);m=this.md5_ii(m,l,o,n,p[g+2],15,718787259);n=this.md5_ii(n,m,l,o,p[g+9],21,-343485551);o=this.safe_add(o,j);n=this.safe_add(n,h);m=this.safe_add(m,f);l=this.safe_add(l,e)}return Array(o,n,m,l)},md5_cmn:function(h,e,d,c,g,f){return this.safe_add(this.bit_rol(this.safe_add(this.safe_add(e,h),this.safe_add(c,f)),g),d)},md5_ff:function(g,f,k,j,e,i,h){return this.md5_cmn((f&k)|((~f)&j),g,f,e,i,h)},md5_gg:function(g,f,k,j,e,i,h){return this.md5_cmn((f&j)|(k&(~j)),g,f,e,i,h)},md5_hh:function(g,f,k,j,e,i,h){return this.md5_cmn(f^k^j,g,f,e,i,h)},md5_ii:function(g,f,k,j,e,i,h){return this.md5_cmn(k^(f|(~j)),g,f,e,i,h)},safe_add:function(a,d){var c=(a&65535)+(d&65535);var b=(a>>16)+(d>>16)+(c>>16);return(b<<16)|(c&65535)},bit_rol:function(a,b){return(a<<b)|(a>>>(32-b))}};pstr.util.sha1={rotate_left:function(n,s){var t4=(n<<s)|(n>>>(32-s));return t4},lsb_hex:function(val){var str="";var i;var vh;var vl;for(i=0;i<=6;i+=2){vh=(val>>>(i*4+4))&0x0f;vl=(val>>>(i*4))&0x0f;str+=vh.toString(16)+vl.toString(16)}return str},cvt_hex:function(val){var str="";var i;var v;for(i=7;i>=0;i--){v=(val>>>(i*4))&0x0f;str+=v.toString(16)}return str},Utf8Encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c)}else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128)}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128)}}return utftext},encrypt:function(msg){var blockstart;var i,j;var W=new Array(80);var H0=0x67452301;var H1=0xEFCDAB89;var H2=0x98BADCFE;var H3=0x10325476;var H4=0xC3D2E1F0;var A,B,C,D,E;var temp;msg=this.Utf8Encode(msg);var msg_len=msg.length;var word_array=new Array();for(i=0;i<msg_len-3;i+=4){j=msg.charCodeAt(i)<<24|msg.charCodeAt(i+1)<<16|msg.charCodeAt(i+2)<<8|msg.charCodeAt(i+3);word_array.push(j)}switch(msg_len%4){case 0:i=0x080000000;break;case 1:i=msg.charCodeAt(msg_len-1)<<24|0x0800000;break;case 2:i=msg.charCodeAt(msg_len-2)<<24|msg.charCodeAt(msg_len-1)<<16|0x08000;break;case 3:i=msg.charCodeAt(msg_len-3)<<24|msg.charCodeAt(msg_len-2)<<16|msg.charCodeAt(msg_len-1)<<8|0x80;break}word_array.push(i);while((word_array.length%16)!=14)word_array.push(0);word_array.push(msg_len>>>29);word_array.push((msg_len<<3)&0x0ffffffff);for(blockstart=0;blockstart<word_array.length;blockstart+=16){for(i=0;i<16;i++)W[i]=word_array[blockstart+i];for(i=16;i<=79;i++)W[i]=this.rotate_left(W[i-3]^W[i-8]^W[i-14]^W[i-16],1);A=H0;B=H1;C=H2;D=H3;E=H4;for(i=0;i<=19;i++){temp=(this.rotate_left(A,5)+((B&C)|(~B&D))+E+W[i]+0x5A827999)&0x0ffffffff;E=D;D=C;C=this.rotate_left(B,30);B=A;A=temp}for(i=20;i<=39;i++){temp=(this.rotate_left(A,5)+(B^C^D)+E+W[i]+0x6ED9EBA1)&0x0ffffffff;E=D;D=C;C=this.rotate_left(B,30);B=A;A=temp}for(i=40;i<=59;i++){temp=(this.rotate_left(A,5)+((B&C)|(B&D)|(C&D))+E+W[i]+0x8F1BBCDC)&0x0ffffffff;E=D;D=C;C=this.rotate_left(B,30);B=A;A=temp}for(i=60;i<=79;i++){temp=(this.rotate_left(A,5)+(B^C^D)+E+W[i]+0xCA62C1D6)&0x0ffffffff;E=D;D=C;C=this.rotate_left(B,30);B=A;A=temp}H0=(H0+A)&0x0ffffffff;H1=(H1+B)&0x0ffffffff;H2=(H2+C)&0x0ffffffff;H3=(H3+D)&0x0ffffffff;H4=(H4+E)&0x0ffffffff}var temp=this.cvt_hex(H0)+this.cvt_hex(H1)+this.cvt_hex(H2)+this.cvt_hex(H3)+this.cvt_hex(H4);return temp.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(obj){var size=0,key;for(key in obj){if(obj.hasOwnProperty(key))size++}return size};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(query){return pstr.util.url(pstr.mwec.protocol,pstr.wecsubdom,pstr.pswecdom,pstr.mwec.currcoll,query)};pstr.mwec.obj_add=function obj_add(obj,name,value){name=pstr.util.trim(name.toString().toLowerCase());pstr.util.log('obj_add adding '+name+'='+value);if(name in obj){if(value==='undefined')return;var existing=obj[name];var t=typeof existing;if(t==='object'&&pstr.util.isArray(existing)){obj[name].push(value)}else{obj[name]=[existing,value]}}else{obj[name]=value}};pstr.mwec.obj_update=function obj_update(obj,name,value){name=pstr.util.trim(name.toString().toLowerCase());pstr.util.log('obj_overwrite putting  '+name+'='+value);if(!(name in obj)){obj[name]=value}};pstr.mwec.obj_overwrite=function obj_overwrite(obj,name,value){name=pstr.util.trim(name.toString().toLowerCase());pstr.util.log('obj_overwrite putting  '+name+'='+value);obj[name]=value};pstr.mwec.sflatten=function sflatten(obj,arg){if(arg==null)return;if(arg===pstr||arg===wec||arg===pstr.mwec||arg===pstr.util||arg===pstr.ax){pstr.util.e('Attempt to add self to self!');return}if(arguments.length>2){for(var ii=1,l=arguments.length;ii<l;ii++){sflatten(obj,arguments[ii])}return}var t=typeof arg;switch(t){case'string':if(arg.indexOf('=')==-1){this.obj_add(obj,arg,'')}else{var k_v=arg.split('=');if(k_v.length==2){this.obj_add(obj,k_v[0],k_v[1])}else{this.obj_add(obj,k_v[0],arg.substring(arg.indexOf('=')+1))}}return;case'object':if(pstr.util.isArray(arg)){for(var i in arg){pstr.mwec.sflatten(obj,arg[i])}}else{for(var k in arg){var ak=arg[k];switch(typeof ak){case'string':case'number':case'boolean':this.obj_add(obj,k,ak);break;case'object':if(pstr.util.isArray(ak)){this.obj_add(obj,k,pstr.util.aflatten(ak));break}default:pstr.util.w('WEC.add: Throwing away bad value in hash! Got Key: ['+k+'] Value: '+((typeof ak=='function')?'function':ak));break}}}return;case'function':default:return}};pstr.mwec.h2s=function(h){var a2s=function a2s(a){var a2=pstr.util.aflatten(a);var s='';for(var ii=0,l=a2.length;ii<l;ii++){s+=a2[ii]+';'}return s.substring(0,s.length-1)};var stringBuild="";for(var k in h){var hashString=(h[k]===undefined)?'':a2s(h[k]).toString();stringBuild+=(k+'='+encodeURIComponent(hashString)+'&')}pstr.util.log('h2s: '+stringBuild);return stringBuild.substring(0,stringBuild.length-1)};pstr.mwec.prepSend=function prepSend(eventtype){var pr=pstr.util.getPageAndRef();pstr.mwec.obj_update(pstr.mwec.getCurr(),'current_url',pstr.util.maskPiiEmail(pr['page']));pstr.mwec.obj_update(pstr.mwec.getCurr(),'referrer',pstr.util.maskPiiEmail(pr['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 hashedString=pstr.mwec.h2s(pstr.mwec.getCurr());var s=pstr.util.hpii(hashedString);var _v='data='+pstr.util.rev(s)+'|'+pstr.util.checksum(s)+'|'+pstr.__p_ver;_v+='&'+pstr.ckidparam+'='+pstr.util.getCookies()[pstr.ckidparam];_v+='&'+pstr.jsidparam+'='+pstr.psid;_v+='&'+pstr.cidparam+'='+pstr.client_id;_v+='&'+pstr.eparam+'='+eventtype;_v+='&nosync';if(parseInt(pstr.test)==1){_v+='&dev=1'}return _v};function usergroup_get_priority(val){len=pstr.usergroup_order.length;for(i=0;i<len;i++){if(val==pstr.usergroup_order[i]){return i}}return 100}function usergroup_has_highest_priority(val){return val==pstr.usergroup_order[pstr.usergroup_order.length-1]}function usergroup_compare(v1,v2){v1_priority=usergroup_get_priority(v1);v2_priority=usergroup_get_priority(v2);if(v1_priority<v2_priority){return-1}else if(v1_priority>v2_priority){return 1}return 0}function usergroup_send_log(val){protocol=("https"==document.location.protocol.substring(0,5))?"https":"http";url=protocol+'://www.pswec.com/write_ug_log?usergroup_log='+val;pstr.util.send(url)}function pstr_ax_axUrl(query){return pstr.util.url(pstr.mwec.protocol,pstr.wecsubdom,pstr.pswecdom,pstr.ax.aup,query)}function pstr_ax_au(g){var q='ax='+g+'&s='+pstr.client_id;if(parseInt(pstr.test)==1){q+='&dev=1'}if(pstr.ug_value_to_send!=-1){q+='&usergroup='+pstr.ug_value_to_send}pstr.ug_log='cl_id:'+pstr.client_id+':ug:'+pstr.ug_value_to_send;return pstr_ax_axUrl(q)};function pstr_ax_cn(){if(pstr.clientax=="")return;var ss=pstr.clientax.split(',');for(var ii=0,len=ss.length;ii<len;ii++){var s=pstr.util.trim(ss[ii]);if(s){s=pstr_ax_au(s);pstr.util.log(s);pstr.util.send(s);pstr.ug_log=''}}};function usergroup_set_cookie(val){if(pstr.ug_cookie_val!=val){pstr.util.setCookie(pstr.cugroupparam,val,pstr.ckdomain,pstr.util.cookieExpireDays);pstr.ug_cookie_val=val;console.log('setting UG cookie '+pstr.cugroupparam+' ; val = '+val+' ; domain = '+pstr.ckdomain)}}function merge_ug_cookie_23(ug_val){var ret_ug_val=ug_val;if(ug_val==3){ret_ug_val=2;console.log('setting UG cookie to merged value; val = '+ret_ug_val);usergroup_set_cookie(ret_ug_val)}return ret_ug_val}pstr.mwec.s=function(eventtype,extraargs){if(pstr.events_off===true){return 0}var s=pstr.mwec.prepSend(eventtype);var u=pstr.mwec.collectUrl(s);if(extraargs){u+=extraargs}var originalUrl=u;u=pstr.util.maskPiiEmail(originalUrl);try{if(u.length>4096){pstr.util.e('URI length is too long: '+u.length,3);pstr.util.e(u,3);pstr.util.send(u.substring(0,u.length-4096))}else{pstr.util.log('URI length is OK: '+u.length);pstr.util.send(u)}pstr.mwec.initCurr();if(!pstr.ug_skip_2nd_phase){var conf_val=pstr.is_user_npi?pstr.conf_usergroup_npi:pstr.conf_usergroup_no_npi;cmp=usergroup_compare(conf_val,pstr.ug_cookie_val);if(cmp==1){pstr.ug_value_to_send=conf_val;usergroup_set_cookie(pstr.ug_value_to_send)}else{pstr.ug_value_to_send=pstr.ug_cookie_val}if(pstr.ug_value_to_send!=-1){pstr_ax_cn()}}}catch(e){pstr.util.e(' Failed to send() data: '+e)}return u.length};pstr.mwec.getNaturalKey=function(natKey){if(!natKey){return null}var queryStr="";var naturalKeyId=pstr.mwec.getCurr()[natKey];if(naturalKeyId){queryStr=pstr.mwec.wrapNkid(naturalKeyId)}return queryStr};pstr.mwec.wrapNkid=function(v){if(v){v=encodeURIComponent(v);return pstr.mwec.wrapNaturalKey(pstr.naturalKeyName,v)}else{return null}};pstr.mwec.wrapNaturalKey=function(k,v){return'&'+k+'='+v};pstr.mwec.isRepeatOrder=function(ord){if(pstr.util.isEmpty(ord)){return false}var cookie_orders=pstr.mwec.getExistingOrders();return pstr.util.inarr(ord,cookie_orders)};pstr.mwec.getExistingOrders=function(){var cord=wec.getCookie('__psord');if(pstr.util.isEmpty(cord)){return[]}var orders_esc=cord.split('|');var orders=[];for(var ii=0;ii<orders_esc.length;ii++){orders.push(unescape(orders_esc[ii]))}return orders.filter(function(e,idx,arr){return!pstr.util.isEmpty(e)})};pstr.mwec.saveOrderID=function(order_id){var cord=wec.getCookie('__psord');if(pstr.util.isEmpty(cord)){cord=''}cord+=escape(order_id)+"|";pstr.util.setCookie('__psord',cord,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.ug_cookie_val_orig=pstr.util.getCookies()[pstr.cugroupparam];console.log('reading UG cookie ; val = '+pstr.ug_cookie_val_orig);if(pstr.ug_cookie_val_orig==undefined||pstr.ug_cookie_val_orig==null){pstr.ug_cookie_val_orig=-1;console.log('UG cookie undefined, setting to '+pstr.ug_cookie_val_orig)}pstr.ug_cookie_val=merge_ug_cookie_23(pstr.ug_cookie_val_orig);console.log('UG cookie after merge; val = '+pstr.ug_cookie_val);if(usergroup_has_highest_priority(pstr.ug_cookie_val)){pstr.ug_skip_2nd_phase=true;pstr.ug_value_to_send=pstr.ug_cookie_val}else{if(pstr.conf_usergroup!=-1){pstr.ug_skip_2nd_phase=true;var cmp=usergroup_compare(pstr.conf_usergroup,pstr.ug_cookie_val);if(cmp==1){pstr.ug_value_to_send=pstr.conf_usergroup;usergroup_set_cookie(pstr.ug_value_to_send)}else{pstr.ug_value_to_send=pstr.ug_cookie_val}}else{if(pstr.conf_usergroup_npi==-1){pstr.ug_skip_2nd_phase=true;if(pstr.ug_cookie_val!=-1){pstr.ug_value_to_send=pstr.ug_cookie_val}else{pstr.ug_value_to_send=-1}}}}pstr_ax_cn()}if(typeof wec=='undefined'||!wec){var wec={};wec.__validate=function(bool){pstr.debug=(bool)?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(msg,lvl){pstr.util.log(msg,lvl)};wec.getById=function(id){return document.getElementById(id)};wec.getCookie=function(cookie_name){var cval=pstr.util.getCookies()[cookie_name];return(cval)?unescape(cval):cval};wec.getParam=function(param){return pstr.util.params[param]};wec.addCookieByName=function(c_name){return wec.add({cookie:wec.getCookie(c_name)})};wec.addCookieId=function(c_val){return wec.add({cookie:c_val})};wec.addSessionByName=function(ses_name){return wec.add({session:wec.getCookie(ses_name)})};wec.addSessionId=function(ses_val){return wec.add({session:ses_val})};wec.addServerTs=function(s_ts){return wec.add({server_ts:((pstr.util.isDate(s_ts))?pstr.util.prclv_dt(s_ts):s_ts)})};wec.addHeir=function(h){return wec.add({heir:h})};wec.addPageType=function(pt){return wec.add({page_type:pt})};wec.addPageName=function(pn){return wec.add({page_name:pn})};wec.add=function add(){for(var ii=0,l=arguments.length;ii<l;ii++){pstr.mwec.sflatten(pstr.mwec.getCurr(),arguments[ii])}return wec};pstr.mwec.getValidator=function(req){var validator={required:function(obj){var r=req['required'];var rv=req['req_values'];if(r){pstr.util.i("checking required values ...");for(var i=0,l=r.length;i<l;i++){if(!(r[i]in obj)){pstr.util.w(r[i]+" param not found in input.");return false}pstr.util.i(r[i]+" param found in input.");if(rv){if(r[i]in rv){pstr.util.i("Checking "+r[i]+"'s value ...");if(!pstr.util.inarr(obj[r[i]],rv[r[i]])){pstr.util.e(r[i]+"'s value ["+obj[r[i]]+"] is not in allowed fields ["+rv[r[i]]+"]");return false}pstr.util.i(r[i]+"'s value ["+obj[r[i]]+"] is OK.")}}}}return true},short_hand:function(){return false},run:function(obj){var ret=false;if(this.required(obj)){ret=true}return(ret==true)?true:this.short_hand(obj)}};if(req['short_hand']&&typeof req['short_hand']=='function'){validator.short_hand=req['short_hand']}return validator};wec.browse=function(){wec.add.apply(null,arguments);pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'event','browse');var succ=pstr.mwec.getValidator({required:['viewtype','viewid'],req_values:{'viewtype':['dept','cat','sub_cat','brand','prod','page','token']},short_hand:function(obj){for(var k in obj){if(pstr.util.inarr(k,['dept','cat','sub_cat','prod','page','token'])){pstr.util.i('Found acceptable short hand value `'+k+'` in input');wec.add({viewtype:k,viewid:obj[k]});delete pstr.mwec.getCurr()[k];return true}}return false}}).run(pstr.mwec.getCurr());if(!succ){wec.add({jserr:1});if(pstr.debug){pstr.util.e('WEC ERROR: wec.browse() is missing required fields!')}}var extraQueriesString=null;var eventtypelog='b';if('viewtype'in pstr.mwec.getCurr()){var viewType=pstr.mwec.getCurr().viewtype;viewType=viewType.toString();switch(viewType){case'dept':eventtypelog='bd';extraQueriesString=pstr.mwec.getNaturalKey("viewid");break;case'cat':eventtypelog='bc';extraQueriesString=pstr.mwec.getNaturalKey("viewid");break;case'sub_cat':eventtypelog='bsc';break;case'brand':eventtypelog='bb';break;case'prod':eventtypelog='bp';extraQueriesString=pstr.mwec.getNaturalKey("viewid");break;case'page':eventtypelog='p';extraQueriesString=pstr.mwec.getNaturalKey("viewid");break;case'token':eventtypelog='bt';extraQueriesString='&node='+pstr.mwec.getCurr()['viewid'];break;default:eventtypelog='b';break}}pstr.mwec.s(eventtypelog,extraQueriesString);return succ};wec.search=function(){wec.add.apply(null,arguments);pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'event','search');var succ=pstr.mwec.getValidator({required:['term']}).run(pstr.mwec.getCurr());if(!succ){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 succ};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 succ=pstr.mwec.getValidator({required:['sku','price','qty'],short_hand:function(obj){if('cartitem'in obj){pstr.util.i('Found acceptable short hand value `cartitem` in input');return true}return false}}).run(pstr.mwec.getCurr());if(!succ){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 extraQueriesString=pstr.mwec.getNaturalKey('sku');if(extraQueriesString==null&&'cartitem'in pstr.mwec.getCurr()){var c=pstr.mwec.getCurr()['cartitem'];if(c.indexOf(',')>=0){pstr.mwec.wrapNkid(c.split(",")[0])}}pstr.mwec.s('ci',extraQueriesString);return succ};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 succ=pstr.mwec.getValidator({required:['sku','qty'],short_hand:function(obj){return('cartitem'in obj)}}).run(pstr.mwec.getCurr());if(!succ){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 succ};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 succ=pstr.mwec.getValidator({required:['cartitem']}).run(pstr.mwec.getCurr());if(!succ){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 succ};wec.order=function(){wec.add.apply(null,arguments);pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'event','order');var succ=pstr.mwec.getValidator({required:['lineitems','order_total','order_id']}).run(pstr.mwec.getCurr());if(!succ){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 ord_id=pstr.mwec.getOrderID();if(pstr.mwec.isRepeatOrder(ord_id)){pstr.util.w('Detected repeat wec.order() event with order id ['+ord_id+'] 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 ['+ord_id+'] from a saved file');pstr.mwec.s('or','&offline_order=true');return false}var orderTotal=pstr.mwec.getCurr()['order_total'];var extraQueriesString="";if(orderTotal){extraQueriesString="&tpr="+pstr.util.rev(orderTotal)}var semiColonLineItemSplitter=function(lineItem,removeLastSemi){var tmpQueryString="";if(lineItem){var splitLI=lineItem.split(';');for(ind=0,len=splitLI.length;ind<len;ind++){tmpQueryString+=splitLI[ind].split(',')[0]+","}if(removeLastSemi){tmpQueryString=tmpQueryString.substring(0,tmpQueryString.length-1)}}return tmpQueryString};if('lineitems'in pstr.mwec.getCurr()){var c=pstr.mwec.getCurr()['lineitems'];var skus="";if(pstr.util.isArray(c)){for(var ii=0,len=c.length;ii<len;ii++){if(c[ii].indexOf(";")>-1){skus+=semiColonLineItemSplitter(c[ii])}else{skus+=c[ii].split(',')[0]+','}}skus=skus.substring(0,skus.length-1)}else{if(c.indexOf(";")>0){skus=semiColonLineItemSplitter(c,true)}else{skus=c.split(',')[0]}}extraQueriesString+=pstr.mwec.wrapNkid(skus)}var token=pstr.mwec.getCurr()['token'];if(token){extraQueriesString+="&label="+encodeURIComponent(token)}pstr.mwec.s('o',extraQueriesString);pstr.mwec.saveOrderID(ord_id);return succ};wec.register=function(){wec.add.apply(null,arguments);pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'event','register');var succ=pstr.mwec.getValidator({required:['email','user_id'],short_hand:function(obj){return('email'in obj||'user_id'in obj)}}).run(pstr.mwec.getCurr());if(!succ){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 succ};wec.login=function(){wec.add.apply(null,arguments);pstr.mwec.obj_overwrite(pstr.mwec.getCurr(),'event','login');var succ=pstr.mwec.getValidator({required:['login_type','login_id'],req_values:{'login_type':['email','user_id']},short_hand:function(obj){for(var k in obj){if(pstr.util.inarr(k,['email','user_id'])){return true}}return false}}).run(pstr.mwec.getCurr());if(!succ){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 succ};if('__ps_validate'in pstr.util.params){wec.__validate(true)}}(function(){var __emailDetect=function(){var e=wec.getParam('email');if(!e)e=wec.getParam('email_address');if(e){if('utm_medium'in pstr.util.params&&wec.getParam('utm_medium')=='email'){wec.send({event:'em_url',email:e})}}};var __autoBrowse=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()}};__autoBrowse();var __asyncHelper=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)}}};__asyncHelper()})();
