(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: "Quotations", imgList: [1465,1478,1479,1480,1481,1463,1464,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1476,2000,2001,2002,2003,2004,2005,2006], cropped: {img_1465:'q_godwhohearsprayer001_a.jpg',img_1478:'q_chSpurgeon001_a.jpg',img_1479:'q_elisabethElliot001_a.jpg',img_1480:'q_jcRyle001_a.jpg',img_1481:'q_johnMacarthur001_a.jpg',img_1463:'q_meditategospel001_a.jpg',img_1464:'q_feargodman001_a.jpg',img_1466:'q_selfexistent001_a.jpg',img_1467:'q_eternality001_a.jpg',img_1468:'q_immanence001_a.jpg',img_1469:'q_holiness001_a.jpg',img_1470:'q_immutability001_a.jpg',img_1471:'q_justice001_a.jpg',img_1472:'q_omnipotence001_a.jpg',img_1473:'q_omniscience001_a.jpg',img_1474:'q_righteousness001_a.jpg',img_1475:'q_mercy001_a.jpg',img_1476:'q_omnipresence001_a.jpg',img_2000:'best_bunyan_a.jpg',img_2001:'contented_burroughs_a.jpg',img_2002:'humility_spurgeon_a.jpg',img_2003:'known_baxter_a.jpg',img_2004:'right_knowledge_spurgeon_a.jpg',img_2005:'wonder_burroughs_a.jpg',img_2006:'word_flavel_a.jpg'}, thumbs: {img_1465:'q_godwhohearsprayer001_b',img_1478:'q_chSpurgeon001_b',img_1479:'q_elisabethElliot001_b',img_1480:'q_jcRyle001_b',img_1481:'q_johnMacarthur001_b',img_1463:'q_meditategospel001_b',img_1464:'q_feargodman001_b',img_1466:'q_selfexistent001_b',img_1467:'q_eternality001_b',img_1468:'q_immanence001_b',img_1469:'q_holiness001_b',img_1470:'q_immutability001_b',img_1471:'q_justice001_b',img_1472:'q_omnipotence001_b',img_1473:'q_omniscience001_b',img_1474:'q_righteousness001_b',img_1475:'q_mercy001_b',img_1476:'q_omnipresence001_b',img_2000:'best_bunyan_b',img_2001:'contented_burroughs_b',img_2002:'humility_spurgeon_b',img_2003:'known_baxter_b',img_2004:'right_knowledge_spurgeon_b',img_2005:'wonder_burroughs_b',img_2006:'word_flavel_b'}, imgFull: {img_1465:'q_godwhohearsprayer001.jpg',img_1478:'q_chSpurgeon001.jpg',img_1479:'q_elisabethElliot001.jpg',img_1480:'q_jcRyle001.jpg',img_1481:'q_johnMacarthur001.jpg',img_1463:'q_meditategospel001.jpg',img_1464:'q_feargodman001.jpg',img_1466:'q_selfexistent001.jpg',img_1467:'q_eternality001.jpg',img_1468:'q_immanence001.jpg',img_1469:'q_holiness001.jpg',img_1470:'q_immutability001.jpg',img_1471:'q_justice001.jpg',img_1472:'q_omnipotence001.jpg',img_1473:'q_omniscience001.jpg',img_1474:'q_righteousness001.jpg',img_1475:'q_mercy001.jpg',img_1476:'q_omnipresence001.jpg',img_2000:'best_bunyan.jpg',img_2001:'contented_burroughs.jpg',img_2002:'humility_spurgeon.jpg',img_2003:'known_baxter.jpg',img_2004:'right_knowledge_spurgeon.jpg',img_2005:'wonder_burroughs.jpg',img_2006:'word_flavel.jpg'}, imgPDF: {img_1465:'',img_1478:'',img_1479:'',img_1480:'',img_1481:'',img_1463:'',img_1464:'',img_1466:'',img_1467:'',img_1468:'',img_1469:'',img_1470:'',img_1471:'',img_1472:'',img_1473:'',img_1474:'',img_1475:'',img_1476:'',img_2000:'',img_2001:'',img_2002:'',img_2003:'',img_2004:'',img_2005:'',img_2006:''}, titles: {img_1465:'Pray Earnestly (Spurgeon)',img_1478:'Metal that Forges a Christian (Spurgeon)',img_1479:'Straight Edge of Scripture (Elliot)',img_1480:'Word Is Rock (Ryle)',img_1481:'One Book Can Change Your Nature (MacArthur)',img_1463:'Never Graduate from the Gospel',img_1464:'Fear God or Fear Man',img_1466:'The Self Existent One',img_1467:'The Eternal One',img_1468:'The Immanent One',img_1469:'The Holy One',img_1470:'The Immutable One',img_1471:'The Just One',img_1472:'The Omnipotent One',img_1473:'The Omniscient One',img_1474:'The Righteous One',img_1475:'The Merciful One',img_1476:'The Omnipresent One',img_2000:'What God Says is Best (Bunyan)',img_2001:'Contented Through the Grace of God (Burroughs)',img_2002:'Humility (Spurgeon)',img_2003:'Nothing Can Be Rightly Known (Baxter)',img_2004:'Wisdom is the Right Use of Knowledge (Spurgeon)',img_2005:'Wonders at His Cross (Burroughs)',img_2006:'One Word of God (Flavel)'}, paths: {img_1465:'quotations',img_1478:'quotations',img_1479:'quotations',img_1480:'quotations',img_1481:'quotations',img_1463:'quotations',img_1464:'quotations',img_1466:'quotations',img_1467:'quotations',img_1468:'quotations',img_1469:'quotations',img_1470:'quotations',img_1471:'quotations',img_1472:'quotations',img_1473:'quotations',img_1474:'quotations',img_1475:'quotations',img_1476:'quotations',img_2000:'quotations',img_2001:'quotations',img_2002:'quotations',img_2003:'quotations',img_2004:'quotations',img_2005:'quotations',img_2006:'quotations'}, imgKeywords: {img_1465:'prayer; pharisee; christian',img_1478:'bible study; bible; metal; christian',img_1479:'word; god; straight; thinking; scripture',img_1480:'god; rock; word; sand',img_1481:'thinking; book; nature',img_1463:'christian; gospel; grace; god; trust; christ; foundation',img_1464:'fear; god; man; opposition',img_1466:'creatures; god; creator',img_1467:'god; eternal; creation',img_1468:'god; sovereign',img_1469:'holiness; god; man; incorruptible; christ',img_1470:'god; mind; characteristics; plan',img_1471:'christian; faith; christ; safety',img_1472:'god; covenant; promise; people; assurance; faithful; powerful; plan; redemption',img_1473:'god; omniscient; knowledge',img_1474:'christian; righteous; good works; christ',img_1475:'beginning; wrath; god; mercy',img_1476:'god; presence',img_2000:'god; best; men; world',img_2001:'overcome; heart; contentment',img_2002:'humility; estimate; self',img_2003:'nothing; known; god; study; purpose',img_2004:'wisdom; knowledge; wise; wisdom; fools',img_2005:'godly; man; cross',img_2006:'word; god; words; men; relief'}, imgScripture: {img_1465:'',img_1478:'',img_1479:'',img_1480:'',img_1481:'',img_1463:'',img_1464:'',img_1466:'',img_1467:'',img_1468:'',img_1469:'',img_1470:'',img_1471:'',img_1472:'',img_1473:'',img_1474:'',img_1475:'',img_1476:'',img_2000:'',img_2001:'',img_2002:'',img_2003:'',img_2004:'',img_2005:'',img_2006:''}, imgDescription: {img_1465:'',img_1478:'',img_1479:'',img_1480:'',img_1481:'',img_1463:'',img_1464:'',img_1466:'',img_1467:'',img_1468:'',img_1469:'',img_1470:'',img_1471:'',img_1472:'',img_1473:'',img_1474:'',img_1475:'',img_1476:'',img_2000:'',img_2001:'',img_2002:'',img_2003:'',img_2004:'',img_2005:'',img_2006:''}, 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); })();