(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: "John Hewlett's", imgList: [1186,1187,1188,1190,1191,1192,1193,1194,1197,1198,1199,1201,1202,1204,1205,1206,1208,1209,1210,1211,1212,1213,1215,1216,1218,1219,1220,1221,1222], cropped: {img_1186:'jh_001_a.jpg',img_1187:'jh_002_a.jpg',img_1188:'jh_003_a.jpg',img_1190:'jh_005_a.jpg',img_1191:'jh_006_a.jpg',img_1192:'jh_007_a.jpg',img_1193:'jh_008_a.jpg',img_1194:'jh_009_a.jpg',img_1197:'jh_012_a.jpg',img_1198:'jh_013_a.jpg',img_1199:'jh_014_a.jpg',img_1201:'jh_016_a.jpg',img_1202:'jh_018_a.jpg',img_1204:'jh_020_a.jpg',img_1205:'jh_021_a.jpg',img_1206:'jh_022_a.jpg',img_1208:'jh_024_a.jpg',img_1209:'jh_025_a.jpg',img_1210:'jh_026_a.jpg',img_1211:'jh_027_a.jpg',img_1212:'jh_028_a.jpg',img_1213:'jh_029_a.jpg',img_1215:'jh_031_a.jpg',img_1216:'jh_032_a.jpg',img_1218:'jh_034_a.jpg',img_1219:'jh_035_a.jpg',img_1220:'jh_036_a.jpg',img_1221:'jh_037_a.jpg',img_1222:'jh_038_a.jpg'}, thumbs: {img_1186:'jh_001_b',img_1187:'jh_002_b',img_1188:'jh_003_b',img_1190:'jh_005_b',img_1191:'jh_006_b',img_1192:'jh_007_b',img_1193:'jh_008_b',img_1194:'jh_009_b',img_1197:'jh_012_b',img_1198:'jh_013_b',img_1199:'jh_014_b',img_1201:'jh_016_b',img_1202:'jh_018_b',img_1204:'jh_020_b',img_1205:'jh_021_b',img_1206:'jh_022_b',img_1208:'jh_024_b',img_1209:'jh_025_b',img_1210:'jh_026_b',img_1211:'jh_027_b',img_1212:'jh_028_b',img_1213:'jh_029_b',img_1215:'jh_031_b',img_1216:'jh_032_b',img_1218:'jh_034_b',img_1219:'jh_035_b',img_1220:'jh_036_b',img_1221:'jh_037_b',img_1222:'jh_038_b'}, imgFull: {img_1186:'jh_001.jpg',img_1187:'jh_002.jpg',img_1188:'jh_003.jpg',img_1190:'jh_005.jpg',img_1191:'jh_006.jpg',img_1192:'jh_007.jpg',img_1193:'jh_008.jpg',img_1194:'jh_009.jpg',img_1197:'jh_012.jpg',img_1198:'jh_013.jpg',img_1199:'jh_014.jpg',img_1201:'jh_016.jpg',img_1202:'jh_018.jpg',img_1204:'jh_020.jpg',img_1205:'jh_021.jpg',img_1206:'jh_022.jpg',img_1208:'jh_024.jpg',img_1209:'jh_025.jpg',img_1210:'jh_026.jpg',img_1211:'jh_027.jpg',img_1212:'jh_028.jpg',img_1213:'jh_029.jpg',img_1215:'jh_031.jpg',img_1216:'jh_032.jpg',img_1218:'jh_034.jpg',img_1219:'jh_035.jpg',img_1220:'jh_036.jpg',img_1221:'jh_037.jpg',img_1222:'jh_038.jpg'}, imgPDF: {img_1186:'',img_1187:'',img_1188:'',img_1190:'',img_1191:'',img_1192:'',img_1193:'',img_1194:'',img_1197:'',img_1198:'',img_1199:'',img_1201:'',img_1202:'',img_1204:'',img_1205:'',img_1206:'',img_1208:'',img_1209:'',img_1210:'',img_1211:'',img_1212:'',img_1213:'',img_1215:'',img_1216:'',img_1218:'',img_1219:'',img_1220:'',img_1221:'',img_1222:''}, titles: {img_1186:'Judah Carried Away Captive',img_1187:'The First Interview of Boaz and Ruth',img_1188:'Nathan Rebuking David',img_1190:'The Queen of Sheba\'s Visit',img_1191:'Elijah\'s Burnt Sacrifice',img_1192:'Moses Pulled from the Water',img_1193:'The Cluster of Grapes',img_1194:'Moses Strikes the Rock and Water Flows',img_1197:'Jacob Going to Bethel "puts Away the Strange Gods"',img_1198:'Joseph\'s Brethren Offering Their Present',img_1199:'Joseph\'s Cup Found in Benjamin\'s Sack',img_1201:'Jacob Blessing the Sons of Joseph',img_1202:'Noah\'s Sacrifice after the Flood',img_1204:'Abraham Refusing the Spoils',img_1205:'Abraham and the Three Angels',img_1206:'The Dismissal of the Hagar and Ishmael',img_1208:'Hagar and Ishmael',img_1209:'Abraham Offering Isaac',img_1210:'Rebekah at the Well',img_1211:'Isaac Blessing Jacob',img_1212:'Isaac and Esau',img_1213:'Jacob Expostulating with Laban',img_1215:'Samuel Anointing David',img_1216:'The Death of Saul',img_1218:'Elisha Restores the Shunammite\'s Son to Life',img_1219:'King Ahasuerus and Esther',img_1220:'The Triumph of Mordecai',img_1221:'Joseph Interpreting Pharaoh\'s Dream',img_1222:'The Translation of Elijah'}, paths: {img_1186:'hewlett_john',img_1187:'hewlett_john',img_1188:'hewlett_john',img_1190:'hewlett_john',img_1191:'hewlett_john',img_1192:'hewlett_john',img_1193:'hewlett_john',img_1194:'hewlett_john',img_1197:'hewlett_john',img_1198:'hewlett_john',img_1199:'hewlett_john',img_1201:'hewlett_john',img_1202:'hewlett_john',img_1204:'hewlett_john',img_1205:'hewlett_john',img_1206:'hewlett_john',img_1208:'hewlett_john',img_1209:'hewlett_john',img_1210:'hewlett_john',img_1211:'hewlett_john',img_1212:'hewlett_john',img_1213:'hewlett_john',img_1215:'hewlett_john',img_1216:'hewlett_john',img_1218:'hewlett_john',img_1219:'hewlett_john',img_1220:'hewlett_john',img_1221:'hewlett_john',img_1222:'hewlett_john'}, imgKeywords: {img_1186:'Judah; Babylon; Hamath; Riblah;',img_1187:'Ruth; Boaz;',img_1188:'David; Nathan; Bathsheba;',img_1190:'Solomon; Sheba;',img_1191:'Elijah; Carmel;',img_1192:'Moses; Jochebed; Amram; Miriam;',img_1193:'spy;',img_1194:'Horeb; Moses;',img_1197:'Jacob; Bethel;',img_1198:'Joseph;',img_1199:'Joseph; Benjamin; cup;',img_1201:'Jacob; Joseph; Manasseh; Ephraim;',img_1202:'Noah; flood; ark; rainbow; bow;',img_1204:'Abraham; Sodom;',img_1205:'Abraham; Sarah;',img_1206:'Ishmael; Hagar;',img_1208:'Hagar; Ishmael;',img_1209:'Abraham; Isaac;',img_1210:'Rebekah; Isaac; Abraham;',img_1211:'Isaac; Jacob;',img_1212:'Isaac; Esau;',img_1213:'Jacob; Laban; Leah; Rachel;',img_1215:'Samuel; David; anointed; ',img_1216:'Saul;',img_1218:'Shunammite; Elisha;',img_1219:'Ahasuerus; Esther;',img_1220:'Mordecai;',img_1221:'Joseph; pharaoh;',img_1222:'Elijah; chariot; Elisha;'}, imgScripture: {img_1186:'2Ki 25:8-21',img_1187:'Rth 2:1-14',img_1188:'2Sa 12:1-14',img_1190:'1Ki 10:1-13',img_1191:'1Ki 18:1-46',img_1192:'Exd 2:1-10',img_1193:'Num 13:1-33',img_1194:'Exd 17:1-7',img_1197:'Gen 35:1-7',img_1198:'Gen 43:1-34',img_1199:'Gen 44:1-34',img_1201:'Gen 48:1-22; Gen 49:1-33',img_1202:'Gen 8:1-22',img_1204:'Gen 14:21-24',img_1205:'Gen 18:1-15',img_1206:'Gen 21:9-21',img_1208:'Gen 21:14-21',img_1209:'Gen 22:1-19; Hbr 11:17-19; Jam 2:21-24',img_1210:'Gen 24:1-61',img_1211:'Gen 27:5-29',img_1212:'Gen 27:30-40',img_1213:'Gen 29:1-30',img_1215:'1Sa 16:1-13',img_1216:'1Sa 31:1-7',img_1218:'2Ki 4:18-37',img_1219:'Est 5:1-5',img_1220:'Est 6:1-12',img_1221:'Gen 41:1-46',img_1222:'2Ki 2:1-13'}, imgDescription: {img_1186:'',img_1187:'',img_1188:'',img_1190:'',img_1191:'',img_1192:'',img_1193:'',img_1194:'',img_1197:'',img_1198:'',img_1199:'',img_1201:'',img_1202:'',img_1204:'',img_1205:'',img_1206:'',img_1208:'',img_1209:'',img_1210:'',img_1211:'',img_1212:'',img_1213:'',img_1215:'',img_1216:'',img_1218:'',img_1219:'',img_1220:'',img_1221:'',img_1222:''}, 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); })();