(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: "Ruth", imgList: [482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,1173,1174,1187,1388,1446,1482,1484,1558,2237,1495,2313], cropped: {img_482:'hs2_189_a.jpg',img_483:'lb2_rth_01_19_a.jpg',img_484:'LLS_027_a.jpg',img_485:'LLS_040_a.jpg',img_486:'lb1_rth_02_08_a.jpg',img_487:'hs2_190_a.jpg',img_488:'hs2_191_a.jpg',img_489:'llh_012_a.jpg',img_490:'llh_218_1_a.jpg',img_491:'llh_218_2_a.jpg',img_492:'llh_219_1_a.jpg',img_493:'llh_219_2_a.jpg',img_494:'llh_241_a.jpg',img_495:'llh_272_a.jpg',img_496:'llh_308_a.jpg',img_497:'llh_309_a.jpg',img_498:'llh_386_a.jpg',img_499:'llh_387_a.jpg',img_1173:'jb_007_a.jpg',img_1174:'jb_008_a.jpg',img_1187:'jh_002_a.jpg',img_1388:'ruth_naomi1_a.jpg',img_1446:'OT_timeline2_a.jpg',img_1482:'wc_00bible_a.jpg',img_1484:'wc_00ot_a.jpg',img_1558:'wc_00ot_2histories_a.jpg',img_2237:'diagram_08_01_a.jpg',img_1495:'wc_08rth_a.jpg',img_2313:'map_08_01_a.jpg'}, thumbs: {img_482:'hs2_189_b',img_483:'lb2_rth_01_19_b',img_484:'LLS_027_b',img_485:'LLS_040_b',img_486:'lb1_rth_02_08_b',img_487:'hs2_190_b',img_488:'hs2_191_b',img_489:'llh_012_b',img_490:'llh_218_1_b',img_491:'llh_218_2_b',img_492:'llh_219_1_b',img_493:'llh_219_2_b',img_494:'llh_241_b',img_495:'llh_272_b',img_496:'llh_308_b',img_497:'llh_309_b',img_498:'llh_386_b',img_499:'llh_387_b',img_1173:'jb_007_b',img_1174:'jb_008_b',img_1187:'jh_002_b',img_1388:'ruth_naomi1_b',img_1446:'OT_timeline2_b',img_1482:'wc_00bible_b',img_1484:'wc_00ot_b',img_1558:'wc_00ot_2histories_b',img_2237:'diagram_08_01_b',img_1495:'wc_08rth_b',img_2313:'map_08_01_b'}, imgFull: {img_482:'hs2_189.jpg',img_483:'lb2_rth_01_19.jpg',img_484:'LLS_027.jpg',img_485:'LLS_040.jpg',img_486:'lb1_rth_02_08.jpg',img_487:'hs2_190.jpg',img_488:'hs2_191.jpg',img_489:'llh_012.jpg',img_490:'llh_218_1.jpg',img_491:'llh_218_2.jpg',img_492:'llh_219_1.jpg',img_493:'llh_219_2.jpg',img_494:'llh_241.jpg',img_495:'llh_272.jpg',img_496:'llh_308.jpg',img_497:'llh_309.jpg',img_498:'llh_386.jpg',img_499:'llh_387.jpg',img_1173:'jb_007.jpg',img_1174:'jb_008.jpg',img_1187:'jh_002.jpg',img_1388:'ruth_naomi1.jpg',img_1446:'OT_timeline2.jpg',img_1482:'wc_00bible.jpg',img_1484:'wc_00ot.jpg',img_1558:'wc_00ot_2histories.jpg',img_2237:'diagram_08_01.jpg',img_1495:'wc_08rth.jpg',img_2313:'map_08_01.jpg'}, imgPDF: {img_482:'',img_483:'',img_484:'',img_485:'',img_486:'',img_487:'',img_488:'',img_489:'',img_490:'',img_491:'',img_492:'',img_493:'',img_494:'',img_495:'',img_496:'',img_497:'',img_498:'',img_499:'',img_1173:'',img_1174:'',img_1187:'',img_1388:'',img_1446:'',img_1482:'wc_00bible.pdf',img_1484:'wc_00ot.pdf',img_1558:'wc_00ot_2histories.pdf',img_2237:'',img_1495:'wc_08rth.pdf',img_2313:''}, titles: {img_482:'Ruth Stays with Naomi',img_483:'Naomi Returns to Bethlehem',img_484:'Ruth and Boaz',img_485:'Boaz and Ruth',img_486:'Ruth Bowed to Boaz',img_487:'Boaz Let\'s Ruth Glean Form His Fields',img_488:'Boaz Marries Ruth',img_489:'Boaz and Ruth',img_490:'Ruth Carrying the Barley to Naomi',img_491:'Boaz Claiming Ruth as His Wife',img_492:'Ruth and Naomi Leaving Moab',img_493:'Ruth before Boaz',img_494:'Let Me Glean and Gather after the Reapers',img_495:'Ruth Speaking with Boaz',img_496:'Boaz Speaks to Ruth',img_497:'Ruth Cleaves Unto Naomi',img_498:'Naomi and Her Daughter-In-Law',img_499:'Boaz with Ruth',img_1173:'The Meeting of Boaz and Ruth',img_1174:'Ruth and Naomi',img_1187:'The First Interview of Boaz and Ruth',img_1388:'Ruth and Naomi (engraving)',img_1446:'Old Testament Time Line (Part 2 of 2)',img_1482:'The Bible - Word Cloud',img_1484:'The Old Testament - Word Cloud',img_1558:'The Histories - Word Cloud',img_2237:'Family of Ruth',img_1495:'The Book of Ruth - Word Cloud',img_2313:'The Setting of Ruth'}, paths: {img_482:'Rth',img_483:'Rth',img_484:'Rth',img_485:'Rth',img_486:'Rth',img_487:'Rth',img_488:'Rth',img_489:'Rth',img_490:'Rth',img_491:'Rth',img_492:'Rth',img_493:'Rth',img_494:'Rth',img_495:'Rth',img_496:'Rth',img_497:'Rth',img_498:'Rth',img_499:'Rth',img_1173:'brown_john',img_1174:'brown_john',img_1187:'hewlett_john',img_1388:'blb_classics',img_1446:'rosepub',img_1482:'wordclouds',img_1484:'wordclouds',img_1558:'wordclouds',img_2237:'ESV-Global-Study-Bible',img_1495:'wordclouds',img_2313:'ESV-Global-Study-Bible'}, imgKeywords: {img_482:'Ruth; Naomi;',img_483:'Naomi; Bethlehem;',img_484:'Ruth; Boaz; Field',img_485:'Ruth; Boaz; Field',img_486:'Ruth; Boaz;',img_487:'Ruth; Boaz;',img_488:'Ruth; Boaz;',img_489:'Ruth; Boaz;',img_490:'Ruth; Naomi;',img_491:'Boaz; Ruth;',img_492:'Ruth; Naomi; Moab;',img_493:'Ruth; Boaz;',img_494:'Ruth; Boaz;',img_495:'Ruth; Boaz;',img_496:'Boaz; Ruth;',img_497:'Naomi; Ruth;',img_498:'Ruth; Naomi;',img_499:'Ruth; Boaz;',img_1173:'Boaz; Ruth;',img_1174:'Naomi; Ruth;',img_1187:'Ruth; Boaz;',img_1388:'Boaz; Moab; Naomi; Ruth',img_1446:'Amos; Cyrus; David; Eli; Elijah; Elisha; Habakkuk; Haggai; Hezekiah; Hosea; Hoshea; Jeroboam; Jonah; Josiah; Judges; Malachi; Manasseh; Micah; Nahum; Nehemiah; Nineveh; Obadiah; Rebuilding the Temple; Ruth; Samuel; Saul; Solomon; Zechariah; Zephaniah',img_1482:'',img_1484:'',img_1558:'',img_2237:'Boaz; Chilion; David; Elimelech; Jesse; Mahlon; Naomi; Obed; Orpah; Ruth; Salmon',img_1495:'',img_2313:'Boaz; Israel; Moab; Naomi; Ruth'}, imgScripture: {img_482:'Rth 1:6-18',img_483:'Rth 1:19-22',img_484:'Rth 2:6-17',img_485:'Rth 2:6-17',img_486:'Rth 2:6-17',img_487:'Rth 2:6-17',img_488:'Rth 4:1-13',img_489:'Rth 2:6-17',img_490:'Rth 2:6-19',img_491:'Rth 4:1-13',img_492:'Rth 1:6-18',img_493:'Rth 2:6-17',img_494:'Rth 2:6-17',img_495:'Rth 2:6-17',img_496:'Rth 2:6-17',img_497:'Rth 1:6-18',img_498:'Rth 1:6-18',img_499:'Rth 2:6-17',img_1173:'Rut 2:1-14',img_1174:'Rut 1:5-18',img_1187:'Rth 2:1-14',img_1388:'Rth 1; Rth 2; Rth 3; Rth 4',img_1446:'Jdg 1-21; Rth 4:13; 1Sam 1-15; 2Sam 1-20; 2Ch 1-4; 2Ch 10; 2Ch 33; 1Ki 12; 1Ki 17-19; 1Ki 21; 2Ki 1-8; 2Ki 13; 2Ki 18-23; Ezr 1:1-4; Ezr 3:8-13; Ezr 4-6; Neh 1-13; Hos 1-14; Amo 1-9; Oba 1; Jon 1-4; Mic 1-7; Nah 1-3; Hab 1-3; Zep 1-3; Hag 1-2; Zec 1-14; Mal 1-4;',img_1482:'',img_1484:'',img_1558:'',img_2237:'Rth 1:2, 4; 4:10, 13, 21-22',img_1495:'',img_2313:'Ruth'}, imgDescription: {img_482:'',img_483:'',img_484:'',img_485:'',img_486:'',img_487:'',img_488:'',img_489:'',img_490:'',img_491:'',img_492:'',img_493:'',img_494:'',img_495:'',img_496:'',img_497:'',img_498:'',img_499:'',img_1173:'',img_1174:'',img_1187:'',img_1388:'',img_1446:'',img_1482:'

These Bible word clouds feature the top 150 to 300 words used in the indicated section of Scripture.

',img_1484:'

These Bible word clouds feature the top 150 to 300 words used in the indicated section of Scripture.

',img_1558:'

These Bible word clouds feature the top 150 to 300 words used in the indicated section of Scripture.

',img_2237:'
Detailed study information about this image:
Family of Ruth
',img_1495:'

These Bible word clouds feature the top 150 to 300 words used in the indicated section of Scripture.

',img_2313:'
Detailed study information about this image:
The Setting of Ruth
'}, 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); })();