(function(){window.detail=function(){utils.main();}})();if(!Element.prototype.closest){Element.prototype.closest=function(s){var el=this;do{if(Element.prototype.matches.call(el,s))return el;el=el.parentElement||el.parentNode;}while(el!==null&&el.nodeType===1);return null;};}
var utils={main:function(){this.jsDetect();this.imgZoom();this.navSearch();this.lazyHtml();},jsDetect:function(){document.getElementsByTagName("html")[0].classList.remove("no-js");},imgZoom:function(){var container=document.querySelector(".story__text");var lightboxID="gd-lightbox";if(container){document.addEventListener("click",function(e){if(e.target&&e.target.matches(".inline-photo img")){var imgSrc=e.target.currentSrc||e.target.src;var lightbox=document.createElement('div');lightbox.id=lightboxID;lightbox.innerHTML='
';container.appendChild(lightbox);}
if(e.target.matches("#"+lightboxID)||e.target.matches("#"+lightboxID+" img")){var node=document.getElementById(lightboxID);if(node.parentNode){node.parentNode.removeChild(node);}}});}},navSearch:function(){var searchButton=document.getElementById('mainNavSearchButton');var searchForm=document.getElementById('mainNavSearchForm');if(searchButton&&searchForm){searchButton.addEventListener('click',function(){this.classList.toggle('is-visible');searchForm.classList.toggle('is-visible');},false);}},lazyHtml:function(){try{var targets=document.querySelectorAll('.lazy-html');var io=new IntersectionObserver(function(entries,observer){entries.forEach(function(entry){if(entry.intersectionRatio>0){xhrLoader(entry.target);observer.unobserve(entry.target);}});},{rootMargin:"0px 0px 500px 0px"});for(i=0;i