(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: "Micah",
imgList: [929,1265,1315,1374,1446,1482,1484,1520,1560,1659,1688,1735,1746,1748,1752,1922,2232,2327,2359],
cropped: {img_929:'hs2_310_d.jpg',img_1265:'tgb_067_a.jpg',img_1315:'llh_232_a.jpg',img_1374:'miriams_song1_a.jpg',img_1446:'OT_timeline2_a.jpg',img_1482:'wc_00bible_a.jpg',img_1484:'wc_00ot_a.jpg',img_1520:'wc_33mic_a.jpg',img_1560:'wc_00ot_4prophets_a.jpg',img_1659:'c03_a.jpg',img_1688:'c32_a.jpg',img_1735:'c79_a.jpg',img_1746:'perkins_a.jpg',img_1748:'c02_a.jpg',img_1752:'c06_a.jpg',img_1922:'2019_calendar_mic_5_2b_nkjv_a.jpg',img_2232:'chart_07_02_a.jpg',img_2327:'map_12_06_a.jpg',img_2359:'map_33_01_a.jpg'},
thumbs: {img_929:'hs2_310d_b',img_1265:'tgb_067_b',img_1315:'llh_232_b',img_1374:'miriams_song1_b',img_1446:'OT_timeline2_b',img_1482:'wc_00bible_b',img_1484:'wc_00ot_b',img_1520:'wc_33mic_b',img_1560:'wc_00ot_4prophets_b',img_1659:'c03_b',img_1688:'c32_b',img_1735:'c79_b',img_1746:'perkins_b',img_1748:'c02_b',img_1752:'c06_b',img_1922:'2019_calendar_mic_5_2b_nkjv_b',img_2232:'chart_07_02_b',img_2327:'map_12_06_b',img_2359:'map_33_01_b'},
imgFull: {img_929:'hs2_310.jpg',img_1265:'tgb_067.jpg',img_1315:'llh_232.jpg',img_1374:'miriams_song1.jpg',img_1446:'OT_timeline2.jpg',img_1482:'wc_00bible.jpg',img_1484:'wc_00ot.jpg',img_1520:'wc_33mic.jpg',img_1560:'wc_00ot_4prophets.jpg',img_1659:'c03.jpg',img_1688:'c32.jpg',img_1735:'c79.jpg',img_1746:'perkins.jpg',img_1748:'c02.jpg',img_1752:'c06.jpg',img_1922:'2019_calendar_mic_5_2b_nkjv.jpg',img_2232:'chart_07_02.jpg',img_2327:'map_12_06.jpg',img_2359:'map_33_01.jpg'},
imgPDF: {img_929:'',img_1265:'',img_1315:'',img_1374:'',img_1446:'',img_1482:'wc_00bible.pdf',img_1484:'wc_00ot.pdf',img_1520:'wc_33mic.pdf',img_1560:'wc_00ot_4prophets.pdf',img_1659:'',img_1688:'',img_1735:'',img_1746:'perkins_17x11.pdf',img_1748:'',img_1752:'',img_1922:'',img_2232:'',img_2327:'',img_2359:''},
titles: {img_929:'Micah',img_1265:'The Great Prophets Appear in Judah',img_1315:'Beating the Swords into Plowshares',img_1374:'Miriam\'s Song (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_1520:'Micah - Word Cloud',img_1560:'The Prophets - Word Cloud',img_1659:'"The Perspective of Prophecy"',img_1688:'Regeneration',img_1735:'The Mysteries',img_1746:'Bible Prophecy, God\'s Order of Events',img_1748:'The Mountain Peaks of Prophecy',img_1752:'Time Element of the First and Second Comings',img_1922:'Micah 5:2b (NKJV)',img_2232:'Common Cycle for Each Judge',img_2327:'Prophets of Israel and Judah',img_2359:'The Near East at the Time of Micah'},
paths: {img_929:'Prophets',img_1265:'TheGraphicBible',img_1315:'Mic',img_1374:'blb_classics',img_1446:'rosepub',img_1482:'wordclouds',img_1484:'wordclouds',img_1520:'wordclouds',img_1560:'wordclouds',img_1659:'larkin',img_1688:'larkin',img_1735:'larkin',img_1746:'eschatalogical',img_1748:'eschatalogical',img_1752:'eschatalogical',img_1922:'calendar',img_2232:'ESV-Global-Study-Bible',img_2327:'ESV-Global-Study-Bible',img_2359:'ESV-Global-Study-Bible'},
imgKeywords: {img_929:'Micah',img_1265:'Prophet; Judah; Isaiah; Jeremiah; Zephaniah; Amos; Micah; Isaiah; Anathoth; Jerusalem; Tekoa; Maresheth-Gath; Kingdom; Divided',img_1315:'Isaiah; plowshares; swords;',img_1374:'Miriam; Timbrel',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_1520:'',img_1560:'',img_1659:'Glory;Moses;Prophet;Babylon;Captivity;Exile;Jew;Church;Nations;Millennium;Satan;Armageddon;Judgment',img_1688:'Regeneration;Restitution;Age;Jacob;Ladder;Earth;Fire;Jerusalem;City;Perfect;Baptism',img_1735:'Mystery;Saint;Bride;Christ;Incarnation;Divine;Indwelling;Israel;Iniquity;Babylon;Kingdom',img_1746:'Prophecy;Event;Judgment;Seat;Christ;Crown;Righteousness;Incorruptible;Martyr;Glory;Crucifixion;Church;Earth;Abraham;Paradise;Hades;Sheol;Eternal;Torment;Abyss;Millennium;Kingdom;Marriage;Supper;Lamb;Throne;Jerusalem;Curse;Satan;Lake;Fire;Death',img_1748:'Mountain;Prophecy;Prophet;Priest;Three;King;Glory;Coming;First;Second;Valley;Church;Perfect;Age;New;Heavens;Earth;Old;Testament;Lord;Supper',img_1752:'Coming;Time;Element;Birth;Bethlehem;King;Jerusalem;Suffering;Fulfillment;Isaiah;Dispensation;Glory;Revelation',img_1922:'ruler; Israel; everlasting',img_2232:'apostasy; judge; salvation; servitude; supplication',img_2327:'Ahijah; Amos; Elijah; Elisha; Haggai; Hosea; Isaiah; Israel; Jehu; Jeremiah; Jonah; Judah; Malachi; Micah; Nahum; prophets; Zechariah; Zephaniah',img_2359:'Assyria; Israel; Jerusalem; Judah; King Hezekiah; Micah; prophecy; Samaria'},
imgScripture: {img_929:'Mic 1:1',img_1265:'2Ch 11:6; Jer 1:1; Jer 6:1; Jer 11:21-23; Jer 29:25-27; Jer 32:7-9; Amo 1:1; Mic 1:1; Mic 1:10; Zep 1:1;',img_1315:'Isa 2:4; Mic 4:3',img_1374:'Exd 15:1-21; Mic 6: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_1520:'',img_1560:'',img_1659:'Deu 4:27-31;Deu 18:15,18;Deu 30:1-10;Isa 2:2-4;Isa 2:19-21;Isa 6:1;Isa 7:14;Isa 9:6-7;Isa 11:1-3;Isa 11:4-5;Isa 11:4-10;Isa 11:11-16;Isa 14:4-20;Isa 35:1-10;Isa 50:6;Isa 53:1-12;Isa 60:8-16;Isa 60:18-22;Isa 63:1-6;Isa 65:17;Isa 66:22;Jer 3:18;Jer 16:14-15;Jer 23:3-8;Jer 25:11;Jer 31:8;Jer 31:15;Jer 31:27-34;Eze 20:40-44;Eze 28:11-19;Eze 34:11-28;Eze 36:24-32;Eze 36:35-38;Eze 37:1-28;Eze 40:1-48:35;Dan 2:31-45;Dan 7:9-14;Dan 7:19-27;Dan 9:24-27;Dan 9:26;Hos 6:1-2;Joe 2:1-11;Joe 2:21-27;Joe 2:28-32;Joe 3:1-17;Joe 3:18-21;Zep 3:8;Amo 9:11-12;Amo 9:13-15;Mic 4:1-7;Mic 5:2;Habakkuk 2:14;Zep 3:20;Hag 2:8-9;Zec 8:3-4;Zec 11:12-13;Zec 11:15-17;Zec 12:9-14;Zec 14:1-3;Zec 14:4-11;Zec 14:16-21;Mal 3:1-3;Mal 4:1-6;Mat 16:18;Mat 24:15-22;Mat 24:29-30;Mat 25:31-46;Jhn 5:43;Jhn 16:7-15;2Pe 3:5-13;Rev 18:1-8;Rev 19:17-21;Rev 19:17-21;Rev 20:4-6;Rev 20:7-10;Rev 20:11;Rev 21:11;Rev 21:1-22:5',img_1688:'Gen 28:10-15;Isa 11:6-9;Isa 35:1-2;Isa 65:17;Isa 66:22-23;Mic 4:4;Jhn 1:51;2Pe 3:7-13;Rev 21:1;Rev 21:24',img_1735:'Dan 7:13-14;Mic 4:1-4;Zec 14:4;Mat 13:1-52;Luk 1:30-33;Jhn 1:1, 14;Act 1:9-12;Act 3:19-21;Rom 11:25;1Co 15:24-28;1Co 15:51;Gal 2:20;Eph 1:9-10;Eph 3:3-6;Eph 5:25-32;Col 1:26-27;1Th 4:16-17;2Th 2:7-9;1Ti 3:16;2Pe 3:7-13;Rev 17:3-5;Rev 19:7-9;Rev 21:1-2;Rev 21:9-10;Rev 21:24',img_1746:'Isa 9:6-7; Isa 11:6-10; Jer 30:7; Eze 37:27-28; Dan 9:26; Dan 9:27; Dan 11:36-45; Dan 12:2; Joe 3:9-17; Mic 4:2-4; Zec 14:3-5; Mat 12:40; Mat 13:14; Mat 16:21; Mat 20:19; Mat 20:21; Mat 24:3-14; Mat 24:15-21; Mat 25:46; Mat 28:1-7; Mar 9:44, 46, 48; Mar 13:4-23; Luk 1:31-33; Luk 1:32-33; Luk 16:22; Luk 16:23; Luk 16:23-31; Luk 16:26; Luk 21:7-28; Luk 21:36; Luk 22:29-30; Luk 23:33; Luk 24:25-27; Luk 24:44:47; Jhn 3:36; Jhn 5:28-29; Jhn 14:1-3; Jhn 14:2; Act 1:9-11; Act 1:10-11; Act 2:1-18; Act 24:15; Rom 5:9; Rom 11:8-11; Rom 11:26-27; Rom 14:10; 1Co 3:8-17; 1Co 9:24-25; 1Co 15:50-56; 2Co 5:10-11; Gal 1:4; Eph 5:26-27; 1Th 1:10; 1Th 2:19; 1Th 4:13-18; 1Th 4:14-16; 1Th 5:9; 2Th 1:7-10; 2Th 2:1-12; 1Ti 4:1-5; 2Ti 3:1-17; 2Ti 4:8; Heb 11:6-8; Heb 12:22-23; 1Pe 5:4; 2Pe 2:4; 2Pe 3:1-7; 2Pe 3:7-14; 2Pe 3:13; 1Jo 5:19; Jde 6; Rev 1:6; Rev 2:10; Rev 2:11; Rev 5:10; Rev 6:1-8; Rev 6:16-17; Rev 12:7-12; Rev 13:1-18; Rev 14:10-11; Rev 16:12-16; Rev 19:7-9; Rev 19:20; Rev 20:1-3; Rev 20:1-6; Rev 20:5-6; Rev 20:7-8; Rev 20:7-9; Rev 20:8-10; Rev 20:10; Rev 20:11-15; Rev 20:14; Rev 20:15; Rev 21:1; Rev 21:1-27; Rev 21:8; Rev 22:1-5; Rev 22:2; Rev 22:3; Rev 22:14',img_1748:'Lev 23:24;Num 10:1-10;Num 24:17;Deu 18:15;Isa 2:1-3;Isa 7:14;Isa 53:1-12;Isa 61:2;Isa 61:1-2;Isa 65:17;Isa 66:22;Jer 23:5;Jer 23:5-6;Eze 40:1-48:35;Dan 7:13-14;Dan 7:19-27;Dan 8:23-25;Joe 2:28-29;Amo 9:14-15;Mic 4:1-2;Mic 5:2;Hag 2:5-9;Zec 9:9;Zec 14:4;Zec 14:4;Zec 8:3-4;Zec 14:20-21;Mal 4:1-6;Mat 24:29-31;Luk 4:17-21;Act 1:9-12;Act 1:10-12;Act 2:1-4;Act 2:16-18;1Co 5:7-8;1Co 11:26;1Co 15:51-52;1Th 4:16-18;Tit 2:11-13;Heb 4:14;Heb 9:24;Heb 9:25-26;Heb 9:28;1Pe 1:10-12;2Pe 1:19-21;2Pe 3:7-13;Rev 21:1;Rev 21:2;Rev 21:24;Rev 22:16',img_1752:'Isa 9:6;Isa 9:7;Isa 11:1-4;Isa 11:4;Jer 23:5;Jer 23:5-6;Mic 5:2;Zec 9:9;Mat 2:5-6;Mat 21:4-5;1Th 4:16-17;2Th 1:7-8;1Pe 1:10-11',img_1922:'Mic 5:2 NKJV',img_2232:'2Sa 22:3, 47; Psa 18:2, 46; Psa 25:5; Psa 27:9; Psa 51:14; Psa 62:1; Psa 74:12; Psa 88:1; Psa 89:26; Isa 61:10; Jer 2:19; Lam 1:3; Hos 14:4; Mic 7:7; Hab 3:18; Eph 6:18; Phl 4:6',img_2327:'2 Kings; Amos; Haggai; Hosea; Isaiah; Jeremiah; Jonah; Malachi; Micah; Nahum; Zechariah; Zephaniah',img_2359:'Micah'},
imgDescription: {img_929:'',img_1265:'',img_1315:'',img_1374:'',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_1520:'These Bible word clouds feature the top 150 to 300 words used in the indicated section of Scripture.
',img_1560:'These Bible word clouds feature the top 150 to 300 words used in the indicated section of Scripture.
',img_1659:'',img_1688:'',img_1735:'',img_1746:'',img_1748:'',img_1752:'',img_1922:'',img_2232:'',img_2327:'',img_2359:''},
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);
}
// Resize left/right expand controls to fit image area
setTimeout(function() {
let lefty = document.querySelector('#siteExpandLeft');
let righty = document.querySelector('#siteExpandRight');
let imgBody = document.querySelector('.bubBody.imgBody');
if (lefty && righty && imgBody) {
let height = parseInt(imgBody.getBoundingClientRect().height);
if (!isNaN(height) && height > 145) {
lefty.style.maxHeight = height + 37 + 'px';
righty.style.maxHeight = height + 37 + 'px';
}
}
}, 500)
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);
})();