var smclt,smdcwt;setTimeout((function(){smclt=window._smclt,smdcwt=window._smdcwt}));var NEW_VISIT_MILLISECONDS=108e5,popupCookie=new PopupCookie,popupVisitStats=new PopupVisitStats;popupVisitStats.updateVisitStats();var popup=new Popup,sm_client_params="?type=POPUP",smclientCookie=getUrlParam("smclient")||popupCookie.readCookie("smclient"),uuid=popupCookie.readCookie("smuuid");function PopupCookie(){var e=this;return e.isLocalStorageAvailable=function(){return void 0!==window.localStorage},e.getDomain=function(e){if(!smdcwt&&e&&0===e.indexOf("www."))return e.replace("www.","");else return e},e.readCookie=function(t){var n=document.cookie.match(new RegExp(t+"=([^;]+)"));return n?n[1]:e.isLocalStorageAvailable()?window.localStorage.getItem(t):null},e.createCookie=function(t,n){setTimeout((function(){var o,i=new Date;if(i.setTime(i.getTime()+31536e7),o="; expires="+(smclt?new Date(addTime(smclt)).toGMTString():i.toGMTString()),document.cookie=t+"="+n+o+"; path=/; domain="+e.getDomain(document.domain),e.isLocalStorageAvailable())window.localStorage.setItem(t,n)}))},{createCookie:e.createCookie,readCookie:e.readCookie}}function Popup(){var e=this;return e.storedEvent={},e.removeEvent=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n);else if(e.detachEvent)e.detachEvent("on"+t,n)},e.addEvent=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else e.attachEvent("on"+t,(function(){return n.call(e,window.event)}))},e.buildCallback=function(t,n){return function(o){var i=o.relatedTarget||o.toElement;if((!i||"HTML"===i.nodeName)&&o.clientY<=0||o.clientX<=0||o.clientX>=window.innerWidth||o.clientY>=window.innerHeight)e.removeEvent(window,"mouseout",e.storedEvent[t].cb),n()}},e.setStoredEventKey=function(t,n,o){if(!e.storedEvent[t])e.storedEvent[t]={cb:null,c:!1,kp:!1,se:!1};e.storedEvent[t][n]=o},e.onWindowExit=function(t,n){var o=e.buildCallback(t,n);e.setStoredEventKey(t,"cb",o),e.addEvent(window,"mouseout",o)},e.closePopup=function(t,n,o){var i=(t.target||t.srcElement).parentNode.parentNode,a=document.getElementById(n);if(popupVisitStats.newVisit(n),i.style.display="none",i.nextSibling.style.display="none",popupVisitStats.setClosed(n),e.setStoredEventKey(n,"c",!0),o)popupVisitStats.neverShowAgain(n);if(a)document.body.removeChild(a)},e.keyPress=function(t,n){var o=document.getElementById("salesmanagoIframe").parentElement;if("mousedown"===t.type){o=(t.srcElement||t.originalTarget).parentElement.querySelector("#salesmanagoIframe").parentElement}if(0==t.button||1==t.button||2==t.button||3==t.button||4==t.button){var i=o.previousSibling,a=i.parentElement,s=a.nextSibling,r=document.getElementById(n);if(i.style.display="none",s.style.display="none",a.style.display="none",document.getElementById("smPopupBackground").display="none",e.setStoredEventKey(n,"kp",!0),r)document.body.removeChild(r);popupVisitStats.newVisit(n)}},e.createElement=function(e,t){var n=document.createElement("div");return n.id=e,n.className="bhr-popup-advanced",n.innerHTML=t,n},{onWindowExit:e.onWindowExit,closePopup:e.closePopup,keyPress:e.keyPress,createElement:e.createElement}}function PopupVisitStats(){var e=this,t="smforms",n=null;return e.getStored=function(){var e;if(n)return n&&n._v?n._v:n;else{try{e=(n=JSON.parse(atob(window.localStorage.getItem(t))))._ts?n._ts:null}catch(e){n={stats:{w:0,v:0,nv:!1,ts:(new Date).getTime(),ns:!1}}}if(n&&e&&(new Date).getTime()>e)window.localStorage.removeItem(t),n=null;return n&&n._v?n._v:n}},e.saveStored=function(e){setTimeout((function(){try{var n=e;if(smclt&&(isObject(smclt)||!isNaN(smclt)))n={_v:e,_ts:addTime(smclt)};window.localStorage.setItem(t,btoa(JSON.stringify(n)))}catch(e){}}))},e.updateVisitStats=function(){var t=e.getStored();if(t){var n=(new Date).getTime();if(t.stats.w+=1,t.stats.ns=!1,n-t.stats.ts>NEW_VISIT_MILLISECONDS)t.stats.ns=!0,t.stats.v+=1;t.stats.ts=n,e.saveStored(t)}},e.hasNewSession=function(){var t=e.getStored();try{return t.stats.ns}catch(e){return!1}},e.setClosed=function(t){var n=e.getStored();n[t].c=!0,e.saveStored(n)},e.setSubmitted=function(t){var n=e.getStored();if(n[t])n[t].s=!0,e.saveStored(n)},e.touch=function(t){var n=e.getStored();if(!n[t])n[t]={w:0,v:0,nv:!0,ns:!0,nsa:!1,s:!1,c:!1};else if(n[t].w+=1,n[t].nv=!0,e.hasNewSession())n[t].v+=1,n[t].w=0,n[t].ns=!0;return e.saveStored(n),n[t]},e.find=function(t){var n=e.getStored();return e.saveStored(n),n[t]},e.onDisplay=function(t){var n=e.getStored();n[t].ns=!1,e.saveStored(n)},e.neverShowAgain=function(t){var n=e.getStored();return n[t].nsa=!0,e.saveStored(n),n[t]},e.newVisit=function(t){var n=e.getStored();return n[t].nv=!1,e.saveStored(n),n[t]},e}function htmlContent(e,t,n,o,i,a,s,r,d,u,l,c,p,m,f,v,w,g,h,S,E,y,b,P,_,k,x,C,I,N,T,L,O){try{var V=popupVisitStats.find(e),D=[];if(V.s||V.nsa)D.push(!1);if(T)if(c)p<=V.w&&m>=V.w?D.push(!0):D.push(!1);else V.ns&&p<=V.v&&m>=V.v?D.push(!0):D.push(!1);else D.push(!0);if(h)if(S)V.ns&&(0===V.v||V.v>0&&V.v%E==0)?D.push(!0):D.push(!1);else 0===V.w||V.w>0&&V.w%y==0?D.push(!0):D.push(!1);if(D.every((function(e){return e}))&&t.length>0&&shouldShowForm(N)||O){function U(n){if(!(V.s||document.getElementById(n)||document.getElementById(n.replace("WAR-","")))){var c=window,p=document,m=p.documentElement,h=p.getElementsByTagName("body")[0],S=(c.innerWidth||m.clientWidth||h.clientWidth,c.innerHeight||m.clientHeight||h.clientHeight,"left:0;right:0;margin-left:auto;margin-right:auto;");if(!_)S="left:"+P+"px;";var E=k?"fixed":"absolute",y="',x='