function FullPic(a,b){this.sourceFile=a,this.caption=document.getElementById("ad-image").alt}function initLightbox(){var a=Array.prototype.slice.call(document.querySelectorAll(".lightbox-photo"));a.forEach(function(a){a.addEventListener("click",function(){var b=new FullPic(a.src,a.dataset.caption,a.dataset.orientation);b.open()})})}FullPic.prototype.open=function(){this.lightboxWrapper=document.createElement("div"),this.lightboxWrapper.className="lightbox-wrapper",this.lightbox=document.createElement("div");var a=document.createElement("div");a.className="overlay";var b=document.createElement("img");b.className="expanded",b.src=this.sourceFile;var c=document.createElement("div");c.className="caption";var d=document.createTextNode(this.caption);c.appendChild(d);var e=document.querySelector("#column-wrapper");this.lightbox.appendChild(a),this.lightbox.appendChild(b),this.lightbox.appendChild(c),document.body.insertBefore(this.lightboxWrapper,e),this.lightbox.style.opacity=0,this.lightboxWrapper.appendChild(this.lightbox);var f=0,g=this.lightbox,h=setInterval(function(){f<1.05?(g.style.opacity=f,f+=.05):clearInterval(h)},15),i=this;a.addEventListener("click",function(){i.close()})},FullPic.prototype.close=function(){var a=1,b=this.lightbox,c=this.lightboxWrapper,d=setInterval(function(){a>0?(b.style.opacity=a,a-=.05):(clearInterval(d),document.body.removeChild(c))},15)},window.onload=initLightbox;