// -------------------------------------------------------------------------------------------------------------------- // Accessibility Stuff // -------------------------------------------------------------------------------------------------------------------- document.addEventListener('keydown', function(e) { if (e.keyCode === 9) { document.body.classList.add('show-focus-outlines'); console.log('we are in here - tabbing away'); } }); document.addEventListener('click', function(e) { document.body.classList.remove('show-focus-outlines'); }); function checkLinksForTarget() { var links = Array.prototype.slice.call(document.getElementsByTagName('a')); for (var i = 0; i < links.length; i++) { if (links[i].getAttribute("target") === "_blank") { function setTitleFunction() { return "This link opens in a new tab!"; } var newTabMessage = document.createElement("span"); // Create a element newTabMessage.setAttribute('class', 'screen-reader-only'); var newTabMessageTextNode = document.createTextNode("This opens in a new tab"); newTabMessage.appendChild(newTabMessageTextNode); var newTabMessageClone = newTabMessage.cloneNode(true); var newTabIcon = document.createElement("i"); // Create a element newTabIcon.setAttribute("class", "fa fa-external-link-square"); // Apply class to newTabIcon.setAttribute("aria-hidden", "true"); var newTabIconClone = newTabIcon.cloneNode(true); // create a clone of element links[i].setAttribute('title', setTitleFunction()); links[i].appendChild(newTabMessageClone); links[i].appendChild(newTabIconClone); } } } // navbar logo logic setTimeout(function() { var offsetWidth = document.querySelector(".header-brand").offsetWidth; var companyLogo = document.querySelector(".header-brand-img"); if (offsetWidth >= 100) { companyLogo.className += " " + "mini"; } }, 10); var jsPDF=function(e){"use strict";function t(t){var n={};this.subscribe=function(e,t,r){if("function"!=typeof t)return!1;n.hasOwnProperty(e)||(n[e]={});var o=Math.random().toString(35);return n[e][o]=[t,!!r],o},this.unsubscribe=function(e){for(var t in n)if(n[t][e])return delete n[t][e],!0;return!1},this.publish=function(r){if(n.hasOwnProperty(r)){var o=Array.prototype.slice.call(arguments,1),i=[];for(var a in n[r]){var s=n[r][a];try{s[0].apply(t,o)}catch(u){e.console&&console.error("jsPDF PubSub Error",u.message,u)}s[1]&&i.push(a)}i.length&&i.forEach(this.unsubscribe)}}}function n(i,a,s,u){var c={};"object"==typeof i&&(c=i,i=c.orientation,a=c.unit||a,s=c.format||s,u=c.compress||c.compressPdf||u),a=a||"mm",s=s||"a4",i=(""+(i||"P")).toLowerCase();var l,f,d,p,g,h,b,v,y,m=((""+s).toLowerCase(),!!u&&"function"==typeof Uint8Array),w=c.textColor||"0 g",j=c.drawColor||"0 G",P=c.fontSize||16,C=c.lineHeight||1.15,S=c.lineWidth||.200025,O=2,F=!1,T=[],A={},x={},R=0,k=[],L=[],I=[],D=[],U=[],M=0,B=0,E=0,N={title:"",subject:"",author:"",keywords:"",creator:""},z={},H=new t(z),W=c.hotfixes||[],J=function(e){return e.toFixed(2)},q=function(e){return e.toFixed(3)},G=function(e){return("0"+parseInt(e)).slice(-2)},_=function(e){F?k[p].push(e):(E+=e.length+1,D.push(e))},X=function(){return O++,T[O]=E,_(O+" 0 obj"),O},K=function(){var e=2*k.length+1;e+=U.length;var t={objId:e,content:""};return U.push(t),t},Q=function(){return O++,T[O]=function(){return E},O},V=function(e){T[e]=E},Y=function(e){_("stream"),_(e),_("endstream")},Z=function(){var t,r,o,i,a,s,u,c,l,d=[];for(u=e.adler32cs||n.adler32cs,m&&"undefined"==typeof u&&(m=!1),t=1;R>=t;t++){if(d.push(X()),c=(g=I[t].width)*f,l=(h=I[t].height)*f,_("<>"),_("endobj"),r=k[t].join("\n"),X(),m){for(o=[],i=r.length;i--;)o[i]=r.charCodeAt(i);s=u.from(r),a=new Deflater(6),a.append(new Uint8Array(o)),r=a.flush(),o=new Uint8Array(r.length+6),o.set(new Uint8Array([120,156])),o.set(r,2),o.set(new Uint8Array([255&s,s>>8&255,s>>16&255,s>>24&255]),r.length+2),r=String.fromCharCode.apply(null,o),_("<>")}else _("<>");Y(r),_("endobj")}T[1]=E,_("1 0 obj"),_("<i;i++)p+=d[i]+" 0 R ";_(p+"]"),_("/Count "+R),_(">>"),_("endobj"),H.publish("postPutPages")},$=function(e){e.objectNumber=X(),_("<>"),_("endobj")},ee=function(){for(var e in A)A.hasOwnProperty(e)&&$(A[e])},te=function(){H.publish("putXobjectDict")},ne=function(){_("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),_("/Font <<");for(var e in A)A.hasOwnProperty(e)&&_("/"+e+" "+A[e].objectNumber+" 0 R");_(">>"),_("/XObject <<"),te(),_(">>")},re=function(){ee(),H.publish("putResources"),T[2]=E,_("2 0 obj"),_("<<"),ne(),_(">>"),_("endobj"),H.publish("postPutResources")},oe=function(){H.publish("putAdditionalObjects");for(var e=0;el;l++){var d=ae(c[l][0],c[l][1],c[l][2],s),p=c[l][0].split("-");ie(d,p[0],p[1]||"")}H.publish("addFonts",{fonts:A,dictionary:x})},ue=function(t){return t.foo=function(){try{return t.apply(this,arguments)}catch(n){var r=n.stack||"";~r.indexOf(" at ")&&(r=r.split(" at ")[1]);var o="Error in function "+r.split("\n")[0].split("<")[0]+": "+n.message;if(!e.console)throw new Error(o);e.console.error(o,n),e.alert&&alert(o)}},t.foo.bar=t,t.foo},ce=function(e,t){var n,r,o,i,a,s,u,c,f;if(t=t||{},o=t.sourceEncoding||"Unicode",a=t.outputEncoding,(t.autoencode||a)&&A[l].metadata&&A[l].metadata[o]&&A[l].metadata[o].encoding&&(i=A[l].metadata[o].encoding,!a&&A[l].encoding&&(a=A[l].encoding),!a&&i.codePages&&(a=i.codePages[0]),"string"==typeof a&&(a=i[a]),a)){for(u=!1,s=[],n=0,r=e.length;r>n;n++)c=a[e.charCodeAt(n)],c?s.push(String.fromCharCode(c)):s.push(e[n]),s[n].charCodeAt(0)>>8&&(u=!0);e=s.join("")}for(n=e.length;void 0===u&&0!==n;)e.charCodeAt(n-1)>>8&&(u=!0),n--;if(!u)return e;for(s=t.noBOM?[]:[254,255],n=0,r=e.length;r>n;n++){if(c=e.charCodeAt(n),f=c>>8,f>>8)throw new Error("Character at position "+n+" of string '"+e+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(f),s.push(c-(f<<8))}return String.fromCharCode.apply(void 0,s)},le=function(e,t){return ce(e,t).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},fe=function(){_("/Producer (jsPDF "+n.version+")");for(var e in N)N.hasOwnProperty(e)&&N[e]&&_("/"+e.substr(0,1).toUpperCase()+e.substr(1)+" ("+le(N[e])+")");var t=new Date,r=t.getTimezoneOffset(),o=0>r?"+":"-",i=Math.floor(Math.abs(r/60)),a=Math.abs(r%60),s=[o,G(i),"'",G(a),"'"].join("");_(["/CreationDate (D:",t.getFullYear(),G(t.getMonth()+1),G(t.getDate()),G(t.getHours()),G(t.getMinutes()),G(t.getSeconds()),s,")"].join(""))},de=function(){switch(_("/Type /Catalog"),_("/Pages 1 0 R"),v||(v="fullwidth"),v){case"fullwidth":_("/OpenAction [3 0 R /FitH null]");break;case"fullheight":_("/OpenAction [3 0 R /FitV null]");break;case"fullpage":_("/OpenAction [3 0 R /Fit]");break;case"original":_("/OpenAction [3 0 R /XYZ null null 1]");break;default:var e=""+v;"%"===e.substr(e.length-1)&&(v=parseInt(v)/100),"number"==typeof v&&_("/OpenAction [3 0 R /XYZ null null "+J(v)+"]")}switch(y||(y="continuous"),y){case"continuous":_("/PageLayout /OneColumn");break;case"single":_("/PageLayout /SinglePage");break;case"two":case"twoleft":_("/PageLayout /TwoColumnLeft");break;case"tworight":_("/PageLayout /TwoColumnRight")}b&&_("/PageMode /"+b),H.publish("putCatalog")},pe=function(){_("/Size "+(O+1)),_("/Root "+O+" 0 R"),_("/Info "+(O-1)+" 0 R")},ge=function(e,t){var n="string"==typeof t&&t.toLowerCase();if("string"==typeof e){var r=e.toLowerCase();o.hasOwnProperty(r)&&(e=o[r][0]/f,t=o[r][1]/f)}if(Array.isArray(e)&&(t=e[1],e=e[0]),n){switch(n.substr(0,1)){case"l":t>e&&(n="s");break;case"p":e>t&&(n="s")}"s"===n&&(d=e,e=t,t=d)}F=!0,k[++R]=[],I[R]={width:Number(e)||g,height:Number(t)||h},L[R]={},ve(R)},he=function(){ge.apply(this,arguments),_(J(S*f)+" w"),_(j),0!==M&&_(M+" J"),0!==B&&_(B+" j"),H.publish("addPage",{pageNumber:R})},be=function(e){e>0&&R>=e&&(k.splice(e,1),I.splice(e,1),R--,p>R&&(p=R),this.setPage(p))},ve=function(e){e>0&&R>=e&&(p=e,g=I[e].width,h=I[e].height)},ye=function(e,t){var n;switch(e=void 0!==e?e:A[l].fontName,t=void 0!==t?t:A[l].fontStyle,void 0!==e&&(e=e.toLowerCase()),e){case"sans-serif":case"verdana":case"arial":case"helvetica":e="helvetica";break;case"fixed":case"monospace":case"terminal":case"courier":e="courier";break;case"serif":case"cursive":case"fantasy":default:e="times"}try{n=x[e][t]}catch(r){}return n||(n=x.times[t],null==n&&(n=x.times.normal)),n},me=function(){F=!1,O=2,E=0,D=[],T=[],U=[],H.publish("buildDocument"),_("%PDF-"+r),Z(),oe(),re(),X(),_("<<"),fe(),_(">>"),_("endobj"),X(),_("<<"),de(),_(">>"),_("endobj");var e,t=E,n="0000000000";for(_("xref"),_("0 "+(O+1)),_(n+" 65535 f "),e=1;O>=e;e++){var o=T[e];_("function"==typeof o?(n+T[e]()).slice(-10)+" 00000 n ":(n+T[e]).slice(-10)+" 00000 n ")}return _("trailer"),_("<<"),pe(),_(">>"),_("startxref"),_(""+t),_("%%EOF"),F=!0,D.join("\n")},we=function(e){var t="S";return"F"===e?t="f":"FD"===e||"DF"===e?t="B":("f"===e||"f*"===e||"B"===e||"B*"===e)&&(t=e),t},je=function(){for(var e=me(),t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n);t--;)r[t]=e.charCodeAt(t);return n},Pe=function(){return new Blob([je()],{type:"application/pdf"})},Ce=ue(function(t,n){var r="dataur"===(""+t).substr(0,6)?"data:application/pdf;base64,"+btoa(me()):0;switch(t){case void 0:return me();case"save":if(navigator.getUserMedia&&(void 0===e.URL||void 0===e.URL.createObjectURL))return z.output("dataurlnewwindow");saveAs(Pe(),n),"function"==typeof saveAs.unload&&e.setTimeout&&setTimeout(saveAs.unload,911);break;case"arraybuffer":return je();case"blob":return Pe();case"bloburi":case"bloburl":return e.URL&&e.URL.createObjectURL(Pe())||void 0;case"datauristring":case"dataurlstring":return r;case"dataurlnewwindow":var o=e.open(r);if(o||"undefined"==typeof safari)return o;case"datauri":case"dataurl":return e.document.location.href=r;default:throw new Error('Output type "'+t+'" is not supported.')}}),Se=function(e){return Array.isArray(W)===!0&&W.indexOf(e)>-1};switch(a){case"pt":f=1;break;case"mm":f=72/25.4000508;break;case"cm":f=72/2.54000508;break;case"in":f=72;break;case"px":f=1==Se("px_scaling")?.75:96/72;break;case"pc":f=12;break;case"em":f=12;break;case"ex":f=6;break;default:throw"Invalid unit: "+a}z.internal={pdfEscape:le,getStyle:we,getFont:function(){return A[ye.apply(z,arguments)]},getFontSize:function(){return P},getLineHeight:function(){return P*C},write:function(e){_(1===arguments.length?e:Array.prototype.join.call(arguments," "))},getCoordinateString:function(e){return J(e*f)},getVerticalCoordinateString:function(e){return J((h-e)*f)},collections:{},newObject:X,newAdditionalObject:K,newObjectDeferred:Q,newObjectDeferredBegin:V,putStream:Y,events:H,scaleFactor:f,pageSize:{get width(){return g},get height(){return h}},output:function(e,t){return Ce(e,t)},getNumberOfPages:function(){return k.length-1},pages:k,out:_,f2:J,getPageInfo:function(e){var t=2*(e-1)+3;return{objId:t,pageNumber:e,pageContext:L[e]}},getCurrentPageInfo:function(){var e=2*(p-1)+3;return{objId:e,pageNumber:p,pageContext:L[p]}},getPDFVersion:function(){return r},hasHotfix:Se},z.addPage=function(){return he.apply(this,arguments),this},z.setPage=function(){return ve.apply(this,arguments),this},z.insertPage=function(e){return this.addPage(),this.movePage(p,e),this},z.movePage=function(e,t){if(e>t){for(var n=k[e],r=I[e],o=L[e],i=e;i>t;i--)k[i]=k[i-1],I[i]=I[i-1],L[i]=L[i-1];k[t]=n,I[t]=r,L[t]=o,this.setPage(t)}else if(t>e){for(var n=k[e],r=I[e],o=L[e],i=e;t>i;i++)k[i]=k[i+1],I[i]=I[i+1],L[i]=L[i+1];k[t]=n,I[t]=r,L[t]=o,this.setPage(t)}return this},z.deletePage=function(){return be.apply(this,arguments),this},z.setDisplayMode=function(e,t,n){v=e,y=t,b=n;var r=[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"];if(-1==r.indexOf(n))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+n+'" is not recognized.');return this},z.text=function(e,t,n,r,o,i){function a(e){return e=e.split(" ").join(Array(c.TabLen||9).join(" ")),le(e,r)}"number"==typeof e&&(d=n,n=t,t=e,e=d),"string"==typeof e&&(e=e.match(/[\n\r]/)?e.split(/\r\n|\r|\n/g):[e]),"string"==typeof o&&(i=o,o=null),"string"==typeof r&&(i=r,r=null),"number"==typeof r&&(o=r,r=null);var s,u="",p="Td";if(o){o*=Math.PI/180;var g=Math.cos(o),b=Math.sin(o);u=[J(g),J(b),J(-1*b),J(g),""].join(" "),p="Tm"}r=r||{},"noBOM"in r||(r.noBOM=!0),"autoencode"in r||(r.autoencode=!0);var v="",y=this.internal.getCurrentPageInfo().pageContext;if(!0===r.stroke?y.lastTextWasStroke!==!0&&(v="1 Tr\n",y.lastTextWasStroke=!0):(y.lastTextWasStroke&&(v="0 Tr\n"),y.lastTextWasStroke=!1),"undefined"==typeof this._runningPageHeight&&(this._runningPageHeight=0),"string"==typeof e)e=a(e);else{if("[object Array]"!==Object.prototype.toString.call(e))throw new Error('Type of text must be string or Array. "'+e+'" is not recognized.');for(var m=e.concat(),j=[],S=m.length;S--;)j.push(a(m.shift()));var O=Math.ceil((h-n-this._runningPageHeight)*f/(P*C));if(O>=0&&Ok;k++){var L=A-R[k];"center"===i&&(L/=2),e+=") Tj\n"+(F-T+L)+" -"+x+" Td ("+j[k],T=F+L}}else e=j.join(") Tj\nT* (")}var I;return s||(I=J((h-n)*f)),_("BT\n/"+l+" "+P+" Tf\n"+P*C+" TL\n"+v+w+"\n"+u+J(t*f)+" "+I+" "+p+"\n("+e+") Tj\nET"),s&&this.text(s,t,n),this},z.lstext=function(e,t,n,r){console.warn("jsPDF.lstext is deprecated");for(var o=0,i=e.length;i>o;o++,t+=r)this.text(e[o],t,n);return this},z.line=function(e,t,n,r){return this.lines([[n-e,r-t]],e,t)},z.clip=function(){_("W"),_("S")},z.clip_fixed=function(e){_("evenodd"===e?"W*":"W"),_("n")},z.lines=function(e,t,n,r,o,i){var a,s,u,c,l,p,g,b,v,y,m;for("number"==typeof e&&(d=n,n=t,t=e,e=d),r=r||[1,1],_(q(t*f)+" "+q((h-n)*f)+" m "),a=r[0],s=r[1],c=e.length,y=t,m=n,u=0;c>u;u++)l=e[u],2===l.length?(y=l[0]*a+y,m=l[1]*s+m,_(q(y*f)+" "+q((h-m)*f)+" l")):(p=l[0]*a+y,g=l[1]*s+m,b=l[2]*a+y,v=l[3]*s+m,y=l[4]*a+y,m=l[5]*s+m,_(q(p*f)+" "+q((h-g)*f)+" "+q(b*f)+" "+q((h-v)*f)+" "+q(y*f)+" "+q((h-m)*f)+" c"));return i&&_(" h"),null!==o&&_(we(o)),this},z.rect=function(e,t,n,r,o){we(o);return _([J(e*f),J((h-t)*f),J(n*f),J(-r*f),"re"].join(" ")),null!==o&&_(we(o)),this},z.triangle=function(e,t,n,r,o,i,a){return this.lines([[n-e,r-t],[o-n,i-r],[e-o,t-i]],e,t,[1,1],a,!0),this},z.roundedRect=function(e,t,n,r,o,i,a){var s=4/3*(Math.SQRT2-1);return this.lines([[n-2*o,0],[o*s,0,o,i-i*s,o,i],[0,r-2*i],[0,i*s,-(o*s),i,-o,i],[-n+2*o,0],[-(o*s),0,-o,-(i*s),-o,-i],[0,-r+2*i],[0,-(i*s),o*s,-i,o,-i]],e+o,t,[1,1],a),this},z.ellipse=function(e,t,n,r,o){var i=4/3*(Math.SQRT2-1)*n,a=4/3*(Math.SQRT2-1)*r;return _([J((e+n)*f),J((h-t)*f),"m",J((e+n)*f),J((h-(t-a))*f),J((e+i)*f),J((h-(t-r))*f),J(e*f),J((h-(t-r))*f),"c"].join(" ")),_([J((e-i)*f),J((h-(t-r))*f),J((e-n)*f),J((h-(t-a))*f),J((e-n)*f),J((h-t)*f),"c"].join(" ")),_([J((e-n)*f),J((h-(t+a))*f),J((e-i)*f),J((h-(t+r))*f),J(e*f),J((h-(t+r))*f),"c"].join(" ")),_([J((e+i)*f),J((h-(t+r))*f),J((e+n)*f),J((h-(t+a))*f),J((e+n)*f),J((h-t)*f),"c"].join(" ")),null!==o&&_(we(o)),this},z.circle=function(e,t,n,r){return this.ellipse(e,t,n,n,r)},z.setProperties=function(e){for(var t in N)N.hasOwnProperty(t)&&e[t]&&(N[t]=e[t]);return this},z.setFontSize=function(e){return P=e,this},z.setFont=function(e,t){return l=ye(e,t),this},z.setFontStyle=z.setFontType=function(e){return l=ye(void 0,e),this},z.getFontList=function(){var e,t,n,r={};for(e in x)if(x.hasOwnProperty(e)){r[e]=n=[];for(t in x[e])x[e].hasOwnProperty(t)&&n.push(t)}return r},z.addFont=function(e,t,n){ae(e,t,n,"StandardEncoding")},z.setLineWidth=function(e){return _((e*f).toFixed(2)+" w"),this},z.setDrawColor=function(e,t,n,r){var o;return o=void 0===t||void 0===r&&e===t===n?"string"==typeof e?e+" G":J(e/255)+" G":void 0===r?"string"==typeof e?[e,t,n,"RG"].join(" "):[J(e/255),J(t/255),J(n/255),"RG"].join(" "):"string"==typeof e?[e,t,n,r,"K"].join(" "):[J(e),J(t),J(n),J(r),"K"].join(" "),_(o),this},z.setFillColor=function(e,t,n,r){var o;return void 0===t||void 0===r&&e===t===n?o="string"==typeof e?e+" g":J(e/255)+" g":void 0===r||"object"==typeof r?(o="string"==typeof e?[e,t,n,"rg"].join(" "):[J(e/255),J(t/255),J(n/255),"rg"].join(" "),r&&0===r.a&&(o=["255","255","255","rg"].join(" "))):o="string"==typeof e?[e,t,n,r,"k"].join(" "):[J(e),J(t),J(n),J(r),"k"].join(" "),_(o),this},z.setTextColor=function(e,t,n){if("string"==typeof e&&/^#[0-9A-Fa-f]{6}$/.test(e)){var r=parseInt(e.substr(1),16);e=r>>16&255,t=r>>8&255,n=255&r}return w=0===e&&0===t&&0===n||"undefined"==typeof t?q(e/255)+" g":[q(e/255),q(t/255),q(n/255),"rg"].join(" "),this},z.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},z.setLineCap=function(e){var t=this.CapJoinStyles[e];if(void 0===t)throw new Error("Line cap style of '"+e+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return M=t,_(t+" J"),this},z.setLineJoin=function(e){var t=this.CapJoinStyles[e];if(void 0===t)throw new Error("Line join style of '"+e+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return B=t,_(t+" j"),this},z.output=Ce,z.save=function(e){z.output("save",e)};for(var Oe in n.API)n.API.hasOwnProperty(Oe)&&("events"===Oe&&n.API.events.length?!function(e,t){var n,r,o;for(o=t.length-1;-1!==o;o--)n=t[o][0],r=t[o][1],e.subscribe.apply(e,[n].concat("function"==typeof r?[r]:r))}(H,n.API.events):z[Oe]=n.API[Oe]);return se(),l="F1",he(s,i),H.publish("initialized"),z}var r="1.3",o={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};return n.API={events:[]},n.version="1.x-master","function"==typeof define&&define.amd?define("jsPDF",function(){return n}):"undefined"!=typeof module&&module.exports?module.exports=n:e.jsPDF=n,n}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this); var genPdf = function(htmlInput) { var pdf = new jsPDF('p', 'pt', 'letter') , source = htmlInput , specialElementHandlers = { } margins = { top: 0, bottom: 20, left: 30, width: 562 }; pdf.fromHTML( source // HTML string or DOM elem ref. , margins.left // x coord , margins.top // y coord , { 'width': margins.width // max width of content on PDF , 'elementHandlers': specialElementHandlers }, function (dispose) { // dispose: object with X, Y of the last line add to the PDF // this allow the insertion of new lines after html pdf.save('Take Charge at Work survey.pdf'); }, margins ) // pdf.save('PDF2.pdf'); } function getURLParam(name, url) { if (!url) { url = window.location.href; } name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, " ")); } function httpGetAsync(theUrl, callback) { var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) callback(xmlHttp.responseText); } xmlHttp.open("GET", theUrl, true); xmlHttp.send(null); } var GeneratePDF = function(destUrl) { var refNum = getURLParam('id'); var score = getURLParam('num'); var surveyJson = localStorage.getItem("jsonObj"); var reqUrl = window.location.href; var index = reqUrl.lastIndexOf('/'); var relPathStr = reqUrl.substr(index); var destUrl = reqUrl.replace(relPathStr, '/pdftemplate.html'); // var destUrl = '/content/tcaw/en/pdftemplate.html'; var reqUrl = destUrl + '?wcmmode=disabled&jsonObj=' + surveyJson + "&id=" + refNum + "&num=" + score; httpGetAsync(reqUrl, function(results){ genPdf(results); }); } // conditional for console.log() var consoleTracking = true; // -------------------------------------------------------------------------------------------------------------------- // Standard Global Page Properties Tracking // -------------------------------------------------------------------------------------------------------------------- /* Every page needs the bootstrap reference and at bare minimum, the following dataLayer and data collector properties during the page load. NOTE: Refer to updateTracking()... This function is place at the bottom of the body tag and fires on page log which triggers this function */ function updatePageDataLayer(pageName, siteSectionL1, siteSectionL2, siteSectionL3){ window.pageDataLayer = { content: { language: "en", pageName: pageName, siteSectionL1: siteSectionL1, siteSectionL2: siteSectionL2, siteSectionL3: siteSectionL3 } }; _satellite.pageBottom(); if (consoleTracking === true) { console.log("updatePageDataLayer: " + pageName); } } // -------------------------------------------------------------------------------------------------------------------- // Home Page Tracking // -------------------------------------------------------------------------------------------------------------------- /* function used for tracking specifically for the home page */ function updatePageDataLayerHomePage(pageName, businessUnit, websiteTitle, userType, loginStatus) { window.pageDataLayer = { content: { pageName: pageName, siteSectionL1: "", siteSectionL2: "", businessUnit: businessUnit, website: websiteTitle }, user: { userType: userType, loginStatus: loginStatus } }; _satellite.pageBottom(); if (consoleTracking === true) { console.log("updatePageDataLayerHomePage: " + pageName, businessUnit, websiteTitle, userType, loginStatus); } } // -------------------------------------------------------------------------------------------------------------------- // Survey Page Tracking // -------------------------------------------------------------------------------------------------------------------- /* function used for tracking specifically for the survey page */ function updatePageDataLayerSurveyPage(pageName, businessUnit, websiteTitle, referringPageSection, userType, loginStatus) { window.pageDataLayer = { content: { pageName: pageName, siteSectionL1: "", siteSectionL2: "", businessUnit: businessUnit, website: websiteTitle, referringPageSection: referringPageSection // Possible Values are banner take the assessment (or) sub menu take the assessment }, kpi: { name: "assessment", type: "1", activity: "start" }, user: { userType: userType, loginStatus: loginStatus } }; _satellite.pageBottom(); if (consoleTracking === true) { console.log("updatePageDataLayerSurveyPage: " + pageName, businessUnit, websiteTitle, userType, loginStatus); } } // -------------------------------------------------------------------------------------------------------------------- // Results Page Tracking // -------------------------------------------------------------------------------------------------------------------- /* function used for tracking specifically for the results page */ function updatePageDataLayerResultsPage(pageName, businessUnit, websiteTitle, assessmentScore, memberQualification, userType, loginStatus) { window.pageDataLayer = { content: { pageName: pageName, siteSectionL1: "", siteSectionL2: "", businessUnit: businessUnit, website: websiteTitle, assessmentScore: assessmentScore, //populate the “your score” value memberQualification: memberQualification // populate with Qualified or Not Qualified }, kpi: { name: "assessment", type: "1", activity: "complete" }, user: { userType: userType, loginStatus: loginStatus } }; _satellite.pageBottom(); if (consoleTracking === true) { console.log("updatePageDataLayerResultsPage: " + pageName, businessUnit, websiteTitle, assessmentScore, memberQualification, userType, loginStatus); } } // -------------------------------------------------------------------------------------------------------------------- // Referring Page Section Tracking // -------------------------------------------------------------------------------------------------------------------- /* If there is more than one link or button of a page that takes the user to another page or another section of the page, implement this section on the destination page/section. */ function referringPageSectionTracking(pageSection) { window.pageDataLayer = { content: { referringPageSection: pageSection // this value will change based on referring section like topnav (or) sub-menu (or) footer } }; if (consoleTracking === true) { console.log("referringPageSectionTracking: " + pageSection); } } // -------------------------------------------------------------------------------------------------------------------- // PDF Downloads Tracking // -------------------------------------------------------------------------------------------------------------------- /* When user clicks on any PDF downloads on any page please invoke the below publish post data function and update the pdfName */ function pdfDownloadTracking(value) { window.publishPostPageData('pdfdownload', { "actions": { "pdfName": value // this value will change based on the pdf downloaded } }); if (consoleTracking === true) { console.log("pdfDownloadTracking: " + value); } } // -------------------------------------------------------------------------------------------------------------------- // Click to call section Tracking // -------------------------------------------------------------------------------------------------------------------- /* When user clicks on call button on any page Please invoke below publish post data function */ function clickToCallTracking() { var target = event.target || event.srcElement; var phoneNumber = target.innerHTML; window.publishPostPageData('clickTocall', { "actions": { "linkName": "click to call", "contactUs": phoneNumber }, "user": { "userType": "member", "loginStatus": "not loggedin" } }); if (consoleTracking === true) { console.log("clickToCallTracking: " + phoneNumber); } } // -------------------------------------------------------------------------------------------------------------------- // Session Storage Stuff - keeping track of which button was clicked to take user to survey page // -------------------------------------------------------------------------------------------------------------------- function redirectToSurveyTracking(event) { // check for browser support if (typeof(Storage) !== "undefined") { // Code for localStorage/sessionStorage. if (consoleTracking === true) { console.log("session storage is supported!"); } // get the innerHTML of the the button you clicked var target = event.target || event.srcElement; if (target.getAttribute("id") === "landingHeroButton") { // Store sessionStorage.setItem("buttonClickToRedirect", "Take The Assessment - Banner Section"); } else if (target.getAttribute("id") === "ctaSectionButton") { // Store sessionStorage.setItem("buttonClickToRedirect", "Take The Assessment - Call to Action Section"); } else { // Store sessionStorage.setItem("buttonClickToRedirect", "Take The Assessment"); } } else { // Sorry! No Web Storage support.. if (consoleTracking === true) { console.log("session storage is NOT supported, sorry!"); } } } // -------------------------------------------------------------------------------------------------------------------- // mega tracking function - the force is strong with this function // -------------------------------------------------------------------------------------------------------------------- /* This guy fires on page load */ var updateTracking = function() { if (consoleTracking === true) { console.log("updateTracking"); } var pageName = ""; var siteSectionL1 = ""; var siteSectionL2 = ""; var siteSectionL3 = ""; var businessUnit = "Optum"; var websiteTitle = "take charge at work"; var userType = "member"; var loginStatus = "not loggedin"; var page = location.pathname.substring(location.pathname.lastIndexOf("/") + 1); if (page == "") { page = location.pathname; } var element = document.getElementById("pageName"); if (element != undefined) { pageName = element.value; } else { page = page.replace(".html", ""); if (page.indexOf("home") >= 0) { pageName = "Home"; updatePageDataLayerHomePage(pageName, businessUnit, websiteTitle, userType, loginStatus); } else if (page.indexOf("landing") >= 0) { pageName = "Home"; updatePageDataLayerHomePage(pageName, businessUnit, websiteTitle, userType, loginStatus); } else if (page.indexOf("survey") >= 0) { pageName = "take the assessment"; var referringPageSection = sessionStorage.getItem("buttonClickToRedirect");; updatePageDataLayerSurveyPage(pageName, businessUnit, websiteTitle, referringPageSection, userType, loginStatus) } else if (page.indexOf("results") >= 0) { pageName = "Thank you Page"; var assessmentScore = document.querySelector("#yourScore").innerHTML; var memberQualification = document.querySelector("#memberQual").value; if (memberQualification === "q") { memberQualification = "Qualified" } else { memberQualification = "Not Qualified" } updatePageDataLayerResultsPage(pageName, businessUnit, websiteTitle, assessmentScore, memberQualification, userType, loginStatus) } else if (page.indexOf("workbook") >= 0) { pageName = "creating a balance"; updatePageDataLayerHomePage(pageName, businessUnit, websiteTitle, userType, loginStatus); } else if (page.indexOf("faq") >= 0) { pageName = "Faq Page"; updatePageDataLayer(pageName, siteSectionL1, siteSectionL2, siteSectionL3); } else { pageName = page; updatePageDataLayer(pageName, siteSectionL1, siteSectionL2, siteSectionL3); } } };