(function() { window.addEventListener('resize', function(ev) { BLB.Images.vpW = BLB.getViewportWidth(); var thumbsCount = Math.floor(BLB.Images.vpW/BLB.Images.thumbWidth)-2; thumbsCount = (thumbsCount%2?thumbsCount:thumbsCount-1); if(thumbsCount != BLB.Images.thumbsCount) { for(var tmpThumbsCount=BLB.Images.thumbsCount;tmpThumbsCount<=thumbsCount;tmpThumbsCount+=2) { var thumbsHalfway = Math.ceil(tmpThumbsCount/2); if(BLB.Images.imgListHalfway-thumbsHalfway-BLB.Images.thumbDistance+1 >= 0) BLB.Images.prefetchThumbnail(BLB.Images.imgListHalfway-thumbsHalfway-BLB.Images.thumbDistance+1); if(BLB.Images.imgListHalfway+thumbsHalfway+BLB.Images.thumbDistance-1 < BLB.Images.imgList.length) BLB.Images.prefetchThumbnail(BLB.Images.imgListHalfway+thumbsHalfway+BLB.Images.thumbDistance-1); } BLB.Images.windowShift((thumbsCount-BLB.Images.thumbsCount)/2); BLB.Images.thumbsCount = thumbsCount; BLB.Images.setCarouselWindowWidth(); } }); BLB.Images = { currentThumb: null, currentImgId: null, thumbsCount: 0, thumbDistance: 3, thumbWidth: 69, imgListHalfway: 0, carouselClick: false, callBackStack: [], galleryName: "Acts of the Apostles", imgList: [1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107], cropped: {img_1084:'hs3_128_a.jpg',img_1085:'hs3_129_a.jpg',img_1086:'hs3_130_a.jpg',img_1087:'hs3_131_a.jpg',img_1088:'hs3_132_a.jpg',img_1089:'hs3_133_a.jpg',img_1090:'hs3_134_a.jpg',img_1091:'hs3_135_a.jpg',img_1092:'hs3_136_a.jpg',img_1093:'hs3_137_a.jpg',img_1094:'hs3_138_a.jpg',img_1095:'hs3_139_a.jpg',img_1096:'hs3_140_a.jpg',img_1097:'hs3_141_a.jpg',img_1098:'hs3_142_a.jpg',img_1099:'hs3_143_a.jpg',img_1100:'hs3_144_a.jpg',img_1101:'hs3_145_a.jpg',img_1102:'hs3_146_a.jpg',img_1103:'hs3_147_a.jpg',img_1104:'hs3_148_a.jpg',img_1105:'hs3_149_a.jpg',img_1106:'hs3_150_a.jpg',img_1107:'hs3_151_a.jpg'}, thumbs: {img_1084:'hs3_128_b',img_1085:'hs3_129_b',img_1086:'hs3_130_b',img_1087:'hs3_131_b',img_1088:'hs3_132_b',img_1089:'hs3_133_b',img_1090:'hs3_134_b',img_1091:'hs3_135_b',img_1092:'hs3_136_b',img_1093:'hs3_137_b',img_1094:'hs3_138_b',img_1095:'hs3_139_b',img_1096:'hs3_140_b',img_1097:'hs3_141_b',img_1098:'hs3_142_b',img_1099:'hs3_143_b',img_1100:'hs3_144_b',img_1101:'hs3_145_b',img_1102:'hs3_146_b',img_1103:'hs3_147_b',img_1104:'hs3_148_b',img_1105:'hs3_149_b',img_1106:'hs3_150_b',img_1107:'hs3_151_b'}, imgFull: {img_1084:'hs3_128.jpg',img_1085:'hs3_129.jpg',img_1086:'hs3_130.jpg',img_1087:'hs3_131.jpg',img_1088:'hs3_132.jpg',img_1089:'hs3_133.jpg',img_1090:'hs3_134.jpg',img_1091:'hs3_135.jpg',img_1092:'hs3_136.jpg',img_1093:'hs3_137.jpg',img_1094:'hs3_138.jpg',img_1095:'hs3_139.jpg',img_1096:'hs3_140.jpg',img_1097:'hs3_141.jpg',img_1098:'hs3_142.jpg',img_1099:'hs3_143.jpg',img_1100:'hs3_144.jpg',img_1101:'hs3_145.jpg',img_1102:'hs3_146.jpg',img_1103:'hs3_147.jpg',img_1104:'hs3_148.jpg',img_1105:'hs3_149.jpg',img_1106:'hs3_150.jpg',img_1107:'hs3_151.jpg'}, imgPDF: {img_1084:'',img_1085:'',img_1086:'',img_1087:'',img_1088:'',img_1089:'',img_1090:'',img_1091:'',img_1092:'',img_1093:'',img_1094:'',img_1095:'',img_1096:'',img_1097:'',img_1098:'',img_1099:'',img_1100:'',img_1101:'',img_1102:'',img_1103:'',img_1104:'',img_1105:'',img_1106:'',img_1107:''}, titles: {img_1084:'Tongues of Fire',img_1085:'Peter Heals the Lame Beggar',img_1086:'The Death of Ananias and Sapphira',img_1087:'The Sick Try to Catch Peter\'s Shadow',img_1088:'The Martyrdom of Stephen',img_1089:'The Ethiopian Eunuch Is Baptized',img_1090:'The Conversion of Saul (St. Paul)',img_1091:'Ananias Restores Saul\'s Sight',img_1092:'Peter\'s Call to the Gentiles',img_1093:'The Conversion of Cornelius',img_1094:'An Angel Frees Peter',img_1095:'The Angel of the Lord Kills Herod',img_1096:'Elymas Is Blinded',img_1097:'Paul and Barnabas Are Called Gods',img_1098:'Paul Heals a Cripple Man',img_1099:'Paul Heals a Possessed Woman',img_1100:'The Doors Are Opened and Chains Loosed',img_1101:'Paul Preaches on Mars\' Hill',img_1102:'Ephesians Burn Their Books',img_1103:'Paul Revives Eutychus',img_1104:'Agabus Predicts Paul\'s Capture',img_1105:'Paul before King Agrippa',img_1106:'Paul Is Shipwrecked',img_1107:'Paul Is Bitten by a Viper'}, paths: {img_1084:'ActsOfTheApostles',img_1085:'ActsOfTheApostles',img_1086:'ActsOfTheApostles',img_1087:'ActsOfTheApostles',img_1088:'ActsOfTheApostles',img_1089:'ActsOfTheApostles',img_1090:'ActsOfTheApostles',img_1091:'ActsOfTheApostles',img_1092:'ActsOfTheApostles',img_1093:'ActsOfTheApostles',img_1094:'ActsOfTheApostles',img_1095:'ActsOfTheApostles',img_1096:'ActsOfTheApostles',img_1097:'ActsOfTheApostles',img_1098:'ActsOfTheApostles',img_1099:'ActsOfTheApostles',img_1100:'ActsOfTheApostles',img_1101:'ActsOfTheApostles',img_1102:'ActsOfTheApostles',img_1103:'ActsOfTheApostles',img_1104:'ActsOfTheApostles',img_1105:'ActsOfTheApostles',img_1106:'ActsOfTheApostles',img_1107:'ActsOfTheApostles'}, imgKeywords: {img_1084:'Spirit; tongues;',img_1085:'Peter; beggar; lame;',img_1086:'Ananias; Sapphira; Peter;',img_1087:'Peter; sick;',img_1088:'Stephen; stoned;',img_1089:'Ethiopian; Eunuch; Philip; Esaias; baptize;',img_1090:'Saul; Paul; Damascus;',img_1091:'Saul; Paul; Ananias;',img_1092:'Peter; gentile; Cornelius;',img_1093:'Peter; Cornelius;',img_1094:'Peter; Herod;',img_1095:'Herod; worms;',img_1096:'Barjesus; Elymas; Paul;',img_1097:'Paul; Barnabas;',img_1098:'Paul; Barnabas;',img_1099:'Paul; Silas;',img_1100:'Paul; Silas;',img_1101:'Paul; Mars;',img_1102:'Paul; Ephesians;',img_1103:'Paul; Eutychus;',img_1104:'Paul; Agabus;',img_1105:'Paul; Agrippa; Festus',img_1106:'Paul;',img_1107:'Paul; viper;'}, imgScripture: {img_1084:'Act 2:1-11',img_1085:'Act 3:1-26',img_1086:'Act 5:1-11',img_1087:'Act 5:12-16',img_1088:'Act 7:54-60',img_1089:'Act 8:26-40',img_1090:'Act 9:1-9',img_1091:'Act 9:10-19',img_1092:'Act 10:9-20',img_1093:'Act 10:21-48',img_1094:'Act 12:5-11',img_1095:'Act 12:21-23',img_1096:'Act 13:8-12',img_1097:'Act 14:11-20',img_1098:'Act 14:8-20',img_1099:'Act 16:16-24',img_1100:'Act 16:24-28',img_1101:'Act 17:16-34',img_1102:'Act 19:13-20',img_1103:'Act 20:7-12',img_1104:'Act 21:10-14',img_1105:'Act 25:13-27; Act 26:1-32',img_1106:'Act 27:6-44',img_1107:'Act 28:1-6'}, imgDescription: {img_1084:'',img_1085:'',img_1086:'',img_1087:'',img_1088:'',img_1089:'',img_1090:'',img_1091:'',img_1092:'',img_1093:'',img_1094:'',img_1095:'',img_1096:'',img_1097:'',img_1098:'',img_1099:'',img_1100:'',img_1101:'',img_1102:'',img_1103:'',img_1104:'',img_1105:'',img_1106:'',img_1107:''}, init: function() { if(BLB.blbIsLoaded) { YEvent.delegate("imgCarousel", "click", BLB.Images.onClickHndlr, "div"); YEvent.delegate("imgParade", "click", BLB.Images.onClickHndlr, "div.imgParBrowse"); YEvent.delegate("imgBody", "click", BLB.Images.onClickHndlr, "div"); YEvent.delegate("imgBody", "click", BLB.Images.onClickHndlr, "img"); YEvent.delegate("imgShareLinks", "click", BLB.Images.onClickHndlr, "img"); YEvent.delegate("imgLegend", "click", BLB.Images.onClickHndlr, "a[class=imgpop]"); lftRtArrow = new KeyListener(document, {shift:false, ctrl:false, alt:false, keys:[BLB.keyCodes.leftArrow, BLB.keyCodes.rightArrow]}, function(ev, evA) { if(evA[1].target.tagName == 'INPUT') return false; if(evA[1].target.tagName == 'TEXTAREA') return false; if(BLB.Images.imgList.length > 1) { var currentImg = document.querySelector('#' + BLB.Images.currentImgId); switch(evA[0]) { case BLB.keyCodes.leftArrow: var nextState = BLB.Images.thumbs[currentImg.previousSibling.id]; BLB.Images.historyNavigate(nextState); break; case BLB.keyCodes.rightArrow: var nextState = BLB.Images.thumbs[currentImg.nextSibling.id]; BLB.Images.historyNavigate(nextState); break; default: break; }; } }, 'keydown'); lftRtArrow.enable(); window.addEventListener('popstate', BLB.Images.popstateEventHandler); var state = BLB.Images.getBookmarkedState(); if(state.toLowerCase() == 'imagedisplay' && document.location.hash != '') { var h = document.location.hash.split(/=/)[1]; document.location.href = document.location.pathname + h; } var distance = 0; var thumbsCount = 0; var imgCount = BLB.Images.imgList.length; var imgListHalfway = Math.floor(imgCount/2); for(var thumb in BLB.Images.thumbs) { if(state == BLB.Images.thumbs[thumb]) { BLB.Images.currentThumb = state; BLB.Images.currentImgId = thumb; break; } distance++; } BLB.Images.vpW = BLB.getViewportWidth(); thumbsCount = Math.floor(BLB.Images.vpW/BLB.Images.thumbWidth)-2; BLB.Images.thumbsCount = (thumbsCount%2?thumbsCount:thumbsCount-1); BLB.Images.imgListHalfway = (imgCount%2?imgListHalfway:imgListHalfway-1); BLB.Images.setCarouselWidth(); BLB.Images.setCarouselWindowWidth(); var imgCarousel = document.querySelector('#imgCarousel'); imgCarousel.style.left = '-12px'; if(BLB.Images.imgListHalfway > distance) for(var i=0;i 1) { var nextState = BLB.Images.thumbs[currentImg.nextSibling.id]; BLB.Images.historyNavigate(nextState); } else if(matchedEl.id == 'imgNavL' && BLB.Images.imgList.length > 1) { var nextState = BLB.Images.thumbs[currentImg.previousSibling.id]; BLB.Images.historyNavigate(nextState); } else if(matchedEl.id == 'imgExact' || matchedEl.id == 'imgZoom') { var fullImg = BLB.Images.imgFull[BLB.Images.currentImgId]; var path = BLB.Images.paths[BLB.Images.currentImgId]; location.href = '/assets-v3/images/bibleMedia/' + path + '/' + fullImg; } break; case 'imgCarousel': if(BLB.Images.imgList.length > 1) if(matchedEl.classList.contains('imgParCenter')) { var nextState = BLB.Images.thumbs[currentImg.nextSibling.id]; BLB.Images.historyNavigate(nextState); } else { var nextState = BLB.Images.thumbs[matchedEl.id]; BLB.Images.historyNavigate(nextState); } break; case 'imgParade': if(BLB.Images.imgList.length > 1) if(matchedEl.id=='imgParBrowseRt') { var nextState = BLB.Images.thumbs[currentImg.nextSibling.id]; BLB.Images.historyNavigate(nextState); } else { var nextState = BLB.Images.thumbs[currentImg.previousSibling.id]; BLB.Images.historyNavigate(nextState); } break; case 'imgShareLinks': if (matchedEl.dataset !== undefined && matchedEl.dataset.sharer !== undefined) { var platform = matchedEl.dataset.sharer; if (platform == 'shareLink') { document.querySelector('#pageLink').click(); document.querySelector('#imgShareFeedback').innerHTML = "

Please click on the [COPY] button at the top of this page to copy a link to this image.
"; setTimeout(function() { document.querySelector('#imgShareFeedback').innerHTML = ""; }, 7000); } else if (platform == 'shareEmail') { var email=('<>'); var subject = ('An image from Blue Letter Bible'); var body = 'I wanted to share this wonderful image with you: '+window.location.href; var emailLink = document.createElement('a'); emailLink.href = 'mailto:' + email+'?subject=' +subject+'&body=' +body; emailLink.target = '_blank'; emailLink.click(); } else { BLB.sharePage(platform); } } break; case 'imgLegend': var linkName = matchedEl.rel; var param = location.href; var popupDiv = document.querySelector('#popupDiv'); document.querySelector('#popupDivContents').innerHTML = BLB.popupDivContents; popupDiv.classList.remove('hidden'); popupDiv.style.width = '500px'; BLB.setXY(matchedEl, popupDiv); BLB.toolTipPopup(linkName, param); YEvent.stopPropagation(ev); break; default: break; }; }, slideCarouselWindow: function(direction, count) { var thisThumb = document.querySelector('#' + BLB.Images.currentImgId); var nextThumb = (direction=='left' ? thisThumb.nextSibling : thisThumb.previousSibling); var thumbsHalfway = Math.ceil(BLB.Images.thumbsCount/2); var imgCarousel = document.querySelector('#imgCarousel'); var thumbWidth = parseInt(imgCarousel.style.width, 10); var thumbMarginLeft = parseInt(imgCarousel.style.marginLeft, 10); var windowDistance = 69 * (direction=='left'?-1:1); var imgCarouselLeft = parseInt(imgCarousel.style.left, 10); var imgCarouselKeyFrames = new KeyframeEffect(imgCarousel, [ { left: (imgCarouselLeft + windowDistance) + 'px' } ], 100 ); var imgCarouselKeyAnimation = new Animation(imgCarouselKeyFrames, document.timeline); imgCarouselKeyAnimation.addEventListener("finish", () => { imgCarouselKeyAnimation.commitStyles(); if(direction=='left') { imgCarousel.appendChild(imgCarousel.firstChild) BLB.Images.imgList.push(BLB.Images.imgList.shift()); if (thumbsHalfway+BLB.Images.thumbDistance <= BLB.Images.imgListHalfway) BLB.Images.prefetchThumbnail(BLB.Images.imgListHalfway+thumbsHalfway+BLB.Images.thumbDistance); } else { imgCarousel.insertBefore(imgCarousel.lastChild, imgCarousel.firstChild) BLB.Images.imgList.unshift(BLB.Images.imgList.pop()); if (thumbsHalfway+BLB.Images.thumbDistance <= BLB.Images.imgListHalfway) BLB.Images.prefetchThumbnail(BLB.Images.imgListHalfway-thumbsHalfway-BLB.Images.thumbDistance); } if(count > 1) BLB.Images.slideCarouselWindow(direction, --count); else if(BLB.Images.callBackStack.length > 0) BLB.Images.slideCarouselWindowCaller(); else BLB.Images.updateImgMainBody() }); imgCarouselKeyAnimation.play(); thisThumb.classList.remove('imgParCenter'); nextThumb.classList.add('imgParCenter'); BLB.Images.currentImgId = nextThumb.id; BLB.Images.currentThumb = BLB.Images.thumbs[BLB.Images.currentImgId]; }, slideCarouselWindowCaller: function() { var state = BLB.Images.callBackStack.shift(); var ill = BLB.Images.imgList.length; var direction = 'left'; var count = 0; for(var i=0;i 0) { if(thumbState == BLB.Images.currentThumb || thumbState == state) break; count++; } else if(thumbState == BLB.Images.currentThumb) { direction='left'; count++; } else if (thumbState == state) { direction='right'; count++; } } BLB.Images.slideCarouselWindow(direction, count); }, updateImgMainBody: function() { var title = BLB.Images.titles[BLB.Images.currentImgId]; var cropped = BLB.Images.cropped[BLB.Images.currentImgId]; var path = BLB.Images.paths[BLB.Images.currentImgId]; var imgSrc = '/assets-v3/images/bibleMedia/'+path+'/' + cropped; var tmpImg = document.createElement('img'); var imgWidth = 72; var imgHeight = 0; var metaDescTemplate = "Image from the {galleryName} gallery. Images for {scripture} are provided by the Blue Letter Bible and its partner ministries." var imgDataTitle = document.querySelector('#imgDataTitle'); var imgRespTitle = document.querySelector('#imgTitle_Resp'); var imgDataCr = document.querySelector('#imgDataCr'); var imgDataSe = document.querySelector('#imgDataSe'); var imgDataSrc = document.querySelector('#imgDataSrc'); var imgDataBtn = document.querySelector('#imgDataBtn'); var imgDataDesc = document.querySelector('#imgDataDesc'); var imgDataBtn = document.querySelector('#imgDataBtn'); var scripturesA = BLB.Images.imgScripture[BLB.Images.currentImgId].replace(/(^\s*|;?\s*$)/g, '').replace(/(\d);([a-zA-Z])/g, '$1; $2'); var keywordsA = BLB.Images.imgKeywords[BLB.Images.currentImgId].replace(/(^\s*|;?\s*$)/g, ''); var b = null; pb = null; var c = null; var v = null; var v1 = null; var bid = null; keywordsA = (keywordsA==''?[]:keywordsA.split(/;/)); tmpImg.src = imgSrc; imgDataBtn.addEventListener('mouseover', function() { var img = this.firstChild; img.src = img.src.replace(/_a\.svg/, '_b.svg'); }); imgDataBtn.addEventListener('mouseout', function() { var img = this.firstChild; img.src = img.src.replace(/_b\.svg/, '_a.svg'); }); tmpImg.addEventListener('load', function() { document.querySelector('#imgTitle').innerHTML = title; document.querySelector('#imgTitle_Resp').innerHTML = title; // Update title and meta data tags var metaDesc = metaDescTemplate; metaDesc = metaDesc.replace('{galleryName}', BLB.Images.galleryName).replace('{scripture}', title); document.title = title +' - '+ BLB.Images.galleryName; document.head.querySelector("meta[name='Description']").content = metaDesc; document.head.querySelector("meta[property='og:title']").content = document.title; document.head.querySelector("meta[property='og:description']").content = metaDesc; document.head.querySelector("meta[property='og:image']").content = 'https://www.blueletterbible.org/assets-v3/images/bibleMedia/' + path + '/' + BLB.Images.thumbs[BLB.Images.currentImgId] + '.jpg'; document.querySelector('#imgExact').innerHTML = ''; document.querySelector('#imgPrint').firstChild.src = imgSrc; imgDataDesc.innerHTML = ''; imgDataCr.innerHTML = ''; imgDataSe.innerHTML = ''; imgDataSrc.innerHTML = ''; imgDataTitle.innerHTML = title; imgRespTitle.innerHTML = title; var imgLinks = document.querySelector('#imgLinks'); var imgDesc = BLB.Images.imgDescription[BLB.Images.currentImgId]; var imgDataDescP = document.querySelector('#imgDataDescP'); var imgDataDescTop = document.querySelector('#imgDataDescTop'); var imgDesc = BLB.Images.imgDescription[BLB.Images.currentImgId]; imgDataDescTop.style.display='none'; imgDataDescTop.innerHTML=''; imgDataDescP.style.display='none'; var showDescOnTop = false; if (path == "ESV-Global-Study-Bible") {showDescOnTop = true} if (imgDesc.length > 0) { if (showDescOnTop == true) { imgDataDescTop.style.display="block"; imgDataDescTop.innerHTML = imgDesc; } else { imgDataDescP.style.display="block"; imgDataDesc.innerHTML = imgDesc; } } var imgDataCrP = document.querySelector('#imgDataCrP'); if(scripturesA.length == 0) { imgDataCrP.style.display="none"; } else { imgDataCrP.style.display="block"; imgDataCr.innerHTML = scripturesA; BLB.Tagger.walkDomTree(imgDataCr); } var imgDataSeP = document.querySelector('#imgDataSeP'); if(keywordsA.length == 0) { imgDataSeP.style.display="none"; } else { imgDataSeP.style.display="block"; for(var i=0;iDownload PDF
'; }); BLB.Images.carouselClick=false; if(!BLB.firstLoad) BLB.Menu.evDispatch({event: 'page_view'}); // Tell Google about the page_view change due to AJAX call BLB.firstLoad = false; }, windowShift: function(count) { var imgCarousel = document.querySelector('#imgCarousel'); var windowLeft = parseInt(imgCarousel.style.left, 10); imgCarousel.style.left = windowLeft + (BLB.Images.thumbWidth*count) + 'px'; }, setCarouselWidth: function() { var imgCarousel = document.querySelector('#imgCarousel'); var carouselWidth = BLB.Images.imgList.length*BLB.Images.thumbWidth+15+9+78; imgCarousel.style.width = carouselWidth+'px'; }, setCarouselWindowWidth: function() { var imgCarouselWindow = document.querySelector('#imgCarouselWindow'); var carouselWindowWidth = BLB.Images.thumbsCount*BLB.Images.thumbWidth+15; imgCarouselWindow.style.width = carouselWindowWidth+'px'; }, prefetchThumbnail: function(thmbPos) { var imgCarousel = document.querySelector('#imgCarousel'); var thumbDiv = imgCarousel.children[thmbPos]; if(thumbDiv != undefined) { var imgKey = thumbDiv.id; var thumber = BLB.Images.thumbs[imgKey]; var thumbsCount = Math.floor(BLB.Images.vpW/BLB.Images.thumbWidth)-2; thumbsCount = (thumbsCount%2?thumbsCount:thumbsCount-1); thumber = thumber.replace(/.$/, 'd'); thumbDiv.firstChild.src = '/assets-v3/images/bibleMedia/' + BLB.Images.paths[imgKey] + '/' + thumber + '.jpg'; } }, getBookmarkedState: function() { var pathname = document.location.pathname.replace(/\/+$/, ''); var pa = pathname.split(/\//); var state = pa[pa.length-1]; return state; }, getHistoryState: function() { var historyState = history.state; var state = null; if(historyState != undefined) state = historyState.state; return state; }, historyNavigate: function(state) { if(BLB.Images.carouselClick) return false; BLB.Images.carouselClick=true; var pathname = document.location.pathname.replace(/\/+$/, ''); var pa = pathname.split(/\//); pa.pop(); pa.push(state); history.replaceState({state:state}, null, pa.join('/')); BLB.Images.sectionStateChangeHandler(state); }, sectionStateChangeHandler: function(state) { BLB.Images.callBackStack.push(state); BLB.Images.slideCarouselWindowCaller(); }, popstateEventHandler: function(ev) { var state = ev.state; BLB.Images.sectionStateChangeHandler(state.state); } }; YEvent.onDOMReady(BLB.Images.init, BLB.Images.init, true); })();