var silkroad={logDebug:function(n,t,i){n&&(console.log("\n\n=====================BEGIN "+t+"============================"),console.log(i),console.log("=====================END "+t+"============================\n\n"))},getLoaderPath:function(){return"/loading.html"},getModalIds:function(){return{modalEl:"silkroad-cx-apply-modal",modalBtn:"silkroad-cx-apply-modal-button",modalBgOverlay:"silkroad-cx-apply-modal-bgoverlay",modalIframeEl:"silkroad_cx_apply_container",modalBodyEl:"silkroad-cx-apply-modal-body",modalClose:"silkroad-cx-apply-modal-close"}},setup:function(){const t=document.getElementById("silkroad-cx-snippet"),n={a:t.getAttribute("data-action"),b:t.getAttribute("data-buttontarget"),bt:t.getAttribute("data-buttontext"),c:t.getAttribute("data-customercode"),d:t.getAttribute("data-domain"),e:t,i:t.getAttribute("data-id"),n:t.getAttribute("data-sendemailnotification"),p:t.getAttribute("data-portalcode"),s:t.getAttribute("data-sendemailconfirmation"),t:t.getAttribute("data-container"),cb:t.getAttribute("data-callback"),debug:t.getAttribute("data-debug")==="true",vd:""};typeof URLSearchParams!="undefined"&&new window.URLSearchParams(window.location.search).get("snippetdebug")&&(n.debug="true");try{const i=new XMLHttpRequest;if(i.open("GET",t.getAttribute("data-domain")+"/json/domain.json",!1),i.send(null),silkroad.logDebug(n.debug,"Domain Check: ",i.responseText),i.status===200){let t=JSON.parse(i.responseText);t.cxDomainLive&&!t.cxDomainLive.startsWith("#")?(n.vd=t.cxDomainLive+"/"+n.c,silkroad.logDebug(n.debug,"Using Live Domain: ",n.vd)):(n.vd=t.cxDomainLocal+"/"+n.c,silkroad.logDebug(n.debug,"Using Local Domain: ",n.vd))}else silkroad.logDebug(n.debug,"GetCxDomain Response: ",i)}catch(i){silkroad.logDebug(n.debug,"GetCxDomain Error: ",i)}n.u=n.d+"/"+n.c+"/"+n.p;n.a==null&&(n.a="recentJobs");n.i==null&&(n.i=0);n.s=n.s!=null&&n.s.toLowerCase()==="false"?"false":"true";n.n=n.n!=null&&n.n.toLowerCase()==="false"?"false":"true";silkroad.logDebug(n.debug,"Setup Config: ",n);window.silkroad[n.a](n)},cxEmbedded:function(n){var i,t,r;silkroad.logDebug(n.debug,"cxEmbedded Config: ",n);i=n.d+silkroad.getLoaderPath();t=document.createElement("iframe");t.setAttribute("scrolling","no");t.setAttribute("style","width:100%;border:none;");t.setAttribute("id","silkroadJobs_cx_container");t.src=i;silkroad.logDebug(n.debug,"Iframe: ",t);n.e.parentNode.insertBefore(t,n.e.nextSibling);const u=window.addEventListener?"addEventListener":"attachEvent",f=window[u],e=u==="attachEvent"?"onmessage":"message";f(e,function(i){silkroad.logDebug(n.debug,"PostMessage Data:  ",i.data);i.data.messagesource==="silkroadcx"&&Number.isInteger(i.data.height)&&(silkroad.logDebug(n.debug,"CX Element:  ",t),t.height="10px",t.height=i.data.height+"px",document.getElementById(t.id).height=i.data.height+"px;")},!1);r=getUrlParam("cxembeddedroot");i=r!=null&&n.vd.length>0&&r.toLowerCase().startsWith(n.vd.toLowerCase())?r:r!=null&&n.vd.length>0&&r.toLowerCase().startsWith("/"+n.c.toLowerCase()+"/"+n.p.toLowerCase())?n.d+r:n.u+"?embedded=true";t.setAttribute("onload","window.parent.parent.scrollTo(0,0);");document.readyState==="complete"?(silkroad.logDebug(n.debug,"readyState = complete","Fully loaded!"),silkroad.logDebug(n.debug,"SET SRC",i),t.src=i):document.readyState==="interactive"?(silkroad.logDebug(n.debug,"readyState = interactive","DOM ready! Images, frames, and other subresources are still downloading."),silkroad.logDebug(n.debug,"SET SRC",i),t.src=i):(silkroad.logDebug(n.debug,"readyState = loading","Loading still in progress."),window.addEventListener("load",()=>{silkroad.logDebug(n.debug,"load","Fully loaded!"),silkroad.logDebug(n.debug,"SET SRC",i),t.src=i}))},recentJobs:function(n){var i,t;silkroad.logDebug(n.debug,"Config: ",n);i=new XMLHttpRequest;const r=n.u+"/jobs/topjobs/?container="+n.t;if(n.t==="iframe"){t=document.createElement("iframe");t.setAttribute("scrolling","no");t.setAttribute("style","width:100%;border:none;");t.setAttribute("id","silkroadJobs_cx_container");t.src=r;silkroad.logDebug(n.debug,"Iframe: ",t);n.e.parentNode.insertBefore(t,n.e.nextSibling);const i=window.addEventListener?"addEventListener":"attachEvent",u=window[i],f=i==="attachEvent"?"onmessage":"message";u(f,function(i){silkroad.logDebug(n.debug,"PostMessage Data:  ",i.data);i.data.messagesource==="silkroadcx"&&Number.isInteger(i.data.height)&&(t.height="10px",t.height=i.data.height+"px")},!1)}else i.onreadystatechange=function(){if(this.readyState===4&&this.status===200){var t=document.createElement("div");t.innerHTML=i.responseText;t.setAttribute("id","silkroadJobs_cx_container");n.e.parentNode.insertBefore(t,n.e.nextSibling)}},i.open("GET",r,!0),i.send()},modal:{close:function(){const n=silkroad.getModalIds(),t=document.createElement("a"),i=document.getElementById(n.modalIframeEl);setTimeout(function(){i.src=silkroad.getLoaderPath()},100);t.href=i.src;setTimeout(function(){i.src=t.protocol+"//"+t.host+silkroad.getLoaderPath()},100);document.getElementById(n.modalEl).style.visibility="hidden";document.getElementById(n.modalBgOverlay).style.display="none"},open:function(){const n=silkroad.getModalIds();document.getElementById(n.modalEl).style.visibility="visible";document.getElementById(n.modalBgOverlay).style.display="block";scroll(0,0)}},modalJobDetails:function(n){silkroad.modalApply(n)},modalApply:function(n){var t=silkroad.getModalIds(),s=document.createElement("style"),o=document.createElement("style"),r=document.createElement("div"),u=document.createElement("button"),h=document.createElement("div"),l=document.createElement("div"),i=document.createElement("iframe"),c=document.createElement("div"),f=n.u+"/Apply/QuickApply?modal=true&jobId="+n.i+"&sendemailconfirmation="+n.s+"&sendemailnotification="+n.n,e;r.setAttribute("id",t.modalEl);c.setAttribute("id",t.modalEl+"-wrapper");u.setAttribute("id",t.modalBtn);h.setAttribute("id",t.modalBodyEl);l.setAttribute("id",t.modalBgOverlay);i.setAttribute("id",t.modalIframeEl);s.setAttribute("id",t.modalEl+"_style");o.setAttribute("id",t.modalEl+"_styleMedia");n.b==null&&(u.innerHTML=n.bt);s.innerHTML="#"+t.modalClose+" {color: #aaaaaa;font-size: 2em;font-weight: bold;padding-right:6px;}#"+t.modalClose+":hover,#"+t.modalClose+":focus{color: #000;text-decoration: none;cursor: pointer;}#"+t.modalEl+" {border-radius: 2px; max-width:775px;visibility:hidden; min-width:500px; position:absolute; top:0; left:50%; transform: translate(-50%); margin:auto; margin-top:2%; right:0; text-align:center; z-index: 1000; background-color:#fff; border:1px solid #ccc; overflow:hidden;box-shadow:1em 1em 1.5em rgba(0,0,0,.15);}#"+t.modalEl+" #"+t.modalEl+"-wrapper {}#"+t.modalBgOverlay+" {position:fixed;left:0;top:0;width:100vw;height:100vh;display:none;background-color:#000;opacity:0.5;}#"+t.modalBtn+"{border:none;border-radius:2px;color:#fff;background-color:#002f6d;cursor:pointer;width: 15em;height:3.21429em;padding:0 2.14286em;font-size:1.14286em;line-height:3.21429em;box-shadow:0 0.07143em 0.14286em 0 rgba(0,0,0,.23);}#"+t.modalBtn+":hover, #"+t.modalBtn+":focus {opacity:.75;color: #fff;}#"+t.modalIframeEl+"{position:relative;width:100%;min-height:680px;border:none;}@media (max-width:500px) {#"+t.modalEl+" {margin: 0;width:100%;max-width:100%;min-width:313px;bottom:0;border-radius:0;height:100%;max-height:100%;}}";o.innerHTML="@media (max-width:500px) {#"+t.modalEl+" {margin: 0;width:100%;max-width:100%;min-width:313px;min-height:100%;bottom:0;border-radius:0;height:100%;max-height:100%;}}";e=n.a==="modalJobDetails"?".silkroad-cx-job":n.b==null?t.modalBtn:n.b;silkroad.logDebug(n.debug,"eventTarget: ",e);n.a==="modalApply"&&document.getElementById(e)&&document.getElementById(e).setAttribute("onclick","return false;");document.addEventListener("click",function(t){return(t.target.matches&&t.target.matches(e)||this.activeElement.className&&this.activeElement.className==="silkroad-cx-job"||t.target.id===e)&&(t.preventDefault(),n.a==="modalJobDetails"&&(f=n.u+"/JobDetail/"+t.target.getAttribute("silkroad-data-id")+"?modal=true&sendemailconfirmation="+n.s+"&sendemailnotification="+n.n),silkroad.logDebug(n.debug,"click event",t),silkroad.modal.open(),setTimeout(function(){i.src!==f&&(i.src=f)},100)),!1},!1);silkroad.logDebug(n.debug,"Modal Source: ",f);c.appendChild(h);h.appendChild(i);i.setAttribute("scrolling","no");i.setAttribute("onload","window.parent.parent.scrollTo(0,0);");i.src!==n.d+silkroad.getLoaderPath()&&(i.src=n.d+silkroad.getLoaderPath());n.a==="modalApply"&&setTimeout(function(){i.src!==f&&(i.src=f)},100);r.appendChild(c);n.e.parentNode.insertBefore(o,n.e.nextSibling);n.e.parentNode.insertBefore(s,n.e.nextSibling);n.e.parentNode.insertBefore(l,n.e.nextSibling);n.e.parentNode.insertBefore(r,n.e.nextSibling);n.b==null&&n.a==="modalApply"&&n.e.parentNode.insertBefore(u,n.e.nextSibling);var a=window.addEventListener?"addEventListener":"attachEvent",v=window[a],y=a==="attachEvent"?"onmessage":"message";v(y,function(e){silkroad.logDebug(n.debug,"PostMessage Data:  ",e.data);e.data.messagesource==="silkroadcx"&&(typeof e.data.close!="undefined"&&(silkroad.logDebug(n.debug,"Closing Modal"),silkroad.modal.close()),typeof e.data.scroll!="undefined"&&(silkroad.logDebug(n.debug,"Scrolling Up"),window.parent.parent.scrollTo(0,0)),typeof e.data.action!="undefined"&&(silkroad.logDebug(n.debug,"Evaluating action: ",e.data.action),eval(e.data.action)),typeof e.data.callback!="undefined"&&(scroll(0,0),n.cb!==null&&(silkroad.logDebug(n.debug,"Triggering callback: ",n.cb),u.id===t.modalBtn&&(u.style.opacity=".35",u.disabled="disabled"),silkroad.modal.close(),window[n.cb](e.data.callbackData))),typeof e.data.height!="undefined"&&(document.getElementById(i.id).height=e.data.height+"px;"),document.getElementById(r.id).height=e.data.height+"px;",document.getElementById(r.id).width=e.data.width+"px;",document.getElementById(r.id).style.maxWidth=e.data.width+"px;",document.getElementById(o.id)&&(document.getElementById(o.id).innerHTML="@media (max-width:500px) {#"+t.modalEl+" {margin: 0;width:100%;max-width:100%;min-width:313px;min-height:100%;bottom:0;border-radius:0;height:"+e.data.height+"px;max-height:"+e.data.height+"px;}}"))},!1);n.cb!==null&&n.cb.length>0&&i.src!==n.d+silkroad.getLoaderPath()&&setTimeout(function(){i.src!==i.src+"&callback=true"&&(i.src=i.src+"&callback=true")},100)}},getUrlParam=function(n){const i=window.location.href;n=n.replace(/[\[\]]/g,"\\$&");var r=new RegExp("[?&]"+n+"(=([^&#]*)|&|#|$)"),t=r.exec(i);return t?t[2]?decodeURIComponent(t[2].replace(/\+/g," ")):"":null};silkroad.setup()