function getComponentValue(n){return n!=null&&n.indexOf("=")>-1?n.split("=")[1]:""}function openRegisterForCommentModal(){$("#registerCommentReveal").foundation("reveal","open")}function openRegisterForCMEModal(){$("#registerCMEReveal").foundation("reveal","open")}function initInstitutionOpenUrl(){SCM&&SCM.InstitutionOpenUrl?SCM.InstitutionOpenUrl.init():console.error&&console.error("InstitutionOpenUrl is undefined")}function hidePubMedIfDuplicate(){$(".ref-content").each(function(){var n=$(this),t=n.find(".pub-id-ref:eq(1)");t&&t.length>0&&n.find(".pub-id-ref:eq(0)").css("display","none")})}var charactersToExclude=/[[\]{}()*+?\\^$|#]/g,addthis_share;$(function(){var s,u,f,a;if(window.location.hash.indexOf("#start")>-1&&window.location.hash.indexOf("#end")>-1){var o=location.hash.split("#"),i=decodeURIComponent(getComponentValue(o[1])).replace(charactersToExclude,""),r=decodeURIComponent(getComponentValue(o[2])).replace(charactersToExclude,""),n=$("div.para:contains('"+i+"')");n.length||(n=$("section.para:contains('"+r+"')")),n.length||(n=$("section.sec:contains('"+i+"')")),n.length||(n=$("section.sec:contains('"+r+"')")),s=$(n).html().replace(new RegExp(i,"gi"),'<b style="background-color:#ff0;font-size:100%">$&').replace(new RegExp(r,"gi"),"$&<\/b>"),$(n).html(s),u=$(n).parent().prev("a").attr("id"),u!=null?location.hash="#"+u:(f=$('[style^="background-color:#ff0"]'),f.length&&$(f).get(0).scrollIntoView())}var h="div#journalClubReferencesAuthorsPlaceHolder",e=$("#jc-articles-authors"),v=$(h),y=$("#hfArticleType").val();e.length&&v.length&&y==="ACP Journal Club"&&(e.appendTo(h),e.show(),$(".js-article-top-widget").find(".js-article-authors").hide()),$("#hfIsGraphicMedicine").length&&$("#hfIsGraphicMedicine").val()==="true"&&$(".content-image:visible").each(function(n,t){var i=$(t),r;i.addClass("graphic-medimg"),r=i.closest(".figure-image"),r.addClass("graphic-med"),$(".original-slide:visible").hide()});var t=$("div#divFrontExtra"),c="div#divFrontExtraPlaceholder",l=$(c);t.length&&l.length&&t.children.length>0&&(t.detach().appendTo(c),t.show(),l.show());$(".article-nav-trigger").find("a").on("click",function(){var n=$(this).text(),t=n+" was clicked ";this.ActionType=new ActionType(1,"Tabs"),this.UserSessionItem=new UserSessionItem("<%=Session.SessionID %>",0,0),doTracking(this.ActionType,t.toString(),"<%=System.DateTime.Now %>",this.UserSessionItem,ActionURL)});$("a.supplementary-material").on("click",function(n){n.preventDefault(),$(".supplements-trigger").trigger("click")});$("#pdfLink").on("click",function(){this.UserSessionItem=new UserSessionItem("<%=Session.SessionID %>",0,0),this.ActionType=new ActionType(1,"ToolBox"),doTracking(this.ActionType,"linkPDF was Clicked".toString(),"<%=System.DateTime.Now %>",this.UserSessionItem,ActionURL,"sync")});$("#SupplementalTab").find("a").on("click",function(){window.ga("send","event","PDF","click",$(this).attr("href"),"0")});$(".js-full-text-btn").on("click",function(){var n=$(this).attr("data-url");n&&n.length>0?window.location.href=n:($("#noAccessToArticleReveal").foundation("reveal","open"),$(".js-abstract-only").css("display","block"))});$(".js-visual-abstract-btn").on("click",function(){var n=$(this).attr("data-url");n&&n.length>0?window.open(n):($("#noAccessToArticleReveal").foundation("reveal","open"),$(".js-abstract-only").css("display","block"))});initInstitutionOpenUrl(),hidePubMedIfDuplicate(),a=location.href.split("#")[1]||"";switch(a){case"visualabstract":$("#noAccessToArticleReveal").length===0&&$(".div-visualabstract-desktop .js-visual-abstract-btn").trigger("click")}}),addthis_share={url_transforms:{shorten:{twitter:"bitly"}},shorteners:{bitly:{}}}