diff --git a/biblerefparsingtests.html b/biblerefparsingtests.html
new file mode 100644
index 00000000..d000051c
--- /dev/null
+++ b/biblerefparsingtests.html
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ The Bible with Strong's Numbers and Cross References
+
+
+
+
+
+
+
+
+
diff --git a/js/bible_ref_parsing.js b/js/bible_ref_parsing.js
index 237996ad..97650f0f 100644
--- a/js/bible_ref_parsing.js
+++ b/js/bible_ref_parsing.js
@@ -1,504 +1,633 @@
-//
-// This code was written by Jason Wall. Feel free to use, and if you can, include a link back to www.walljm.com
-// Jason@walljm.com // www.walljm.com
-//
-
-
-function Reference(bibleRef) {
- bibleRef = bibleRef.toLowerCase();
- var bibleNames = new Object;
- var book = bibleRef.substring(0, bibleRef.search(/\s\d/i));
-
- if (book.search(/\b(genesis|gen|ge|gn)\b/i) != -1) {
- this.book = 1;
- this.bookname = "Genesis";
- this.longbookname = "Genesis";
- this.lastchapter = 50;
- }
- if (book.search(/\b(exodus|ex|exo|exod|exd)\b/i) != -1) {
- this.book = 2;
- this.bookname = "Exodus";
- this.longbookname = "Exodus";
- this.lastchapter = 40;
- }
- if (book.search(/\b(leviticus|lev|le|levi|lv)\b/i) != -1) {
- this.book = 3;
- this.bookname = "Leviticus";
- this.longbookname = "Leviticus";
- this.lastchapter = 27;
- }
- if (book.search(/\b(numbers|num|nu|numb|number)\b/i) != -1) {
- this.book = 4;
- this.bookname = "Numbers";
- this.longbookname = "Book_of_Numbers";
- this.lastchapter = 36;
- }
- if (book.search(/\b(deuteronomy|deut|de|dt|deu)\b/i) != -1) {
- this.book = 5;
- this.bookname = "Deuteronomy";
- this.longbookname = "Deuteronomy";
- this.lastchapter = 34;
- }
- if (book.search(/\b(joshua|josh|jos)\b/i) != -1) {
- this.book = 6;
- this.bookname = "Joshua";
- this.longbookname = "Book_of_Joshua";
- this.lastchapter = 24;
- }
- if (book.search(/\b(judges|jud|ju|jdg|judg)\b/i) != -1) {
- this.book = 7;
- this.bookname = "Judges";
- this.longbookname = "Book_of_Judges";
- this.lastchapter = 21;
- }
- if (book.search(/\b(ruth|ru)\b/i) != -1) {
- this.book = 8;
- this.bookname = "Ruth";
- this.longbookname = "Book_of_Ruth";
- this.lastchapter = 4;
- }
- if (book.search(/\b(1|i|1st|first)\s*(samuel|sa|sam|sml)\b/i) != -1) {
- this.book = 9;
- this.bookname = "1 Samuel";
- this.longbookname = "First_Samuel";
- this.lastchapter = 31;
- }
- if (book.search(/\b(2|ii|2nd|second|sec)\s*(samuel|sa|sam|sml)\b/i) != -1) {
- this.book = 10;
- this.bookname = "2 Samuel";
- this.longbookname = "Second_Samuel";
- this.lastchapter = 24;
- }
- if (book.search(/\b(1|i|1st|first)\s*(kings|king|kgs|kn|k|ki)\b/i) != -1) {
- this.book = 11;
- this.bookname = "1 Kings";
- this.longbookname = "First_Kings";
- this.lastchapter = 22;
- }
- if (book.search(/\b(2|ii|2nd|second|sec)\s*(kings|king|kgs|kn|k|ki)\b/i) != -1) {
- this.book = 12;
- this.bookname = "2 Kings";
- this.longbookname = "Second_Kings";
- this.lastchapter = 25;
- }
- if (book.search(/\b(1|i|1st|first)\s*(chronicles|chron|ch|chr)\b/i) != -1) {
- this.book = 13;
- this.bookname = "1 Chronicles";
- this.longbookname = "First_Chronicles";
- this.lastchapter = 29;
- }
- if (book.search(/\b(2|ii|2nd|second|sec)\s*(chronicles|chron|ch|chr)\b/i) != -1) {
- this.book = 14;
- this.bookname = "2 Chronicles";
- this.longbookname = "Second_Chronicles";
- this.lastchapter = 36;
- }
- if (book.search(/\b(ezra|ez|ezr)\b/i) != -1) {
- this.book = 15;
- this.bookname = "Ezra";
- this.longbookname = "Book_of_Ezra";
- this.lastchapter = 10;
- }
- if (book.search(/\b(nehemiah|neh|ne|nehamiah)\b/i) != -1) {
- this.book = 16;
- this.bookname = "Nehemiah";
- this.longbookname = "Book_of_Nehemiah";
- this.lastchapter = 13;
- }
- if (book.search(/\b(esther|est|es|esth)\b/i) != -1) {
- this.book = 17;
- this.bookname = "Esther";
- this.longbookname = "Book_of_Esther";
- this.lastchapter = 10;
- }
- if (book.search(/\b(job|jo|jb)\b/i) != -1) {
- this.book = 18;
- this.bookname = "Job";
- this.longbookname = "Book_of_Job";
- this.lastchapter = 42;
- }
- if (book.search(/\b(psalms|ps|psa|psalm|psm)\b/i) != -1) {
- this.book = 19;
- this.bookname = "Psalm";
- this.longbookname = "Psalm";
- this.lastchapter = 150;
- }
- if (book.search(/\b(proverbs|prov|pr|pro|proverb|prv|prvbs)\b/i) != -1) {
- this.book = 20;
- this.bookname = "Proverbs";
- this.longbookname = "Book_of_Proverbs";
- this.lastchapter = 31;
- }
- if (book.search(/\b(ecclesiastes|eccl|ecc|eccles|ec|ecl|ecclesiaste)\b/i) != -1) {
- this.book = 21;
- this.bookname = "Ecclesiastes";
- this.longbookname = "Ecclesiastes";
- this.lastchapter = 12;
- }
- if (book.search(/\b(song\sof\ssolomon|song\sof\ssongs|sos|ss|son|so|song|songs)\b/i) != -1) {
- this.book = 22;
- this.bookname = "Song of Solomon";
- this.longbookname = "Song_of_Solomon";
- this.lastchapter = 8;
- }
- if (book.search(/\b(isaiah|is|is|isah|isai|ia)\b/i) != -1) {
- this.book = 23;
- this.bookname = "Isaiah";
- this.longbookname = "Book_of_Isaiah";
- this.lastchapter = 66;
- }
- if (book.search(/\b(jerimiah|jeremiah|jer|je|jere)\b/i) != -1) {
- this.book = 24;
- this.bookname = "Jeremiah";
- this.longbookname = "Book_of_Jeremiah";
- this.lastchapter = 52;
- }
- if (book.search(/\b(lamentations|lam|la|lamentation)\b/i) != -1) {
- this.book = 25;
- this.bookname = "Lamentations";
- this.longbookname = "Book_of_Lamentations";
- this.lastchapter = 5;
- }
- if (book.search(/\b(ezekiel|eze|ez|ezk|ezek)\b/i) != -1) {
- this.book = 26;
- this.bookname = "Ezekiel";
- this.longbookname = "Book_of_Ezekiel";
- this.lastchapter = 48;
- }
- if (book.search(/\b(daniel|dan|dn|dl|da)\b/i) != -1) {
- this.book = 27;
- this.bookname = "Daniel";
- this.longbookname = "Book_of_Daniel";
- this.lastchapter = 12;
- }
- if (book.search(/\b(hosea|hos|ho)\b/i) != -1) {
- this.book = 28;
- this.bookname = "Hosea";
- this.longbookname = "Book_of_Hosea";
- this.lastchapter = 14;
- }
- if (book.search(/\b(joel|joe|jl)\b/i) != -1) {
- this.book = 29;
- this.bookname = "Joel";
- this.longbookname = "Book_of_Joel";
- this.lastchapter = 3;
- }
- if (book.search(/\b(amos|am|amo)\b/i) != -1) {
- this.book = 30;
- this.bookname = "Amos";
- this.longbookname = "Book_of_Amos";
- this.lastchapter = 9;
- }
- if (book.search(/\b(obadiah|oba|ob|obad)\b/i) != -1) {
- this.book = 31;
- this.bookname = "Obadiah";
- this.longbookname = "Book_of_Obadiah";
- this.lastchapter = 1;
- }
- if (book.search(/\b(jonah|jnh|jon)\b/i) != -1) {
- this.book = 32;
- this.bookname = "Jonah";
- this.longbookname = "Book_of_Jonah";
- this.lastchapter = 4;
- }
- if (book.search(/\b(micah|mic|mi)\b/i) != -1) {
- this.book = 33;
- this.bookname = "Micah";
- this.longbookname = "Book_of_Micah";
- this.lastchapter = 7;
- }
- if (book.search(/\b(nahum|nah|na)\b/i) != -1) {
- this.book = 34;
- this.bookname = "Nahum";
- this.longbookname = "Book_of_Nahum";
- this.lastchapter = 3;
- }
- if (book.search(/\b(habakkuk|hab|ha|habakuk)\b/i) != -1) {
- this.book = 35;
- this.bookname = "Habakkuk";
- this.longbookname = "Book_of_Habakkuk";
- this.lastchapter = 3;
- }
- if (book.search(/\b(zephaniah|zeph|zep)\b/i) != -1) {
- this.book = 36;
- this.bookname = "Zephaniah";
- this.longbookname = "Book_of_Zephaniah";
- this.lastchapter = 3;
- }
- if (book.search(/\b(haggia|hag|hg|haggai)\b/i) != -1) {
- this.book = 37;
- this.bookname = "Haggai";
- this.longbookname = "Book_of_Haggai";
- this.lastchapter = 2;
- }
- if (book.search(/\b(zechariah|zech|zch|zec)\b/i) != -1) {
- this.book = 38;
- this.bookname = "Zechariah";
- this.longbookname = "Book_of_Zechariah";
- this.lastchapter = 14;
- }
- if (book.search(/\b(malachi|mal)\b/i) != -1) {
- this.book = 39;
- this.bookname = "Malachi";
- this.longbookname = "Book_of_Malachi";
- this.lastchapter = 4;
- }
- if (book.search(/\b(matthew|mt|matt|mat)\b/i) != -1) {
- this.book = 40;
- this.bookname = "Matthew";
- this.longbookname = "Gospel_of_Matthew";
- this.lastchapter = 28;
- }
- if (book.search(/\b(mark|mrk|mk|mr)\b/i) != -1) {
- this.book = 41;
- this.bookname = "Mark";
- this.longbookname = "Gospel_of_Mark";
- this.lastchapter = 16;
- }
- if (book.search(/\b(luke|lu|lke|luk|lk)\b/i) != -1) {
- this.book = 42;
- this.bookname = "Luke";
- this.longbookname = "Gospel_of_Luke";
- this.lastchapter = 24;
- }
- if (book.search(/\b(john|jn|jhn)\b/i) != -1) {
- this.book = 43;
- this.bookname = "John";
- this.longbookname = "Gospel_of_John";
- this.lastchapter = 21;
- }
- if (book.search(/\b(acts|ac|act)\b/i) != -1) {
- this.book = 44;
- this.bookname = "Acts";
- this.longbookname = "Acts_of_the_Apostles";
- this.lastchapter = 28;
- }
- if (book.search(/\b(romans|rom|ro|rm|roman)\b/i) != -1) {
- this.book = 45;
- this.bookname = "Romans";
- this.longbookname = "Epistle_to_the_Romans";
- this.lastchapter = 16;
- }
- if (book.search(/\b(1|i|1st|first)\s*(corinthian|cor|corinthians|corinth|corin|corth|corint)\b/i) != -1) {
- this.book = 46;
- this.bookname = "1 Corinthians";
- this.longbookname = "First_Epistle_to_the_Corinthians";
- this.lastchapter = 16;
- }
- if (book.search(/\b(2|ii|2nd|second|sec)\s*(corinthian|cor|corinthians|corinth|corin|corth|corint)\b/i) != -1) {
- this.book = 47;
- this.bookname = "2 Corinthians";
- this.longbookname = "Second_Epistle_to_the_Corinthians";
- this.lastchapter = 13;
- }
- if (book.search(/\b(galatians|galatian|galations|gal|ga|gala|galation|galat)\b/i) != -1) {
- this.book = 48;
- this.bookname = "Galatians";
- this.longbookname = "Epistle_to_the_Galatians";
- this.lastchapter = 6;
- }
- if (book.search(/\b(ephesians|eph|ep|ephes|ephe|ephs)\b/i) != -1) {
- this.book = 49;
- this.bookname = "Ephesians";
- this.longbookname = "Epistle_to_the_Ephesians";
- this.lastchapter = 6;
- }
- if (book.search(/\b(philippians|phi|phil|ph|philip)\b/i) != -1) {
- this.book = 50;
- this.bookname = "Philippians";
- this.longbookname = "Epistle_to_the_Philippians";
- this.lastchapter = 4;
- }
- if (book.search(/\b(colossians|col|co|colossian|colos|coloss)\b/i) != -1) {
- this.book = 51;
- this.bookname = "Colossians";
- this.longbookname = "Epistle_to_the_Colossians";
- this.lastchapter = 4;
- }
- if (book.search(/\b(1|i|1st|first)\s*(thessalonians|the|thessa|thessalonian|thes|thess|th)\b/i) != -1) {
- this.book = 52;
- this.bookname = "1 Thessalonians";
- this.longbookname = "First_Epistle_to_the_Thessalonians";
- this.lastchapter = 5;
- }
- if (book.search(/\b(2|ii|2nd|second|sec)\s*(thessalonians|the|thessa|thessalonian|thes|thess|th)\b/i) != -1) {
- this.book = 53;
- this.bookname = "2 Thessalonians";
- this.longbookname = "Second_Epistle_to_the_Thessalonians";
- this.lastchapter = 3;
- }
- if (book.search(/\b(1|i|1st|first)\s*(timothy|tim|ti|timoth|tm)\b/i) != -1) {
- this.book = 54;
- this.bookname = "1 Timothy";
- this.longbookname = "First_Epistle_to_Timothy";
- this.lastchapter = 6;
- }
- if (book.search(/\b(2|ii|2nd|second|sec)\s*(timothy|tim|timoth|tm)\b/i) != -1) {
- this.book = 55;
- this.bookname = "2 Timothy";
- this.longbookname = "Second_Epistle_to_Timothy";
- this.lastchapter = 4;
- }
- if (book.search(/\b(titus|tit)\b/i) != -1) {
- this.book = 56;
- this.bookname = "Titus";
- this.longbookname = "Epistle_to_Titus";
- this.lastchapter = 3;
- }
- if (book.search(/\b(philemon|phlmn|phl|phm|phile|philem)\b/i) != -1) {
- this.book = 57;
- this.bookname = "Philemon";
- this.longbookname = "Epistle_to_Philemon";
- this.lastchapter = 1;
- }
- if (book.search(/\b(hebrews|heb|he|hebrew)\b/i) != -1) {
- this.book = 58;
- this.bookname = "Hebrews";
- this.longbookname = "Epistle_to_the_Hebrews";
- this.lastchapter = 13;
- }
- if (book.search(/\b(james|jam|ja|jas|jms|jame|jm)\b/i) != -1) {
- this.book = 59;
- this.bookname = "James";
- this.longbookname = "Epistle_of_James";
- this.lastchapter = 5;
- }
- if (book.search(/\b(1|i|1st|first)\s*(peter|pe|pet|pete|pt|p)\b/i) != -1) {
- this.book = 60;
- this.bookname = "1 Peter";
- this.longbookname = "First_Epistle_of_Peter";
- this.lastchapter = 5;
- }
- if (book.search(/\b(2|ii|2nd|second|sec)\s*(peter|pe|pet|pete|pt|p)\b/i) != -1) {
- this.book = 61;
- this.bookname = "2 Peter";
- this.longbookname = "Second_Epistle_of_Peter";
- this.lastchapter = 3;
- }
- if (book.search(/\b(1|i|1st|first)\s*(john|jn|jo)\b/i) != -1) {
- this.book = 62;
- this.bookname = "1 John";
- this.longbookname = "First_Epistle_of_John";
- this.lastchapter = 5;
- }
- if (book.search(/\b(2|ii|2nd|second|sec)\s*(john|jn|jo)\b/i) != -1) {
- this.book = 63;
- this.bookname = "2 John";
- this.longbookname = "Second_Epistle_of_John";
- this.lastchapter = 1;
- }
- if (book.search(/\b(3|iii|3rd|third)\s*(john|jn|jo)\b/i) != -1) {
- this.book = 64;
- this.bookname = "3 John";
- this.longbookname = "Third_Epistle_of_John";
- this.lastchapter = 1;
- }
- if (book.search(/\b(jude|jud|ju)\b/i) != -1) {
- this.book = 65;
- this.bookname = "Jude";
- this.longbookname = "Epistle_of_Jude";
- this.lastchapter = 1;
- }
- if (book.search(/\b(revelation|rev|re|revelations|rv)\b/i) != -1) {
- this.book = 66;
- this.bookname = "Revelation";
- this.longbookname = "Book_of_Revelations";
- this.lastchapter = 22;
- }
- var chvs = bibleRef.substring(bibleRef.search(/\s\d/)+1, bibleRef.length);
-
- if (chvs.search(":") == -1) {
- this.chapter = parseInt(chvs.substring(chvs.search(/\s\d\s/) +1,chvs.length));
- this.startverse = 1;
- this.endverse = "*";
- } else {
- this.chapter = parseInt(chvs.substring(chvs.search(/\s\d\:/) +1, chvs.search(":")));
- var vss = chvs.substring(chvs.search(":") + 1, chvs.length);
-
- if (vss.search("-") != -1) {
- this.startverse = parseInt(vss.substring(0, vss.search("-")));
- var ev = vss.substring(vss.search("-") + 1, vss.length);
- if (ev != "*") {
- this.endverse = parseInt(ev);
- } else {
- this.endverse = ev;
- }
- } else {
- this.startverse = parseInt(vss);
- this.endverse = parseInt(vss);
- }
- }
-}
-
-function bookName(booknum) {
- var book = new Array();
- book[0] = "";
- book[1] = "Genesis";
- book[2] = "Exodus";
- book[3] = "Leviticus";
- book[4] = "Numbers";
- book[5] = "Deuteronomy";
- book[6] = "Joshua";
- book[7] = "Judges";
- book[8] = "Ruth";
- book[9] = "1 Samuel";
- book[10] = "2 Samuel";
- book[11] = "1 Kings";
- book[12] = "2 Kings";
- book[13] = "1 Chronicles";
- book[14] = "2 Chronicles";
- book[15] = "Ezra";
- book[16] = "Nehemiah";
- book[17] = "Esther";
- book[18] = "Job";
- book[19] = "Psalm";
- book[20] = "Proverbs";
- book[21] = "Ecclesiastes";
- book[22] = "Song of Songs";
- book[23] = "Isaiah";
- book[24] = "Jeremiah";
- book[25] = "Lamentations";
- book[26] = "Ezekiel";
- book[27] = "Daniel";
- book[28] = "Hosea";
- book[29] = "Joel";
- book[30] = "Amos";
- book[31] = "Obadiah";
- book[32] = "Jonah";
- book[33] = "Micah";
- book[34] = "Nahum";
- book[35] = "Habakkuk";
- book[36] = "Zephaniah";
- book[37] = "Haggai";
- book[38] = "Zechariah";
- book[39] = "Malachi";
- book[40] = "Matthew";
- book[41] = "Mark";
- book[42] = "Luke";
- book[43] = "John";
- book[44] = "Acts";
- book[45] = "Romans";
- book[46] = "1 Corinthians";
- book[47] = "2 Corinthians";
- book[48] = "Galatians";
- book[49] = "Ephesians";
- book[50] = "Philippians";
- book[51] = "Colossians";
- book[52] = "1 Thessalonians";
- book[53] = "2 Thessalonians";
- book[54] = "1 Timothy";
- book[55] = "2 Timothy";
- book[56] = "Titus";
- book[57] = "Philemon";
- book[58] = "Hebrews";
- book[59] = "James";
- book[60] = "1 Peter";
- book[61] = "2 Peter";
- book[62] = "1 John";
- book[63] = "2 John";
- book[64] = "3 John";
- book[65] = "Jude";
- book[66] = "Revelation";
-
- return book[booknum];
-}
+//
+// This code was written by Jason Wall. Feel free to use, and if you can, include a link back to www.walljm.com
+// Jason@walljm.com // www.walljm.com
+//
+
+String.prototype.trim = function()
+{
+ return this.replace(/^\s+|\s+$/g, "");
+}
+String.prototype.ltrim = function()
+{
+ return this.replace(/^\s+/, "");
+}
+String.prototype.rtrim = function()
+{
+ return this.replace(/\s+$/, "");
+}
+
+function Reference(ref)
+{
+ ref = ref.toLowerCase().trim();
+ var bibleNames = new Object;
+ var book = ref.substring(0, ref.search(/\s\d/i));
+
+ if (book.search(/\b(genesis|gen|ge|gn)\b/i) != -1)
+ {
+ this.book = 1;
+ this.bookname = "Genesis";
+ this.longbookname = "Genesis";
+ this.lastchapter = 50;
+ }
+ if (book.search(/\b(exodus|ex|exo|exod|exd)\b/i) != -1)
+ {
+ this.book = 2;
+ this.bookname = "Exodus";
+ this.longbookname = "Exodus";
+ this.lastchapter = 40;
+ }
+ if (book.search(/\b(leviticus|lev|le|levi|lv)\b/i) != -1)
+ {
+ this.book = 3;
+ this.bookname = "Leviticus";
+ this.longbookname = "Leviticus";
+ this.lastchapter = 27;
+ }
+ if (book.search(/\b(numbers|num|nu|numb|number)\b/i) != -1)
+ {
+ this.book = 4;
+ this.bookname = "Numbers";
+ this.longbookname = "Book_of_Numbers";
+ this.lastchapter = 36;
+ }
+ if (book.search(/\b(deuteronomy|deut|de|dt|deu)\b/i) != -1)
+ {
+ this.book = 5;
+ this.bookname = "Deuteronomy";
+ this.longbookname = "Deuteronomy";
+ this.lastchapter = 34;
+ }
+ if (book.search(/\b(joshua|josh|jos)\b/i) != -1)
+ {
+ this.book = 6;
+ this.bookname = "Joshua";
+ this.longbookname = "Book_of_Joshua";
+ this.lastchapter = 24;
+ }
+ if (book.search(/\b(judges|jud|ju|jdg|judg)\b/i) != -1)
+ {
+ this.book = 7;
+ this.bookname = "Judges";
+ this.longbookname = "Book_of_Judges";
+ this.lastchapter = 21;
+ }
+ if (book.search(/\b(ruth|ru)\b/i) != -1)
+ {
+ this.book = 8;
+ this.bookname = "Ruth";
+ this.longbookname = "Book_of_Ruth";
+ this.lastchapter = 4;
+ }
+ if (book.search(/\b(1|i|1st|first)\s*(samuel|sa|sam|sml)\b/i) != -1)
+ {
+ this.book = 9;
+ this.bookname = "1 Samuel";
+ this.longbookname = "First_Samuel";
+ this.lastchapter = 31;
+ }
+ if (book.search(/\b(2|ii|2nd|second|sec)\s*(samuel|sa|sam|sml)\b/i) != -1)
+ {
+ this.book = 10;
+ this.bookname = "2 Samuel";
+ this.longbookname = "Second_Samuel";
+ this.lastchapter = 24;
+ }
+ if (book.search(/\b(1|i|1st|first)\s*(kings|king|kgs|kn|k|ki)\b/i) != -1)
+ {
+ this.book = 11;
+ this.bookname = "1 Kings";
+ this.longbookname = "First_Kings";
+ this.lastchapter = 22;
+ }
+ if (book.search(/\b(2|ii|2nd|second|sec)\s*(kings|king|kgs|kn|k|ki)\b/i) != -1)
+ {
+ this.book = 12;
+ this.bookname = "2 Kings";
+ this.longbookname = "Second_Kings";
+ this.lastchapter = 25;
+ }
+ if (book.search(/\b(1|i|1st|first)\s*(chronicles|chron|ch|chr)\b/i) != -1)
+ {
+ this.book = 13;
+ this.bookname = "1 Chronicles";
+ this.longbookname = "First_Chronicles";
+ this.lastchapter = 29;
+ }
+ if (book.search(/\b(2|ii|2nd|second|sec)\s*(chronicles|chron|ch|chr)\b/i) != -1)
+ {
+ this.book = 14;
+ this.bookname = "2 Chronicles";
+ this.longbookname = "Second_Chronicles";
+ this.lastchapter = 36;
+ }
+ if (book.search(/\b(ezra|ez|ezr)\b/i) != -1)
+ {
+ this.book = 15;
+ this.bookname = "Ezra";
+ this.longbookname = "Book_of_Ezra";
+ this.lastchapter = 10;
+ }
+ if (book.search(/\b(nehemiah|neh|ne|nehamiah)\b/i) != -1)
+ {
+ this.book = 16;
+ this.bookname = "Nehemiah";
+ this.longbookname = "Book_of_Nehemiah";
+ this.lastchapter = 13;
+ }
+ if (book.search(/\b(esther|est|es|esth)\b/i) != -1)
+ {
+ this.book = 17;
+ this.bookname = "Esther";
+ this.longbookname = "Book_of_Esther";
+ this.lastchapter = 10;
+ }
+ if (book.search(/\b(job|jo|jb)\b/i) != -1)
+ {
+ this.book = 18;
+ this.bookname = "Job";
+ this.longbookname = "Book_of_Job";
+ this.lastchapter = 42;
+ }
+ if (book.search(/\b(psalms|ps|psa|psalm|psm)\b/i) != -1)
+ {
+ this.book = 19;
+ this.bookname = "Psalm";
+ this.longbookname = "Psalm";
+ this.lastchapter = 150;
+ }
+ if (book.search(/\b(proverbs|prov|pr|pro|proverb|prv|prvbs)\b/i) != -1)
+ {
+ this.book = 20;
+ this.bookname = "Proverbs";
+ this.longbookname = "Book_of_Proverbs";
+ this.lastchapter = 31;
+ }
+ if (book.search(/\b(ecclesiastes|eccl|ecc|eccles|ec|ecl|ecclesiaste)\b/i) != -1)
+ {
+ this.book = 21;
+ this.bookname = "Ecclesiastes";
+ this.longbookname = "Ecclesiastes";
+ this.lastchapter = 12;
+ }
+ if (book.search(/\b(song\sof\ssolomon|song\sof\ssongs|sos|ss|son|so|song|songs)\b/i) != -1)
+ {
+ this.book = 22;
+ this.bookname = "Song of Solomon";
+ this.longbookname = "Song_of_Solomon";
+ this.lastchapter = 8;
+ }
+ if (book.search(/\b(isaiah|is|is|isah|isai|ia)\b/i) != -1)
+ {
+ this.book = 23;
+ this.bookname = "Isaiah";
+ this.longbookname = "Book_of_Isaiah";
+ this.lastchapter = 66;
+ }
+ if (book.search(/\b(jerimiah|jeremiah|jer|je|jere)\b/i) != -1)
+ {
+ this.book = 24;
+ this.bookname = "Jeremiah";
+ this.longbookname = "Book_of_Jeremiah";
+ this.lastchapter = 52;
+ }
+ if (book.search(/\b(lamentations|lam|la|lamentation)\b/i) != -1)
+ {
+ this.book = 25;
+ this.bookname = "Lamentations";
+ this.longbookname = "Book_of_Lamentations";
+ this.lastchapter = 5;
+ }
+ if (book.search(/\b(ezekiel|eze|ez|ezk|ezek)\b/i) != -1)
+ {
+ this.book = 26;
+ this.bookname = "Ezekiel";
+ this.longbookname = "Book_of_Ezekiel";
+ this.lastchapter = 48;
+ }
+ if (book.search(/\b(daniel|dan|dn|dl|da)\b/i) != -1)
+ {
+ this.book = 27;
+ this.bookname = "Daniel";
+ this.longbookname = "Book_of_Daniel";
+ this.lastchapter = 12;
+ }
+ if (book.search(/\b(hosea|hos|ho)\b/i) != -1)
+ {
+ this.book = 28;
+ this.bookname = "Hosea";
+ this.longbookname = "Book_of_Hosea";
+ this.lastchapter = 14;
+ }
+ if (book.search(/\b(joel|joe|jl)\b/i) != -1)
+ {
+ this.book = 29;
+ this.bookname = "Joel";
+ this.longbookname = "Book_of_Joel";
+ this.lastchapter = 3;
+ }
+ if (book.search(/\b(amos|am|amo)\b/i) != -1)
+ {
+ this.book = 30;
+ this.bookname = "Amos";
+ this.longbookname = "Book_of_Amos";
+ this.lastchapter = 9;
+ }
+ if (book.search(/\b(obadiah|oba|ob|obad)\b/i) != -1)
+ {
+ this.book = 31;
+ this.bookname = "Obadiah";
+ this.longbookname = "Book_of_Obadiah";
+ this.lastchapter = 1;
+ }
+ if (book.search(/\b(jonah|jnh|jon)\b/i) != -1)
+ {
+ this.book = 32;
+ this.bookname = "Jonah";
+ this.longbookname = "Book_of_Jonah";
+ this.lastchapter = 4;
+ }
+ if (book.search(/\b(micah|mic|mi)\b/i) != -1)
+ {
+ this.book = 33;
+ this.bookname = "Micah";
+ this.longbookname = "Book_of_Micah";
+ this.lastchapter = 7;
+ }
+ if (book.search(/\b(nahum|nah|na)\b/i) != -1)
+ {
+ this.book = 34;
+ this.bookname = "Nahum";
+ this.longbookname = "Book_of_Nahum";
+ this.lastchapter = 3;
+ }
+ if (book.search(/\b(habakkuk|hab|ha|habakuk)\b/i) != -1)
+ {
+ this.book = 35;
+ this.bookname = "Habakkuk";
+ this.longbookname = "Book_of_Habakkuk";
+ this.lastchapter = 3;
+ }
+ if (book.search(/\b(zephaniah|zeph|zep)\b/i) != -1)
+ {
+ this.book = 36;
+ this.bookname = "Zephaniah";
+ this.longbookname = "Book_of_Zephaniah";
+ this.lastchapter = 3;
+ }
+ if (book.search(/\b(haggia|hag|hg|haggai)\b/i) != -1)
+ {
+ this.book = 37;
+ this.bookname = "Haggai";
+ this.longbookname = "Book_of_Haggai";
+ this.lastchapter = 2;
+ }
+ if (book.search(/\b(zechariah|zech|zch|zec)\b/i) != -1)
+ {
+ this.book = 38;
+ this.bookname = "Zechariah";
+ this.longbookname = "Book_of_Zechariah";
+ this.lastchapter = 14;
+ }
+ if (book.search(/\b(malachi|mal)\b/i) != -1)
+ {
+ this.book = 39;
+ this.bookname = "Malachi";
+ this.longbookname = "Book_of_Malachi";
+ this.lastchapter = 4;
+ }
+ if (book.search(/\b(matthew|mt|matt|mat)\b/i) != -1)
+ {
+ this.book = 40;
+ this.bookname = "Matthew";
+ this.longbookname = "Gospel_of_Matthew";
+ this.lastchapter = 28;
+ }
+ if (book.search(/\b(mark|mrk|mk|mr)\b/i) != -1)
+ {
+ this.book = 41;
+ this.bookname = "Mark";
+ this.longbookname = "Gospel_of_Mark";
+ this.lastchapter = 16;
+ }
+ if (book.search(/\b(luke|lu|lke|luk|lk)\b/i) != -1)
+ {
+ this.book = 42;
+ this.bookname = "Luke";
+ this.longbookname = "Gospel_of_Luke";
+ this.lastchapter = 24;
+ }
+ if (book.search(/\b(john|jn|jhn)\b/i) != -1)
+ {
+ this.book = 43;
+ this.bookname = "John";
+ this.longbookname = "Gospel_of_John";
+ this.lastchapter = 21;
+ }
+ if (book.search(/\b(acts|ac|act)\b/i) != -1)
+ {
+ this.book = 44;
+ this.bookname = "Acts";
+ this.longbookname = "Acts_of_the_Apostles";
+ this.lastchapter = 28;
+ }
+ if (book.search(/\b(romans|rom|ro|rm|roman)\b/i) != -1)
+ {
+ this.book = 45;
+ this.bookname = "Romans";
+ this.longbookname = "Epistle_to_the_Romans";
+ this.lastchapter = 16;
+ }
+ if (book.search(/\b(1|i|1st|first)\s*(corinthian|cor|corinthians|corinth|corin|corth|corint)\b/i) != -1)
+ {
+ this.book = 46;
+ this.bookname = "1 Corinthians";
+ this.longbookname = "First_Epistle_to_the_Corinthians";
+ this.lastchapter = 16;
+ }
+ if (book.search(/\b(2|ii|2nd|second|sec)\s*(corinthian|cor|corinthians|corinth|corin|corth|corint)\b/i) != -1)
+ {
+ this.book = 47;
+ this.bookname = "2 Corinthians";
+ this.longbookname = "Second_Epistle_to_the_Corinthians";
+ this.lastchapter = 13;
+ }
+ if (book.search(/\b(galatians|galatian|galations|gal|ga|gala|galation|galat)\b/i) != -1)
+ {
+ this.book = 48;
+ this.bookname = "Galatians";
+ this.longbookname = "Epistle_to_the_Galatians";
+ this.lastchapter = 6;
+ }
+ if (book.search(/\b(ephesians|eph|ep|ephes|ephe|ephs)\b/i) != -1)
+ {
+ this.book = 49;
+ this.bookname = "Ephesians";
+ this.longbookname = "Epistle_to_the_Ephesians";
+ this.lastchapter = 6;
+ }
+ if (book.search(/\b(philippians|phi|phil|ph|philip)\b/i) != -1)
+ {
+ this.book = 50;
+ this.bookname = "Philippians";
+ this.longbookname = "Epistle_to_the_Philippians";
+ this.lastchapter = 4;
+ }
+ if (book.search(/\b(colossians|col|co|colossian|colos|coloss)\b/i) != -1)
+ {
+ this.book = 51;
+ this.bookname = "Colossians";
+ this.longbookname = "Epistle_to_the_Colossians";
+ this.lastchapter = 4;
+ }
+ if (book.search(/\b(1|i|1st|first)\s*(thessalonians|the|thessa|thessalonian|thes|thess|th)\b/i) != -1)
+ {
+ this.book = 52;
+ this.bookname = "1 Thessalonians";
+ this.longbookname = "First_Epistle_to_the_Thessalonians";
+ this.lastchapter = 5;
+ }
+ if (book.search(/\b(2|ii|2nd|second|sec)\s*(thessalonians|the|thessa|thessalonian|thes|thess|th)\b/i) != -1)
+ {
+ this.book = 53;
+ this.bookname = "2 Thessalonians";
+ this.longbookname = "Second_Epistle_to_the_Thessalonians";
+ this.lastchapter = 3;
+ }
+ if (book.search(/\b(1|i|1st|first)\s*(timothy|tim|ti|timoth|tm)\b/i) != -1)
+ {
+ this.book = 54;
+ this.bookname = "1 Timothy";
+ this.longbookname = "First_Epistle_to_Timothy";
+ this.lastchapter = 6;
+ }
+ if (book.search(/\b(2|ii|2nd|second|sec)\s*(timothy|tim|timoth|tm)\b/i) != -1)
+ {
+ this.book = 55;
+ this.bookname = "2 Timothy";
+ this.longbookname = "Second_Epistle_to_Timothy";
+ this.lastchapter = 4;
+ }
+ if (book.search(/\b(titus|tit)\b/i) != -1)
+ {
+ this.book = 56;
+ this.bookname = "Titus";
+ this.longbookname = "Epistle_to_Titus";
+ this.lastchapter = 3;
+ }
+ if (book.search(/\b(philemon|phlmn|phl|phm|phile|philem)\b/i) != -1)
+ {
+ this.book = 57;
+ this.bookname = "Philemon";
+ this.longbookname = "Epistle_to_Philemon";
+ this.lastchapter = 1;
+ }
+ if (book.search(/\b(hebrews|heb|he|hebrew)\b/i) != -1)
+ {
+ this.book = 58;
+ this.bookname = "Hebrews";
+ this.longbookname = "Epistle_to_the_Hebrews";
+ this.lastchapter = 13;
+ }
+ if (book.search(/\b(james|jam|ja|jas|jms|jame|jm)\b/i) != -1)
+ {
+ this.book = 59;
+ this.bookname = "James";
+ this.longbookname = "Epistle_of_James";
+ this.lastchapter = 5;
+ }
+ if (book.search(/\b(1|i|1st|first)\s*(peter|pe|pet|pete|pt|p)\b/i) != -1)
+ {
+ this.book = 60;
+ this.bookname = "1 Peter";
+ this.longbookname = "First_Epistle_of_Peter";
+ this.lastchapter = 5;
+ }
+ if (book.search(/\b(2|ii|2nd|second|sec)\s*(peter|pe|pet|pete|pt|p)\b/i) != -1)
+ {
+ this.book = 61;
+ this.bookname = "2 Peter";
+ this.longbookname = "Second_Epistle_of_Peter";
+ this.lastchapter = 3;
+ }
+ if (book.search(/\b(1|i|1st|first)\s*(john|jn|jo)\b/i) != -1)
+ {
+ this.book = 62;
+ this.bookname = "1 John";
+ this.longbookname = "First_Epistle_of_John";
+ this.lastchapter = 5;
+ }
+ if (book.search(/\b(2|ii|2nd|second|sec)\s*(john|jn|jo)\b/i) != -1)
+ {
+ this.book = 63;
+ this.bookname = "2 John";
+ this.longbookname = "Second_Epistle_of_John";
+ this.lastchapter = 1;
+ }
+ if (book.search(/\b(3|iii|3rd|third)\s*(john|jn|jo)\b/i) != -1)
+ {
+ this.book = 64;
+ this.bookname = "3 John";
+ this.longbookname = "Third_Epistle_of_John";
+ this.lastchapter = 1;
+ }
+ if (book.search(/\b(jude|jud|ju)\b/i) != -1)
+ {
+ this.book = 65;
+ this.bookname = "Jude";
+ this.longbookname = "Epistle_of_Jude";
+ this.lastchapter = 1;
+ }
+ if (book.search(/\b(revelation|rev|re|revelations|rv)\b/i) != -1)
+ {
+ this.book = 66;
+ this.bookname = "Revelation";
+ this.longbookname = "Book_of_Revelations";
+ this.lastchapter = 22;
+ }
+
+ // ok. we're going to deal with any of the following types of refernces:
+ /*
+ book 1-2
+
+ book 1 - book 2
+
+ book 1:1-2
+
+ book 1:1
+ */
+
+ // book 1-2 or book 1 - book 2
+ var reg1 = /^\d*\s*(\w+) (\d+)\s*\-\s*\d*\s*\w*\s*(\d+)$/i;
+ var reg2 = /^\d*\s*(\w+) (\d+)\s*\:\s*(\d+)\s*\-\s*\d*\s*\w+ (\d+)\s*\:\s*(\d+)\s*$/i;
+ var reg3 = /^\d*\s*(\w+) (\d+)\s*\:\s*(\d+)\s*\-\s*(\d+)\s*$/i;
+ var reg4 = /^\d*\s*(\w+) (\d+)\s*\:\s*(\d+)\s*$/i;
+ var reg5 = /^\d*\s*(\w+) (\d+)\s*$/i;
+ var reg6 = /^\d*\s*(\w+) (\d+)\s*\:\s*(\d+)\s*\-\s*\d*\s*\w+ (\d+)\s*$/i;
+
+ if (ref.match(reg1) != null)
+ {
+ this.startchapter = RegExp.$2;
+ this.endchapter = RegExp.$3;
+ this.startverse = 1;
+ this.endverse = "*";
+ }
+ else if (ref.match(reg2) != null)
+ {
+ this.startchapter = RegExp.$2;
+ this.startverse = RegExp.$3;
+ this.endchapter = RegExp.$4;
+ this.endverse = RegExp.$5;
+ }
+ else if (ref.match(reg3) != null)
+ {
+ this.startchapter = RegExp.$2;
+ this.endchapter = RegExp.$2;
+ this.startverse = RegExp.$3;
+ this.endverse = RegExp.$4;
+ }
+ else if (ref.match(reg4) != null)
+ {
+ this.startchapter = RegExp.$2;
+ this.endchapter = RegExp.$2;
+ this.startverse = RegExp.$3;
+ this.endverse = RegExp.$3;
+ }
+ else if (ref.match(reg5) != null)
+ {
+ this.startchapter = RegExp.$2;
+ this.endchapter = RegExp.$2;
+ this.startverse = 1;
+ this.endverse = "*";
+ }
+ else if (ref.match(reg6) != null)
+ {
+ this.startchapter = RegExp.$2;
+ this.endchapter = RegExp.$4;
+ this.startverse = RegExp.$3;
+ this.endverse = "*";
+ }
+
+ // make sure you don't return an invalid chapter.
+ if (this.endchapter > this.lastchapter)
+ {
+ this.endchapter = this.lastchapter;
+ }
+ if (this.startchapter > this.endchapter)
+ {
+ this.startchapter = this.endchapter;
+ }
+}
+
+function bookName(booknum)
+{
+ var book = new Array();
+ book[0] = "";
+ book[1] = "Genesis";
+ book[2] = "Exodus";
+ book[3] = "Leviticus";
+ book[4] = "Numbers";
+ book[5] = "Deuteronomy";
+ book[6] = "Joshua";
+ book[7] = "Judges";
+ book[8] = "Ruth";
+ book[9] = "1 Samuel";
+ book[10] = "2 Samuel";
+ book[11] = "1 Kings";
+ book[12] = "2 Kings";
+ book[13] = "1 Chronicles";
+ book[14] = "2 Chronicles";
+ book[15] = "Ezra";
+ book[16] = "Nehemiah";
+ book[17] = "Esther";
+ book[18] = "Job";
+ book[19] = "Psalm";
+ book[20] = "Proverbs";
+ book[21] = "Ecclesiastes";
+ book[22] = "Song of Songs";
+ book[23] = "Isaiah";
+ book[24] = "Jeremiah";
+ book[25] = "Lamentations";
+ book[26] = "Ezekiel";
+ book[27] = "Daniel";
+ book[28] = "Hosea";
+ book[29] = "Joel";
+ book[30] = "Amos";
+ book[31] = "Obadiah";
+ book[32] = "Jonah";
+ book[33] = "Micah";
+ book[34] = "Nahum";
+ book[35] = "Habakkuk";
+ book[36] = "Zephaniah";
+ book[37] = "Haggai";
+ book[38] = "Zechariah";
+ book[39] = "Malachi";
+ book[40] = "Matthew";
+ book[41] = "Mark";
+ book[42] = "Luke";
+ book[43] = "John";
+ book[44] = "Acts";
+ book[45] = "Romans";
+ book[46] = "1 Corinthians";
+ book[47] = "2 Corinthians";
+ book[48] = "Galatians";
+ book[49] = "Ephesians";
+ book[50] = "Philippians";
+ book[51] = "Colossians";
+ book[52] = "1 Thessalonians";
+ book[53] = "2 Thessalonians";
+ book[54] = "1 Timothy";
+ book[55] = "2 Timothy";
+ book[56] = "Titus";
+ book[57] = "Philemon";
+ book[58] = "Hebrews";
+ book[59] = "James";
+ book[60] = "1 Peter";
+ book[61] = "2 Peter";
+ book[62] = "1 John";
+ book[63] = "2 John";
+ book[64] = "3 John";
+ book[65] = "Jude";
+ book[66] = "Revelation";
+
+ return book[booknum];
+}
\ No newline at end of file
diff --git a/js/bible_ref_parsing.min.js b/js/bible_ref_parsing.min.js
index a6b5c150..2b14144d 100644
--- a/js/bible_ref_parsing.min.js
+++ b/js/bible_ref_parsing.min.js
@@ -1 +1 @@
-function bookName(a) { var b = new Array; b[0] = ""; b[1] = "Genesis"; b[2] = "Exodus"; b[3] = "Leviticus"; b[4] = "Numbers"; b[5] = "Deuteronomy"; b[6] = "Joshua"; b[7] = "Judges"; b[8] = "Ruth"; b[9] = "1 Samuel"; b[10] = "2 Samuel"; b[11] = "1 Kings"; b[12] = "2 Kings"; b[13] = "1 Chronicles"; b[14] = "2 Chronicles"; b[15] = "Ezra"; b[16] = "Nehemiah"; b[17] = "Esther"; b[18] = "Job"; b[19] = "Psalm"; b[20] = "Proverbs"; b[21] = "Ecclesiastes"; b[22] = "Song of Songs"; b[23] = "Isaiah"; b[24] = "Jeremiah"; b[25] = "Lamentations"; b[26] = "Ezekiel"; b[27] = "Daniel"; b[28] = "Hosea"; b[29] = "Joel"; b[30] = "Amos"; b[31] = "Obadiah"; b[32] = "Jonah"; b[33] = "Micah"; b[34] = "Nahum"; b[35] = "Habakkuk"; b[36] = "Zephaniah"; b[37] = "Haggai"; b[38] = "Zechariah"; b[39] = "Malachi"; b[40] = "Matthew"; b[41] = "Mark"; b[42] = "Luke"; b[43] = "John"; b[44] = "Acts"; b[45] = "Romans"; b[46] = "1 Corinthians"; b[47] = "2 Corinthians"; b[48] = "Galatians"; b[49] = "Ephesians"; b[50] = "Philippians"; b[51] = "Colossians"; b[52] = "1 Thessalonians"; b[53] = "2 Thessalonians"; b[54] = "1 Timothy"; b[55] = "2 Timothy"; b[56] = "Titus"; b[57] = "Philemon"; b[58] = "Hebrews"; b[59] = "James"; b[60] = "1 Peter"; b[61] = "2 Peter"; b[62] = "1 John"; b[63] = "2 John"; b[64] = "3 John"; b[65] = "Jude"; b[66] = "Revelation"; return b[a] } function Reference(a) { a = a.toLowerCase(); var b = new Object; var c = a.substring(0, a.search(/\s\d/i)); if (c.search(/\b(genesis|gen|ge|gn)\b/i) != -1) { this.book = 1; this.bookname = "Genesis"; this.longbookname = "Genesis"; this.lastchapter = 50 } if (c.search(/\b(exodus|ex|exo|exod|exd)\b/i) != -1) { this.book = 2; this.bookname = "Exodus"; this.longbookname = "Exodus"; this.lastchapter = 40 } if (c.search(/\b(leviticus|lev|le|levi|lv)\b/i) != -1) { this.book = 3; this.bookname = "Leviticus"; this.longbookname = "Leviticus"; this.lastchapter = 27 } if (c.search(/\b(numbers|num|nu|numb|number)\b/i) != -1) { this.book = 4; this.bookname = "Numbers"; this.longbookname = "Book_of_Numbers"; this.lastchapter = 36 } if (c.search(/\b(deuteronomy|deut|de|dt|deu)\b/i) != -1) { this.book = 5; this.bookname = "Deuteronomy"; this.longbookname = "Deuteronomy"; this.lastchapter = 34 } if (c.search(/\b(joshua|josh|jos)\b/i) != -1) { this.book = 6; this.bookname = "Joshua"; this.longbookname = "Book_of_Joshua"; this.lastchapter = 24 } if (c.search(/\b(judges|jud|ju|jdg|judg)\b/i) != -1) { this.book = 7; this.bookname = "Judges"; this.longbookname = "Book_of_Judges"; this.lastchapter = 21 } if (c.search(/\b(ruth|ru)\b/i) != -1) { this.book = 8; this.bookname = "Ruth"; this.longbookname = "Book_of_Ruth"; this.lastchapter = 4 } if (c.search(/\b(1|i|1st|first)\s*(samuel|sa|sam|sml)\b/i) != -1) { this.book = 9; this.bookname = "1 Samuel"; this.longbookname = "First_Samuel"; this.lastchapter = 31 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(samuel|sa|sam|sml)\b/i) != -1) { this.book = 10; this.bookname = "2 Samuel"; this.longbookname = "Second_Samuel"; this.lastchapter = 24 } if (c.search(/\b(1|i|1st|first)\s*(kings|king|kgs|kn|k|ki)\b/i) != -1) { this.book = 11; this.bookname = "1 Kings"; this.longbookname = "First_Kings"; this.lastchapter = 22 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(kings|king|kgs|kn|k|ki)\b/i) != -1) { this.book = 12; this.bookname = "2 Kings"; this.longbookname = "Second_Kings"; this.lastchapter = 25 } if (c.search(/\b(1|i|1st|first)\s*(chronicles|chron|ch|chr)\b/i) != -1) { this.book = 13; this.bookname = "1 Chronicles"; this.longbookname = "First_Chronicles"; this.lastchapter = 29 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(chronicles|chron|ch|chr)\b/i) != -1) { this.book = 14; this.bookname = "2 Chronicles"; this.longbookname = "Second_Chronicles"; this.lastchapter = 36 } if (c.search(/\b(ezra|ez|ezr)\b/i) != -1) { this.book = 15; this.bookname = "Ezra"; this.longbookname = "Book_of_Ezra"; this.lastchapter = 10 } if (c.search(/\b(nehemiah|neh|ne|nehamiah)\b/i) != -1) { this.book = 16; this.bookname = "Nehemiah"; this.longbookname = "Book_of_Nehemiah"; this.lastchapter = 13 } if (c.search(/\b(esther|est|es|esth)\b/i) != -1) { this.book = 17; this.bookname = "Esther"; this.longbookname = "Book_of_Esther"; this.lastchapter = 10 } if (c.search(/\b(job|jo|jb)\b/i) != -1) { this.book = 18; this.bookname = "Job"; this.longbookname = "Book_of_Job"; this.lastchapter = 42 } if (c.search(/\b(psalms|ps|psa|psalm|psm)\b/i) != -1) { this.book = 19; this.bookname = "Psalm"; this.longbookname = "Psalm"; this.lastchapter = 150 } if (c.search(/\b(proverbs|prov|pr|pro|proverb|prv|prvbs)\b/i) != -1) { this.book = 20; this.bookname = "Proverbs"; this.longbookname = "Book_of_Proverbs"; this.lastchapter = 31 } if (c.search(/\b(ecclesiastes|eccl|ecc|eccles|ec|ecl|ecclesiaste)\b/i) != -1) { this.book = 21; this.bookname = "Ecclesiastes"; this.longbookname = "Ecclesiastes"; this.lastchapter = 12 } if (c.search(/\b(song\sof\ssolomon|song\sof\ssongs|sos|ss|son|so|song|songs)\b/i) != -1) { this.book = 22; this.bookname = "Song of Solomon"; this.longbookname = "Song_of_Solomon"; this.lastchapter = 8 } if (c.search(/\b(isaiah|is|is|isah|isai|ia)\b/i) != -1) { this.book = 23; this.bookname = "Isaiah"; this.longbookname = "Book_of_Isaiah"; this.lastchapter = 66 } if (c.search(/\b(jerimiah|jeremiah|jer|je|jere)\b/i) != -1) { this.book = 24; this.bookname = "Jeremiah"; this.longbookname = "Book_of_Jeremiah"; this.lastchapter = 52 } if (c.search(/\b(lamentations|lam|la|lamentation)\b/i) != -1) { this.book = 25; this.bookname = "Lamentations"; this.longbookname = "Book_of_Lamentations"; this.lastchapter = 5 } if (c.search(/\b(ezekiel|eze|ez|ezk|ezek)\b/i) != -1) { this.book = 26; this.bookname = "Ezekiel"; this.longbookname = "Book_of_Ezekiel"; this.lastchapter = 48 } if (c.search(/\b(daniel|dan|dn|dl|da)\b/i) != -1) { this.book = 27; this.bookname = "Daniel"; this.longbookname = "Book_of_Daniel"; this.lastchapter = 12 } if (c.search(/\b(hosea|hos|ho)\b/i) != -1) { this.book = 28; this.bookname = "Hosea"; this.longbookname = "Book_of_Hosea"; this.lastchapter = 14 } if (c.search(/\b(joel|joe|jl)\b/i) != -1) { this.book = 29; this.bookname = "Joel"; this.longbookname = "Book_of_Joel"; this.lastchapter = 3 } if (c.search(/\b(amos|am|amo)\b/i) != -1) { this.book = 30; this.bookname = "Amos"; this.longbookname = "Book_of_Amos"; this.lastchapter = 9 } if (c.search(/\b(obadiah|oba|ob|obad)\b/i) != -1) { this.book = 31; this.bookname = "Obadiah"; this.longbookname = "Book_of_Obadiah"; this.lastchapter = 1 } if (c.search(/\b(jonah|jnh|jon)\b/i) != -1) { this.book = 32; this.bookname = "Jonah"; this.longbookname = "Book_of_Jonah"; this.lastchapter = 4 } if (c.search(/\b(micah|mic|mi)\b/i) != -1) { this.book = 33; this.bookname = "Micah"; this.longbookname = "Book_of_Micah"; this.lastchapter = 7 } if (c.search(/\b(nahum|nah|na)\b/i) != -1) { this.book = 34; this.bookname = "Nahum"; this.longbookname = "Book_of_Nahum"; this.lastchapter = 3 } if (c.search(/\b(habakkuk|hab|ha|habakuk)\b/i) != -1) { this.book = 35; this.bookname = "Habakkuk"; this.longbookname = "Book_of_Habakkuk"; this.lastchapter = 3 } if (c.search(/\b(zephaniah|zeph|zep)\b/i) != -1) { this.book = 36; this.bookname = "Zephaniah"; this.longbookname = "Book_of_Zephaniah"; this.lastchapter = 3 } if (c.search(/\b(haggia|hag|hg|haggai)\b/i) != -1) { this.book = 37; this.bookname = "Haggai"; this.longbookname = "Book_of_Haggai"; this.lastchapter = 2 } if (c.search(/\b(zechariah|zech|zch|zec)\b/i) != -1) { this.book = 38; this.bookname = "Zechariah"; this.longbookname = "Book_of_Zechariah"; this.lastchapter = 14 } if (c.search(/\b(malachi|mal)\b/i) != -1) { this.book = 39; this.bookname = "Malachi"; this.longbookname = "Book_of_Malachi"; this.lastchapter = 4 } if (c.search(/\b(matthew|mt|matt|mat)\b/i) != -1) { this.book = 40; this.bookname = "Matthew"; this.longbookname = "Gospel_of_Matthew"; this.lastchapter = 28 } if (c.search(/\b(mark|mrk|mk|mr)\b/i) != -1) { this.book = 41; this.bookname = "Mark"; this.longbookname = "Gospel_of_Mark"; this.lastchapter = 16 } if (c.search(/\b(luke|lu|lke|luk|lk)\b/i) != -1) { this.book = 42; this.bookname = "Luke"; this.longbookname = "Gospel_of_Luke"; this.lastchapter = 24 } if (c.search(/\b(john|jn|jhn)\b/i) != -1) { this.book = 43; this.bookname = "John"; this.longbookname = "Gospel_of_John"; this.lastchapter = 21 } if (c.search(/\b(acts|ac|act)\b/i) != -1) { this.book = 44; this.bookname = "Acts"; this.longbookname = "Acts_of_the_Apostles"; this.lastchapter = 28 } if (c.search(/\b(romans|rom|ro|rm|roman)\b/i) != -1) { this.book = 45; this.bookname = "Romans"; this.longbookname = "Epistle_to_the_Romans"; this.lastchapter = 16 } if (c.search(/\b(1|i|1st|first)\s*(corinthian|cor|corinthians|corinth|corin|corth|corint)\b/i) != -1) { this.book = 46; this.bookname = "1 Corinthians"; this.longbookname = "First_Epistle_to_the_Corinthians"; this.lastchapter = 16 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(corinthian|cor|corinthians|corinth|corin|corth|corint)\b/i) != -1) { this.book = 47; this.bookname = "2 Corinthians"; this.longbookname = "Second_Epistle_to_the_Corinthians"; this.lastchapter = 13 } if (c.search(/\b(galatians|galatian|galations|gal|ga|gala|galation|galat)\b/i) != -1) { this.book = 48; this.bookname = "Galatians"; this.longbookname = "Epistle_to_the_Galatians"; this.lastchapter = 6 } if (c.search(/\b(ephesians|eph|ep|ephes|ephe|ephs)\b/i) != -1) { this.book = 49; this.bookname = "Ephesians"; this.longbookname = "Epistle_to_the_Ephesians"; this.lastchapter = 6 } if (c.search(/\b(philippians|phi|phil|ph|philip)\b/i) != -1) { this.book = 50; this.bookname = "Philippians"; this.longbookname = "Epistle_to_the_Philippians"; this.lastchapter = 4 } if (c.search(/\b(colossians|col|co|colossian|colos|coloss)\b/i) != -1) { this.book = 51; this.bookname = "Colossians"; this.longbookname = "Epistle_to_the_Colossians"; this.lastchapter = 4 } if (c.search(/\b(1|i|1st|first)\s*(thessalonians|the|thessa|thessalonian|thes|thess|th)\b/i) != -1) { this.book = 52; this.bookname = "1 Thessalonians"; this.longbookname = "First_Epistle_to_the_Thessalonians"; this.lastchapter = 5 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(thessalonians|the|thessa|thessalonian|thes|thess|th)\b/i) != -1) { this.book = 53; this.bookname = "2 Thessalonians"; this.longbookname = "Second_Epistle_to_the_Thessalonians"; this.lastchapter = 3 } if (c.search(/\b(1|i|1st|first)\s*(timothy|tim|ti|timoth|tm)\b/i) != -1) { this.book = 54; this.bookname = "1 Timothy"; this.longbookname = "First_Epistle_to_Timothy"; this.lastchapter = 6 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(timothy|tim|timoth|tm)\b/i) != -1) { this.book = 55; this.bookname = "2 Timothy"; this.longbookname = "Second_Epistle_to_Timothy"; this.lastchapter = 4 } if (c.search(/\b(titus|tit)\b/i) != -1) { this.book = 56; this.bookname = "Titus"; this.longbookname = "Epistle_to_Titus"; this.lastchapter = 3 } if (c.search(/\b(philemon|phlmn|phl|phm|phile|philem)\b/i) != -1) { this.book = 57; this.bookname = "Philemon"; this.longbookname = "Epistle_to_Philemon"; this.lastchapter = 1 } if (c.search(/\b(hebrews|heb|he|hebrew)\b/i) != -1) { this.book = 58; this.bookname = "Hebrews"; this.longbookname = "Epistle_to_the_Hebrews"; this.lastchapter = 13 } if (c.search(/\b(james|jam|ja|jas|jms|jame|jm)\b/i) != -1) { this.book = 59; this.bookname = "James"; this.longbookname = "Epistle_of_James"; this.lastchapter = 5 } if (c.search(/\b(1|i|1st|first)\s*(peter|pe|pet|pete|pt|p)\b/i) != -1) { this.book = 60; this.bookname = "1 Peter"; this.longbookname = "First_Epistle_of_Peter"; this.lastchapter = 5 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(peter|pe|pet|pete|pt|p)\b/i) != -1) { this.book = 61; this.bookname = "2 Peter"; this.longbookname = "Second_Epistle_of_Peter"; this.lastchapter = 3 } if (c.search(/\b(1|i|1st|first)\s*(john|jn|jo)\b/i) != -1) { this.book = 62; this.bookname = "1 John"; this.longbookname = "First_Epistle_of_John"; this.lastchapter = 5 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(john|jn|jo)\b/i) != -1) { this.book = 63; this.bookname = "2 John"; this.longbookname = "Second_Epistle_of_John"; this.lastchapter = 1 } if (c.search(/\b(3|iii|3rd|third)\s*(john|jn|jo)\b/i) != -1) { this.book = 64; this.bookname = "3 John"; this.longbookname = "Third_Epistle_of_John"; this.lastchapter = 1 } if (c.search(/\b(jude|jud|ju)\b/i) != -1) { this.book = 65; this.bookname = "Jude"; this.longbookname = "Epistle_of_Jude"; this.lastchapter = 1 } if (c.search(/\b(revelation|rev|re|revelations|rv)\b/i) != -1) { this.book = 66; this.bookname = "Revelation"; this.longbookname = "Book_of_Revelations"; this.lastchapter = 22 } var d = a.substring(a.search(/\s\d/) + 1, a.length); if (d.search(":") == -1) { this.chapter = parseInt(d.substring(d.search(/\s\d\s/) + 1, d.length)); this.startverse = 1; this.endverse = "*" } else { this.chapter = parseInt(d.substring(d.search(/\s\d\:/) + 1, d.search(":"))); var e = d.substring(d.search(":") + 1, d.length); if (e.search("-") != -1) { this.startverse = parseInt(e.substring(0, e.search("-"))); var f = e.substring(e.search("-") + 1, e.length); if (f != "*") { this.endverse = parseInt(f) } else { this.endverse = f } } else { this.startverse = parseInt(e); this.endverse = parseInt(e) } } }
\ No newline at end of file
+function bookName(a) { var b = new Array; b[0] = ""; b[1] = "Genesis"; b[2] = "Exodus"; b[3] = "Leviticus"; b[4] = "Numbers"; b[5] = "Deuteronomy"; b[6] = "Joshua"; b[7] = "Judges"; b[8] = "Ruth"; b[9] = "1 Samuel"; b[10] = "2 Samuel"; b[11] = "1 Kings"; b[12] = "2 Kings"; b[13] = "1 Chronicles"; b[14] = "2 Chronicles"; b[15] = "Ezra"; b[16] = "Nehemiah"; b[17] = "Esther"; b[18] = "Job"; b[19] = "Psalm"; b[20] = "Proverbs"; b[21] = "Ecclesiastes"; b[22] = "Song of Songs"; b[23] = "Isaiah"; b[24] = "Jeremiah"; b[25] = "Lamentations"; b[26] = "Ezekiel"; b[27] = "Daniel"; b[28] = "Hosea"; b[29] = "Joel"; b[30] = "Amos"; b[31] = "Obadiah"; b[32] = "Jonah"; b[33] = "Micah"; b[34] = "Nahum"; b[35] = "Habakkuk"; b[36] = "Zephaniah"; b[37] = "Haggai"; b[38] = "Zechariah"; b[39] = "Malachi"; b[40] = "Matthew"; b[41] = "Mark"; b[42] = "Luke"; b[43] = "John"; b[44] = "Acts"; b[45] = "Romans"; b[46] = "1 Corinthians"; b[47] = "2 Corinthians"; b[48] = "Galatians"; b[49] = "Ephesians"; b[50] = "Philippians"; b[51] = "Colossians"; b[52] = "1 Thessalonians"; b[53] = "2 Thessalonians"; b[54] = "1 Timothy"; b[55] = "2 Timothy"; b[56] = "Titus"; b[57] = "Philemon"; b[58] = "Hebrews"; b[59] = "James"; b[60] = "1 Peter"; b[61] = "2 Peter"; b[62] = "1 John"; b[63] = "2 John"; b[64] = "3 John"; b[65] = "Jude"; b[66] = "Revelation"; return b[a] } function Reference(a) { a = a.toLowerCase().trim(); var b = new Object; var c = a.substring(0, a.search(/\s\d/i)); if (c.search(/\b(genesis|gen|ge|gn)\b/i) != -1) { this.book = 1; this.bookname = "Genesis"; this.longbookname = "Genesis"; this.lastchapter = 50 } if (c.search(/\b(exodus|ex|exo|exod|exd)\b/i) != -1) { this.book = 2; this.bookname = "Exodus"; this.longbookname = "Exodus"; this.lastchapter = 40 } if (c.search(/\b(leviticus|lev|le|levi|lv)\b/i) != -1) { this.book = 3; this.bookname = "Leviticus"; this.longbookname = "Leviticus"; this.lastchapter = 27 } if (c.search(/\b(numbers|num|nu|numb|number)\b/i) != -1) { this.book = 4; this.bookname = "Numbers"; this.longbookname = "Book_of_Numbers"; this.lastchapter = 36 } if (c.search(/\b(deuteronomy|deut|de|dt|deu)\b/i) != -1) { this.book = 5; this.bookname = "Deuteronomy"; this.longbookname = "Deuteronomy"; this.lastchapter = 34 } if (c.search(/\b(joshua|josh|jos)\b/i) != -1) { this.book = 6; this.bookname = "Joshua"; this.longbookname = "Book_of_Joshua"; this.lastchapter = 24 } if (c.search(/\b(judges|jud|ju|jdg|judg)\b/i) != -1) { this.book = 7; this.bookname = "Judges"; this.longbookname = "Book_of_Judges"; this.lastchapter = 21 } if (c.search(/\b(ruth|ru)\b/i) != -1) { this.book = 8; this.bookname = "Ruth"; this.longbookname = "Book_of_Ruth"; this.lastchapter = 4 } if (c.search(/\b(1|i|1st|first)\s*(samuel|sa|sam|sml)\b/i) != -1) { this.book = 9; this.bookname = "1 Samuel"; this.longbookname = "First_Samuel"; this.lastchapter = 31 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(samuel|sa|sam|sml)\b/i) != -1) { this.book = 10; this.bookname = "2 Samuel"; this.longbookname = "Second_Samuel"; this.lastchapter = 24 } if (c.search(/\b(1|i|1st|first)\s*(kings|king|kgs|kn|k|ki)\b/i) != -1) { this.book = 11; this.bookname = "1 Kings"; this.longbookname = "First_Kings"; this.lastchapter = 22 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(kings|king|kgs|kn|k|ki)\b/i) != -1) { this.book = 12; this.bookname = "2 Kings"; this.longbookname = "Second_Kings"; this.lastchapter = 25 } if (c.search(/\b(1|i|1st|first)\s*(chronicles|chron|ch|chr)\b/i) != -1) { this.book = 13; this.bookname = "1 Chronicles"; this.longbookname = "First_Chronicles"; this.lastchapter = 29 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(chronicles|chron|ch|chr)\b/i) != -1) { this.book = 14; this.bookname = "2 Chronicles"; this.longbookname = "Second_Chronicles"; this.lastchapter = 36 } if (c.search(/\b(ezra|ez|ezr)\b/i) != -1) { this.book = 15; this.bookname = "Ezra"; this.longbookname = "Book_of_Ezra"; this.lastchapter = 10 } if (c.search(/\b(nehemiah|neh|ne|nehamiah)\b/i) != -1) { this.book = 16; this.bookname = "Nehemiah"; this.longbookname = "Book_of_Nehemiah"; this.lastchapter = 13 } if (c.search(/\b(esther|est|es|esth)\b/i) != -1) { this.book = 17; this.bookname = "Esther"; this.longbookname = "Book_of_Esther"; this.lastchapter = 10 } if (c.search(/\b(job|jo|jb)\b/i) != -1) { this.book = 18; this.bookname = "Job"; this.longbookname = "Book_of_Job"; this.lastchapter = 42 } if (c.search(/\b(psalms|ps|psa|psalm|psm)\b/i) != -1) { this.book = 19; this.bookname = "Psalm"; this.longbookname = "Psalm"; this.lastchapter = 150 } if (c.search(/\b(proverbs|prov|pr|pro|proverb|prv|prvbs)\b/i) != -1) { this.book = 20; this.bookname = "Proverbs"; this.longbookname = "Book_of_Proverbs"; this.lastchapter = 31 } if (c.search(/\b(ecclesiastes|eccl|ecc|eccles|ec|ecl|ecclesiaste)\b/i) != -1) { this.book = 21; this.bookname = "Ecclesiastes"; this.longbookname = "Ecclesiastes"; this.lastchapter = 12 } if (c.search(/\b(song\sof\ssolomon|song\sof\ssongs|sos|ss|son|so|song|songs)\b/i) != -1) { this.book = 22; this.bookname = "Song of Solomon"; this.longbookname = "Song_of_Solomon"; this.lastchapter = 8 } if (c.search(/\b(isaiah|is|is|isah|isai|ia)\b/i) != -1) { this.book = 23; this.bookname = "Isaiah"; this.longbookname = "Book_of_Isaiah"; this.lastchapter = 66 } if (c.search(/\b(jerimiah|jeremiah|jer|je|jere)\b/i) != -1) { this.book = 24; this.bookname = "Jeremiah"; this.longbookname = "Book_of_Jeremiah"; this.lastchapter = 52 } if (c.search(/\b(lamentations|lam|la|lamentation)\b/i) != -1) { this.book = 25; this.bookname = "Lamentations"; this.longbookname = "Book_of_Lamentations"; this.lastchapter = 5 } if (c.search(/\b(ezekiel|eze|ez|ezk|ezek)\b/i) != -1) { this.book = 26; this.bookname = "Ezekiel"; this.longbookname = "Book_of_Ezekiel"; this.lastchapter = 48 } if (c.search(/\b(daniel|dan|dn|dl|da)\b/i) != -1) { this.book = 27; this.bookname = "Daniel"; this.longbookname = "Book_of_Daniel"; this.lastchapter = 12 } if (c.search(/\b(hosea|hos|ho)\b/i) != -1) { this.book = 28; this.bookname = "Hosea"; this.longbookname = "Book_of_Hosea"; this.lastchapter = 14 } if (c.search(/\b(joel|joe|jl)\b/i) != -1) { this.book = 29; this.bookname = "Joel"; this.longbookname = "Book_of_Joel"; this.lastchapter = 3 } if (c.search(/\b(amos|am|amo)\b/i) != -1) { this.book = 30; this.bookname = "Amos"; this.longbookname = "Book_of_Amos"; this.lastchapter = 9 } if (c.search(/\b(obadiah|oba|ob|obad)\b/i) != -1) { this.book = 31; this.bookname = "Obadiah"; this.longbookname = "Book_of_Obadiah"; this.lastchapter = 1 } if (c.search(/\b(jonah|jnh|jon)\b/i) != -1) { this.book = 32; this.bookname = "Jonah"; this.longbookname = "Book_of_Jonah"; this.lastchapter = 4 } if (c.search(/\b(micah|mic|mi)\b/i) != -1) { this.book = 33; this.bookname = "Micah"; this.longbookname = "Book_of_Micah"; this.lastchapter = 7 } if (c.search(/\b(nahum|nah|na)\b/i) != -1) { this.book = 34; this.bookname = "Nahum"; this.longbookname = "Book_of_Nahum"; this.lastchapter = 3 } if (c.search(/\b(habakkuk|hab|ha|habakuk)\b/i) != -1) { this.book = 35; this.bookname = "Habakkuk"; this.longbookname = "Book_of_Habakkuk"; this.lastchapter = 3 } if (c.search(/\b(zephaniah|zeph|zep)\b/i) != -1) { this.book = 36; this.bookname = "Zephaniah"; this.longbookname = "Book_of_Zephaniah"; this.lastchapter = 3 } if (c.search(/\b(haggia|hag|hg|haggai)\b/i) != -1) { this.book = 37; this.bookname = "Haggai"; this.longbookname = "Book_of_Haggai"; this.lastchapter = 2 } if (c.search(/\b(zechariah|zech|zch|zec)\b/i) != -1) { this.book = 38; this.bookname = "Zechariah"; this.longbookname = "Book_of_Zechariah"; this.lastchapter = 14 } if (c.search(/\b(malachi|mal)\b/i) != -1) { this.book = 39; this.bookname = "Malachi"; this.longbookname = "Book_of_Malachi"; this.lastchapter = 4 } if (c.search(/\b(matthew|mt|matt|mat)\b/i) != -1) { this.book = 40; this.bookname = "Matthew"; this.longbookname = "Gospel_of_Matthew"; this.lastchapter = 28 } if (c.search(/\b(mark|mrk|mk|mr)\b/i) != -1) { this.book = 41; this.bookname = "Mark"; this.longbookname = "Gospel_of_Mark"; this.lastchapter = 16 } if (c.search(/\b(luke|lu|lke|luk|lk)\b/i) != -1) { this.book = 42; this.bookname = "Luke"; this.longbookname = "Gospel_of_Luke"; this.lastchapter = 24 } if (c.search(/\b(john|jn|jhn)\b/i) != -1) { this.book = 43; this.bookname = "John"; this.longbookname = "Gospel_of_John"; this.lastchapter = 21 } if (c.search(/\b(acts|ac|act)\b/i) != -1) { this.book = 44; this.bookname = "Acts"; this.longbookname = "Acts_of_the_Apostles"; this.lastchapter = 28 } if (c.search(/\b(romans|rom|ro|rm|roman)\b/i) != -1) { this.book = 45; this.bookname = "Romans"; this.longbookname = "Epistle_to_the_Romans"; this.lastchapter = 16 } if (c.search(/\b(1|i|1st|first)\s*(corinthian|cor|corinthians|corinth|corin|corth|corint)\b/i) != -1) { this.book = 46; this.bookname = "1 Corinthians"; this.longbookname = "First_Epistle_to_the_Corinthians"; this.lastchapter = 16 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(corinthian|cor|corinthians|corinth|corin|corth|corint)\b/i) != -1) { this.book = 47; this.bookname = "2 Corinthians"; this.longbookname = "Second_Epistle_to_the_Corinthians"; this.lastchapter = 13 } if (c.search(/\b(galatians|galatian|galations|gal|ga|gala|galation|galat)\b/i) != -1) { this.book = 48; this.bookname = "Galatians"; this.longbookname = "Epistle_to_the_Galatians"; this.lastchapter = 6 } if (c.search(/\b(ephesians|eph|ep|ephes|ephe|ephs)\b/i) != -1) { this.book = 49; this.bookname = "Ephesians"; this.longbookname = "Epistle_to_the_Ephesians"; this.lastchapter = 6 } if (c.search(/\b(philippians|phi|phil|ph|philip)\b/i) != -1) { this.book = 50; this.bookname = "Philippians"; this.longbookname = "Epistle_to_the_Philippians"; this.lastchapter = 4 } if (c.search(/\b(colossians|col|co|colossian|colos|coloss)\b/i) != -1) { this.book = 51; this.bookname = "Colossians"; this.longbookname = "Epistle_to_the_Colossians"; this.lastchapter = 4 } if (c.search(/\b(1|i|1st|first)\s*(thessalonians|the|thessa|thessalonian|thes|thess|th)\b/i) != -1) { this.book = 52; this.bookname = "1 Thessalonians"; this.longbookname = "First_Epistle_to_the_Thessalonians"; this.lastchapter = 5 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(thessalonians|the|thessa|thessalonian|thes|thess|th)\b/i) != -1) { this.book = 53; this.bookname = "2 Thessalonians"; this.longbookname = "Second_Epistle_to_the_Thessalonians"; this.lastchapter = 3 } if (c.search(/\b(1|i|1st|first)\s*(timothy|tim|ti|timoth|tm)\b/i) != -1) { this.book = 54; this.bookname = "1 Timothy"; this.longbookname = "First_Epistle_to_Timothy"; this.lastchapter = 6 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(timothy|tim|timoth|tm)\b/i) != -1) { this.book = 55; this.bookname = "2 Timothy"; this.longbookname = "Second_Epistle_to_Timothy"; this.lastchapter = 4 } if (c.search(/\b(titus|tit)\b/i) != -1) { this.book = 56; this.bookname = "Titus"; this.longbookname = "Epistle_to_Titus"; this.lastchapter = 3 } if (c.search(/\b(philemon|phlmn|phl|phm|phile|philem)\b/i) != -1) { this.book = 57; this.bookname = "Philemon"; this.longbookname = "Epistle_to_Philemon"; this.lastchapter = 1 } if (c.search(/\b(hebrews|heb|he|hebrew)\b/i) != -1) { this.book = 58; this.bookname = "Hebrews"; this.longbookname = "Epistle_to_the_Hebrews"; this.lastchapter = 13 } if (c.search(/\b(james|jam|ja|jas|jms|jame|jm)\b/i) != -1) { this.book = 59; this.bookname = "James"; this.longbookname = "Epistle_of_James"; this.lastchapter = 5 } if (c.search(/\b(1|i|1st|first)\s*(peter|pe|pet|pete|pt|p)\b/i) != -1) { this.book = 60; this.bookname = "1 Peter"; this.longbookname = "First_Epistle_of_Peter"; this.lastchapter = 5 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(peter|pe|pet|pete|pt|p)\b/i) != -1) { this.book = 61; this.bookname = "2 Peter"; this.longbookname = "Second_Epistle_of_Peter"; this.lastchapter = 3 } if (c.search(/\b(1|i|1st|first)\s*(john|jn|jo)\b/i) != -1) { this.book = 62; this.bookname = "1 John"; this.longbookname = "First_Epistle_of_John"; this.lastchapter = 5 } if (c.search(/\b(2|ii|2nd|second|sec)\s*(john|jn|jo)\b/i) != -1) { this.book = 63; this.bookname = "2 John"; this.longbookname = "Second_Epistle_of_John"; this.lastchapter = 1 } if (c.search(/\b(3|iii|3rd|third)\s*(john|jn|jo)\b/i) != -1) { this.book = 64; this.bookname = "3 John"; this.longbookname = "Third_Epistle_of_John"; this.lastchapter = 1 } if (c.search(/\b(jude|jud|ju)\b/i) != -1) { this.book = 65; this.bookname = "Jude"; this.longbookname = "Epistle_of_Jude"; this.lastchapter = 1 } if (c.search(/\b(revelation|rev|re|revelations|rv)\b/i) != -1) { this.book = 66; this.bookname = "Revelation"; this.longbookname = "Book_of_Revelations"; this.lastchapter = 22 } var d = /^\d*\s*(\w+) (\d+)\s*\-\s*\d*\s*\w*\s*(\d+)$/i; var e = /^\d*\s*(\w+) (\d+)\s*\:\s*(\d+)\s*\-\s*\d*\s*\w+ (\d+)\s*\:\s*(\d+)\s*$/i; var f = /^\d*\s*(\w+) (\d+)\s*\:\s*(\d+)\s*\-\s*(\d+)\s*$/i; var g = /^\d*\s*(\w+) (\d+)\s*\:\s*(\d+)\s*$/i; var h = /^\d*\s*(\w+) (\d+)\s*$/i; var i = /^\d*\s*(\w+) (\d+)\s*\:\s*(\d+)\s*\-\s*\d*\s*\w+ (\d+)\s*$/i; if (a.match(d) != null) { this.startchapter = RegExp.$2; this.endchapter = RegExp.$3; this.startverse = 1; this.endverse = "*" } else if (a.match(e) != null) { this.startchapter = RegExp.$2; this.startverse = RegExp.$3; this.endchapter = RegExp.$4; this.endverse = RegExp.$5 } else if (a.match(f) != null) { this.startchapter = RegExp.$2; this.endchapter = RegExp.$2; this.startverse = RegExp.$3; this.endverse = RegExp.$4 } else if (a.match(g) != null) { this.startchapter = RegExp.$2; this.endchapter = RegExp.$2; this.startverse = RegExp.$3; this.endverse = RegExp.$3 } else if (a.match(h) != null) { this.startchapter = RegExp.$2; this.endchapter = RegExp.$2; this.startverse = 1; this.endverse = "*" } else if (a.match(i) != null) { this.startchapter = RegExp.$2; this.endchapter = RegExp.$4; this.startverse = RegExp.$3; this.endverse = "*" } if (this.endchapter > this.lastchapter) { this.endchapter = this.lastchapter } if (this.startchapter > this.endchapter) { this.startchapter = this.endchapter } } String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, "") }; String.prototype.ltrim = function() { return this.replace(/^\s+/, "") }; String.prototype.rtrim = function() { return this.replace(/\s+$/, "") }
\ No newline at end of file
diff --git a/js/common.js b/js/common.js
index 7a17db6d..87271b38 100644
--- a/js/common.js
+++ b/js/common.js
@@ -107,9 +107,9 @@ function Search(sv)
if (q.trim() != "")
{
var myref = new Reference(q.trim());
- var r = Bible.GetPassage(myref.book, myref.chapter, myref.startverse, myref.endverse);
+ var r = Bible.GetPassage(myref.book, myref.startchapter, myref.endchapter, myref.startverse, myref.endverse);
- Bible.DisplayPassage(r.vs, myref.book, myref.chapter, myref.startverse, myref.endverse, r.testament);
+ Bible.DisplayPassage(r.cs, myref.book, myref.startchapter, myref.endchapter, myref.startverse, myref.endverse, r.testament);
}
}
}
@@ -202,28 +202,43 @@ var Util = {
}
var Bible = {
- DisplayPassage: function(vs, b, ch, sv, ev, testament)
+ DisplayPassage: function(cs, b, sch, ech, sv, ev, testament)
{
try
{
var r = "";
+ // make the end verse pretty.
+ var tvs = cs[cs.length - 1].vs.length;
- for (var i = 0; i < vs.length; i++)
+ if (ev == "*" || ev > tvs)
{
- var v = vs[i];
-
- r += "" + $(v).attr("n") + ". ";
-
- for (var j = 0; j < v.childNodes.length; j++)
- {
- r += Traverse(v.childNodes[j], testament);
- }
-
-
- r += "
";
+ ev = tvs;
}
- var t = $("
" + "" + bookName(b) + " " + ch + ":" + sv + "-" + ev + "
" + r + " ");
+ for (var j = 0; j < cs.length; j++)
+ {
+ if (sch < ech)
+ {
+ r += "Chapter: " + cs[j].ch + "
";
+ }
+ var vs = cs[j].vs;
+
+ for (var m = 0; m < vs.length; m++)
+ {
+ var v = vs[m];
+
+ r += "" + $(v).attr("n") + ". ";
+
+ for (var w = 0; w < v.childNodes.length; w++)
+ {
+ r += Traverse(v.childNodes[w], testament);
+ }
+
+
+ r += "
";
+ }
+ }
+ var t = $("
" + "" + bookName(b) + " " + sch + ":" + sv + "-" + ech + ":" + ev + "
" + r + " ");
t.find(".hiddenlink").click(function(e)
{
@@ -240,46 +255,69 @@ var Bible = {
Util.HandleError(err);
}
},
- GetPassage: function(b, ch, sv, ev)
+ GetPassage: function(b, sch, ech, sv, ev)
{
try
{
- var xml; // the verses from the chapter.
- var vs = new Array(); // the verses requested.
+ var xml = []; // the verses from the chapter.
+ var cs = []; // the verses requested.
var r = {};
- var url = "xml/" + b + "-" + ch + ".xml"
- $.ajax({
- async: false,
- type: "GET",
- url: url,
- dataType: "xml",
- success: function(d, t, x)
- {
- xml = d;
- },
- error: function(request, status, error)
- {
- Util.HandleError(error, request);
- }
- });
+ for (var i = sch; i <= ech; i++)
+ {
+ var url = "xml/" + b + "-" + i + ".xml"
+ $.ajax({
+ async: false,
+ type: "GET",
+ url: url,
+ dataType: "xml",
+ success: function(d, t, x)
+ {
+ xml.push({ "ch": i, "vs": d });
+ },
+ error: function(request, status, error)
+ {
+ Util.HandleError(error, request);
+ }
+ });
+ }
- // get the verses requested.
- if (ev == "*")
+ for (var j = 0; j < xml.length; j++)
{
- vs = $(xml).find("v");
- }
- else
- {
- for (var i = sv; i <= ev; i++)
+ var vs = [];
+ var start;
+ var end;
+
+ // figure out the start verse.
+ if (j == 0)
+ { start = sv; }
+ else
+ { start = 1; }
+
+ if ((j + 1) == xml.length)
+ { end = ev; }
+ else
+ { end = "*"; }
+
+ var tvs = $(xml[j].vs).find("v").length;
+
+ // get the verses requested.
+ if (end == "*" || end > tvs)
{
- vs.unshift($(xml).find('v[n="' + i + '"]')[0])
+ end = tvs;
}
+
+ for (var i = start; i <= end; i++)
+ {
+ vs.push($(xml[j].vs).find('v[n="' + i + '"]')[0])
+ }
+
+ cs.push({ "ch": xml[j].ch, "vs": vs });
}
- r.vs = vs;
- r.testament = $(xml).find("b").attr("testament");
+
+ r.cs = cs;
+ r.testament = $(xml[0].vs).find("b").attr("testament");
return r;
-
}
catch (err)
{
diff --git a/js/common.min.js b/js/common.min.js
index 23aba312..b25b9053 100644
--- a/js/common.min.js
+++ b/js/common.min.js
@@ -1 +1 @@
-function Search(a) { try { var b = a.split(";"); for (var c in b) { var d = b[c].trim(); if (d != "") { if (d.search(/[0-9]/i) == -1) { Words.FindReferences(d) } else if (d.search(/(H|G)[0-9]/i) != -1) { var e = d.substring(0, 1); if (e.search(/h/i) != -1) { e = "heb" } else { e = "grk" } d = d.substring(1, d.length); var f = Strongs.GetStrongs(d, e); Strongs.DisplayStrongs(f) } else { var g = ""; if (d.trim() != "") { var h = new Reference(d.trim()); var i = Bible.GetPassage(h.book, h.chapter, h.startverse, h.endverse); Bible.DisplayPassage(i.vs, h.book, h.chapter, h.startverse, h.endverse, i.testament) } } } } } catch (j) { Util.HandleError(j) } return false } function Traverse(a, b) { try { var c = ""; if (a != null) { if (a.hasChildNodes()) { if (a.nodeName == "s") { var d = ""; if (b == "old") { d = "H" } if (b == "new") { d = "G" } c += "" + d + a.getAttribute("n") + "" + Traverse(a.childNodes.item(0), b) + "" } else { c += "<" + a.nodeName + ">"; for (var e = 0; e < a.childNodes.length; e++) { c += Traverse(a.childNodes.item(e), b) } c += "" + a.nodeName + ">" } } else { if (a.nodeValue != null) { if (a.nodeValue.search(/^(\,|\.|\:|\?|\;|\!)/) != -1) { c += a.nodeValue } else { c += " " + a.nodeValue } } } } return c } catch (f) { Util.HandleError(f) } } function SortNumeric(a, b) { return a - b } String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, "") }; String.prototype.ltrim = function() { return this.replace(/^\s+/, "") }; String.prototype.rtrim = function() { return this.replace(/\s+$/, "") }; var Settings = { ShowHideSearch: function() { var a = $("#showhidesearch"); var b = $("#searchresultswrap"); var c = $("#resultwrap"); if (b.css("display") != "none") { b.css("display", "none"); a.html("Show Search"); c.css("width", "100%") } else { b.css("display", "block"); a.html("Hide Search"); c.css("width", "70%") } }, SwitchPanes: function() { var a = $("#searchresultswrap"); var b = $("#resultwrap"); var c = a.css("float"); if (c == "right") { a.css("float", "left"); b.css("float", "left") } else { a.css("float", "right"); b.css("float", "right") } }, IncreaseResultFontSize: function() { var a = $("#result").css("font-size"); $("#result").css("font-size", parseInt(a) + 1) }, DecreaseResultFontSize: function() { var a = $("#result").css("font-size"); $("#result").css("font-size", parseInt(a) - 1) }, ChangeResultFont: function(a) { $("#result").css("font-family", a) } }; var Util = { HandleLink: function(a) { Search($(a.target).text()) }, HandleHiddenLink: function(a) { Search($(a.target).find(".searchvalue").text()) }, RemoveResult: function(a) { $(a.target).parent().parent().remove() }, HandleError: function(a) { var b = $("
" + a + " "); return false } }; var Bible = { DisplayPassage: function(a, b, c, d, e, f) { try { var g = ""; for (var h = 0; h < a.length; h++) { var i = a[h]; g += "" + $(i).attr("n") + ". "; for (var j = 0; j < i.childNodes.length; j++) { g += Traverse(i.childNodes[j], f) } g += "
" } var k = $("
" + "" + bookName(b) + " " + c + ":" + d + "-" + e + "
" + g + " "); k.find(".hiddenlink").click(function(a) { Util.HandleHiddenLink(a) }); k.find(".removeresult").click(function(a) { Util.RemoveResult(a) }); $("#result").prepend(k) } catch (l) { Util.HandleError(l) } }, GetPassage: function(a, b, c, d) { try { var e; var f = new Array; var g = {}; var h = "xml/" + a + "-" + b + ".xml"; $.ajax({ async: false, type: "GET", url: h, dataType: "xml", success: function(a, b, c) { e = a }, error: function(a, b, c) { Util.HandleError(c, a) } }); if (d == "*") { f = $(e).find("v") } else { for (var i = c; i <= d; i++) { f.unshift($(e).find('v[n="' + i + '"]')[0]) } } g.vs = f; g.testament = $(e).find("b").attr("testament"); return g } catch (j) { Util.HandleError(j) } } }; var Strongs = { GetStrongs: function(a, b) { try { var c = this; var d = {}; var e = b + parseInt((a - 1) / 100) + ".xml"; if (b == "grk") { d.prefix = "G" } else { d.prefix = "H" } d.sn = a; $.ajax({ async: false, type: "GET", url: "xml/" + e, dataType: "xml", success: function(a, b, c) { d.strongs = a }, error: function(a, b, c) { Util.HandleError(c, a) } }); $.ajax({ async: false, type: "GET", url: "xml/cr" + e, dataType: "xml", success: function(a, b, c) { d.crossrefs = a }, error: function(a, b, c) { Util.HandleError(c, a) } }); if (b == "grk") { e = "xml/rs" + parseInt((a - 1) / 1e3) + ".xml"; $.ajax({ async: false, type: "GET", url: e, dataType: "xml", success: function(a, b, c) { d.rmac = a }, error: function(a, b, c) { Util.HandleError(c, a) } }); d.rmaccode = $(d.rmac).find('s[id="' + a + '"]').attr("r"); e = "xml/r-" + d.rmaccode.substring(0, 1) + ".xml"; $.ajax({ async: false, type: "GET", url: e, dataType: "xml", success: function(a, b, c) { d.rmac = a }, error: function(a, b, c) { Util.HandleError(c, a) } }) } return d } catch (f) { Util.HandleError(f) } }, DisplayStrongs: function(a) { try { var b = $(a.strongs).find("i#" + a.prefix + a.sn); var c = $(b).find("t").text(); var d = $(b).find("tr").text(); var e = $(b).find("p").text(); var f = Traverse($(b).find("d")[0]); var g = /([hg][0-9]{1,4})/gi; f = f.replace(g, "$1"); var h = $(a.crossrefs).find("i#" + a.prefix + a.sn).find("rs"); var i = "Cross References: Show"; h.each(function(a) { i += "" + $(this).find("t").text() + ": "; $(this).find("r").each(function(a) { var b = $(this).attr("r").split(";"); i += "" + bookName(b[0]) + " " + b[1] + ":" + b[2] + ", " }); i = i.substr(0, i.length - 2); i += "
" }); i += " "; var j = ""; if (a.prefix == "G") { j += "Robinsons Morphological Analysis Code: " + a.rmaccode + " Show"; $(a.rmac).find('i[id="' + a.rmaccode.toUpperCase() + '"]').find("d").each(function() { j += $(this).text() + "
" }); j += " " } var k = $("
" + d + " (" + a.sn + ") - " + e + " - " + c + " - " + f + "
" + j + i + " "); k.find(".link").click(function(a) { Util.HandleLink(a) }); k.find(".removeresult").click(function(a) { Util.RemoveResult(a) }); k.find(".showhide").click(function(a) { Strongs.ShowHide(a) }); $("#result").prepend(k); return false } catch (l) { Util.HandleError(l) } }, ShowHide: function(a) { var b = $(a.target); var c = b.parent().find(".contents"); if (c.css("display") != "none") { c.css("display", "none"); b.html("Show") } else { c.css("display", "inline"); b.html("Hide") } } }; var Words = { ConvertResultsToArray: function(a) { try { var b = new Array; $(a).each(function() { b.push([$(this).attr("b"), $(this).attr("ch"), $(this).attr("v")]) }); return b } catch (c) { Util.HandleError(c) } }, DisplayResults: function(a, b) { try { var c = ""; var f = $(c); f.find(".link").click(function(a) { Util.HandleLink(a) }); $("#searchresults").html(f); $("#searchTotal").html(a.length); return false } catch (g) { Util.HandleError(g) } }, FindReferences: function(a) { try { a = a.toLowerCase(); var b = a.split(" "); var c; var d = this.BuildIndexArray().sort(); var e = new Array; for (i = 0; i < b.length; i++) { var a = b[i]; for (var f = 0; f < d.length; f++) { if (f == d.length) { if (a >= d[f]) { e.unshift(this.ConvertResultsToArray(this.GetSearchReferences("index/i" + d[f] + ".xml", a))); break } } else { if (a >= d[f] && a < d[f + 1]) { e.unshift(this.ConvertResultsToArray(this.GetSearchReferences("index/i" + d[f] + ".xml", a))); break } } } } if (e.length == 1) { this.DisplayResults(e[0], a) } else { this.DisplayResults(this.FindSharedSet(e), a) } return false } catch (g) { Util.HandleError(g) } }, GetSearchReferences: function(a, b) { try { var c; $.ajax({ async: false, type: "GET", url: a, dataType: "xml", success: function(a, b, d) { c = a }, error: function(a, b, c) { Util.HandleError(c, a) } }); var d = $(c).find('i[w="' + b + '"]').children(); return d } catch (e) { Util.HandleError(e) } }, BuildIndexArray: function() { try { var a = new Array; a.unshift("abhorring"); a.unshift("abinoam"); a.unshift("abounding"); a.unshift("acceptest"); a.unshift("accuseth"); a.unshift("acquainting"); a.unshift("addeth"); a.unshift("admonition"); a.unshift("adulteries"); a.unshift("affected"); a.unshift("afterwards"); a.unshift("aharah"); a.unshift("ahio"); a.unshift("aijalon"); a.unshift("aliah"); a.unshift("alms"); a.unshift("amad"); a.unshift("amerce"); a.unshift("amos"); a.unshift("ancestors"); a.unshift("annas"); a.unshift("antothite"); a.unshift("apostleship"); a.unshift("apples"); a.unshift("arabia"); a.unshift("ardites"); a.unshift("ark"); a.unshift("array"); a.unshift("asarelah"); a.unshift("ashkelon"); a.unshift("aspatha"); a.unshift("assurance"); a.unshift("athenians"); a.unshift("augment"); a.unshift("await"); a.unshift("azem"); a.unshift("baana"); a.unshift("backslider"); a.unshift("balah"); a.unshift("baptism"); a.unshift("bark"); a.unshift("basin"); a.unshift("bazluth"); a.unshift("beauties"); a.unshift("beelzebub"); a.unshift("beggar"); a.unshift("beholdeth"); a.unshift("belong"); a.unshift("benjamite"); a.unshift("berothai"); a.unshift("bethel"); a.unshift("bewailed"); a.unshift("bilhah"); a.unshift("biteth"); a.unshift("blasphemers"); a.unshift("blind"); a.unshift("boanerges"); a.unshift("bold"); a.unshift("booties"); a.unshift("boughs"); a.unshift("bracelet"); a.unshift("breakest"); a.unshift("bride"); a.unshift("broken"); a.unshift("bucklers"); a.unshift("bulwarks"); a.unshift("bush"); a.unshift("cab"); a.unshift("calleth"); a.unshift("canaanitish"); a.unshift("carbuncle"); a.unshift("carpenter"); a.unshift("casteth"); a.unshift("ceased"); a.unshift("chain"); a.unshift("changers"); a.unshift("chariots"); a.unshift("chedorlaomer"); a.unshift("cherished"); a.unshift("child"); a.unshift("choosest"); a.unshift("cinnamon"); a.unshift("claudius"); a.unshift("climb"); a.unshift("cluster"); a.unshift("color"); a.unshift("comings"); a.unshift("commonly"); a.unshift("compassed"); a.unshift("conceit"); a.unshift("condition"); a.unshift("confirming"); a.unshift("consent"); a.unshift("consultation"); a.unshift("content"); a.unshift("convert"); a.unshift("cord"); a.unshift("corruptly"); a.unshift("countenances"); a.unshift("covenants"); a.unshift("crag"); a.unshift("cried"); a.unshift("crowns"); a.unshift("cups"); a.unshift("cuth"); a.unshift("dalmatia"); a.unshift("darda"); a.unshift("dawning"); a.unshift("deaths"); a.unshift("deceiver"); a.unshift("decrees"); a.unshift("defer"); a.unshift("deliciously"); a.unshift("den"); a.unshift("descendeth"); a.unshift("despair"); a.unshift("determinate"); a.unshift("dew"); a.unshift("diggedst"); a.unshift("dip"); a.unshift("disciple"); a.unshift("disguised"); a.unshift("displease"); a.unshift("dissolvest"); a.unshift("divideth"); a.unshift("doers"); a.unshift("doubled"); a.unshift("drawers"); a.unshift("drinking"); a.unshift("drunken"); a.unshift("dwellers"); a.unshift("earthquakes"); a.unshift("edar"); a.unshift("eglon"); a.unshift("elder"); a.unshift("eliashib"); a.unshift("elishua"); a.unshift("elymas"); a.unshift("emptied"); a.unshift("encumbereth"); a.unshift("enfolding"); a.unshift("enos"); a.unshift("entrance"); a.unshift("ephesian"); a.unshift("eranites"); a.unshift("eshcol"); a.unshift("esteeming"); a.unshift("euroclydon"); a.unshift("evilfavoredness"); a.unshift("exceeding"); a.unshift("execution"); a.unshift("expound"); a.unshift("ezbon"); a.unshift("fainted"); a.unshift("familiar"); a.unshift("fasted"); a.unshift("favorable"); a.unshift("feedest"); a.unshift("fence"); a.unshift("fifteenth"); a.unshift("filthy"); a.unshift("firstfruit"); a.unshift("flags"); a.unshift("fleshhooks"); a.unshift("floweth"); a.unshift("followeth"); a.unshift("forbore"); a.unshift("foreseeth"); a.unshift("forgiveness"); a.unshift("fort"); a.unshift("fountains"); a.unshift("freed"); a.unshift("front"); a.unshift("fully"); a.unshift("gad"); a.unshift("galilaeans"); a.unshift("garmite"); a.unshift("gaze"); a.unshift("genealogy"); a.unshift("geshurites"); a.unshift("gideon"); a.unshift("girding"); a.unshift("glass"); a.unshift("gnasheth"); a.unshift("gog"); a.unshift("gorgeously"); a.unshift("grasshopper"); a.unshift("greediness"); a.unshift("grinding"); a.unshift("guests"); a.unshift("habergeons"); a.unshift("hadst"); a.unshift("hakupha"); a.unshift("hammer"); a.unshift("handkerchiefs"); a.unshift("hanun"); a.unshift("hare"); a.unshift("harpers"); a.unshift("hashum"); a.unshift("hateth"); a.unshift("hazael"); a.unshift("healed"); a.unshift("hearth"); a.unshift("hedged"); a.unshift("helez"); a.unshift("hena"); a.unshift("heresy"); a.unshift("hewed"); a.unshift("higher"); a.unshift("hiram"); a.unshift("hodaiah"); a.unshift("holy"); a.unshift("hopeth"); a.unshift("horseback"); a.unshift("household"); a.unshift("humiliation"); a.unshift("hurl"); a.unshift("hypocrisy"); a.unshift("idolatry"); a.unshift("imagined"); a.unshift("impoverish"); a.unshift("increasest"); a.unshift("inflicted"); a.unshift("inkhorn"); a.unshift("instructor"); a.unshift("into"); a.unshift("is"); a.unshift("islands"); a.unshift("ithmah"); a.unshift("jaalam"); a.unshift("jadon"); a.unshift("jakeh"); a.unshift("jarkon"); a.unshift("jeaterai"); a.unshift("jehieli"); a.unshift("jehudijah"); a.unshift("jerimoth"); a.unshift("jesse"); a.unshift("jeziah"); a.unshift("joed"); a.unshift("jona"); a.unshift("josiphiah"); a.unshift("juda"); a.unshift("justification"); a.unshift("kedemoth"); a.unshift("kernels"); a.unshift("kindle"); a.unshift("kishion"); a.unshift("knocketh"); a.unshift("laban"); a.unshift("lady"); a.unshift("lancets"); a.unshift("lasea"); a.unshift("lawfully"); a.unshift("leannoth"); a.unshift("led"); a.unshift("leopard"); a.unshift("lewdly"); a.unshift("liest"); a.unshift("lign"); a.unshift("lintels"); a.unshift("lo"); a.unshift("lofty"); a.unshift("lords"); a.unshift("lowering"); a.unshift("lusty"); a.unshift("maaziah"); a.unshift("magicians"); a.unshift("mahol"); a.unshift("maktesh"); a.unshift("manaen"); a.unshift("maoch"); a.unshift("marred"); a.unshift("masrekah"); a.unshift("matthew"); a.unshift("measured"); a.unshift("meet"); a.unshift("melita"); a.unshift("mentioned"); a.unshift("merodach"); a.unshift("messes"); a.unshift("michmash"); a.unshift("mijamin"); a.unshift("minds"); a.unshift("mirth"); a.unshift("missing"); a.unshift("mock"); a.unshift("moneychangers"); a.unshift("mosera"); a.unshift("mouths"); a.unshift("munition"); a.unshift("mustereth"); a.unshift("nabal"); a.unshift("naioth"); a.unshift("naturally"); a.unshift("nebo"); a.unshift("neglecting"); a.unshift("nephtoah"); a.unshift("new"); a.unshift("nineteenth"); a.unshift("noon"); a.unshift("nourishing"); a.unshift("obed"); a.unshift("obtained"); a.unshift("offenses"); a.unshift("oldness"); a.unshift("ono"); a.unshift("oppress"); a.unshift("ordinary"); a.unshift("our"); a.unshift("overcometh"); a.unshift("overtaken"); a.unshift("ozias"); a.unshift("palace"); a.unshift("paphos"); a.unshift("part"); a.unshift("pass"); a.unshift("patience"); a.unshift("peaceable"); a.unshift("pelonite"); a.unshift("perfect"); a.unshift("perizzite"); a.unshift("persons"); a.unshift("pethor"); a.unshift("philemon"); a.unshift("pictures"); a.unshift("pine"); a.unshift("pithon"); a.unshift("planters"); a.unshift("please"); a.unshift("plucketh"); a.unshift("pommels"); a.unshift("portray"); a.unshift("pound"); a.unshift("pray"); a.unshift("prepare"); a.unshift("presume"); a.unshift("princess"); a.unshift("prochorus"); a.unshift("progenitors"); a.unshift("prophesyings"); a.unshift("proverb"); a.unshift("psalm"); a.unshift("pulse"); a.unshift("purim"); a.unshift("puttest"); a.unshift("quickened"); a.unshift("rachal"); a.unshift("raiser"); a.unshift("ransomed"); a.unshift("readeth"); a.unshift("rebel"); a.unshift("reckoned"); a.unshift("redeemedst"); a.unshift("refuse"); a.unshift("reigneth"); a.unshift("remainest"); a.unshift("rendered"); a.unshift("repentest"); a.unshift("reproofs"); a.unshift("reserve"); a.unshift("restoreth"); a.unshift("revealeth"); a.unshift("revolt"); a.unshift("richly"); a.unshift("rinsed"); a.unshift("roaring"); a.unshift("rohgah"); a.unshift("rottenness"); a.unshift("ruins"); a.unshift("s"); a.unshift("sadducees"); a.unshift("salcah"); a.unshift("samaritans"); a.unshift("sapphire"); a.unshift("satyr"); a.unshift("scabbed"); a.unshift("scoff"); a.unshift("scribes"); a.unshift("seas"); a.unshift("seduced"); a.unshift("seir"); a.unshift("sending"); a.unshift("serah"); a.unshift("settest"); a.unshift("shaalbonite"); a.unshift("shalim"); a.unshift("shammah"); a.unshift("sharpeneth"); a.unshift("sheaves"); a.unshift("sheepskins"); a.unshift("shemidaites"); a.unshift("sheth"); a.unshift("shimeath"); a.unshift("shiphrah"); a.unshift("shoco"); a.unshift("shoulders"); a.unshift("shubael"); a.unshift("sibbecai"); a.unshift("sighs"); a.unshift("silverlings"); a.unshift("single"); a.unshift("sitnah"); a.unshift("skippedst"); a.unshift("sleeper"); a.unshift("slowly"); a.unshift("smooth"); a.unshift("soberness"); a.unshift("sold"); a.unshift("soothsayer"); a.unshift("sosipater"); a.unshift("space"); a.unshift("spears"); a.unshift("spikenard"); a.unshift("spokes"); a.unshift("sprinkled"); a.unshift("stalled"); a.unshift("staves"); a.unshift("steward"); a.unshift("stocks"); a.unshift("storehouse"); a.unshift("strangled"); a.unshift("striker"); a.unshift("struck"); a.unshift("subjection"); a.unshift("suchathites"); a.unshift("summer"); a.unshift("supply"); a.unshift("sustenance"); a.unshift("swellings"); a.unshift("syntyche"); a.unshift("tachmonite"); a.unshift("tales"); a.unshift("tarea"); a.unshift("taunting"); a.unshift("tekoa"); a.unshift("temple"); a.unshift("teresh"); a.unshift("thahash"); a.unshift("themselves"); a.unshift("thick"); a.unshift("thirteenth"); a.unshift("threatening"); a.unshift("throughout"); a.unshift("tidings"); a.unshift("timnathserah"); a.unshift("tittle"); a.unshift("tolerable"); a.unshift("tormentors"); a.unshift("trading"); a.unshift("translated"); a.unshift("treason"); a.unshift("tribulations"); a.unshift("troublest"); a.unshift("tubal"); a.unshift("twins"); a.unshift("uncircumcised"); a.unshift("undertook"); a.unshift("unleavened"); a.unshift("unsearchable"); a.unshift("upbraideth"); a.unshift("uriel"); a.unshift("uzai"); a.unshift("vaniah"); a.unshift("venture"); a.unshift("vilely"); a.unshift("virtuous"); a.unshift("vowedst"); a.unshift("waketh"); a.unshift("wanton"); a.unshift("wash"); a.unshift("watchtower"); a.unshift("wayfaring"); a.unshift("weather"); a.unshift("well"); a.unshift("when"); a.unshift("which"); a.unshift("whips"); a.unshift("whoremongers"); a.unshift("willing"); a.unshift("winneth"); a.unshift("withdraw"); a.unshift("wives"); a.unshift("woods"); a.unshift("worshiped"); a.unshift("wrath"); a.unshift("wrongeth"); a.unshift("yoke"); a.unshift("zaccai"); a.unshift("zareth"); a.unshift("zedad"); a.unshift("zereda"); a.unshift("ziklag"); a.unshift("zoba"); return a } catch (b) { Util.HandleError(b) } }, FindSharedSet: function(a) { try { for (var b in a) { var c = a[b]; for (var d = 0; d < c.length; d++) { var e = c[d]; var f = parseInt(e[0]) * 1e8; f = f + parseInt(e[1]) * 1e4; f = f + parseInt(e[2]); a[b][d] = f } } var g = a[0]; for (var d = 1; d < a.length; d++) { g = this.ReturnSharedSet(a[d], g) } for (var d = 0; d < g.length; d++) { var f = g[d]; g[d] = [parseInt(f / 1e8), parseInt(f % 1e8 / 1e4), f % 1e8 % 1e4] } return g } catch (h) { Util.HandleError(h) } }, ReturnSharedSet: function(a, b) { try { var c = 0; var d = a.length < b.length ? a.length : b.length; a.sort(SortNumeric); b.sort(SortNumeric); while (c < d) { if (a[c] == b[c]) { c++ } if (a[c] < b[c]) { a.splice(c, 1) } if (a[c] > b[c]) { b.splice(c, 1) } d = a.length < b.length ? a.length : b.length; if (d == c && d < a.length) { a.splice(c, a.length - c) } if (d == c && d < b.length) { b.splice(c, a.length - c) } } return a } catch (e) { Util.HandleError(e) } } }
\ No newline at end of file
+function Search(a) { try { var b = a.split(";"); for (var c in b) { var d = b[c].trim(); if (d != "") { if (d.search(/[0-9]/i) == -1) { Words.FindReferences(d) } else if (d.search(/(H|G)[0-9]/i) != -1) { var e = d.substring(0, 1); if (e.search(/h/i) != -1) { e = "heb" } else { e = "grk" } d = d.substring(1, d.length); var f = Strongs.GetStrongs(d, e); Strongs.DisplayStrongs(f) } else { var g = ""; if (d.trim() != "") { var h = new Reference(d.trim()); var i = Bible.GetPassage(h.book, h.startchapter, h.endchapter, h.startverse, h.endverse); Bible.DisplayPassage(i.cs, h.book, h.startchapter, h.endchapter, h.startverse, h.endverse, i.testament) } } } } } catch (j) { Util.HandleError(j) } return false } function Traverse(a, b) { try { var c = ""; if (a != null) { if (a.hasChildNodes()) { if (a.nodeName == "s") { var d = ""; if (b == "old") { d = "H" } if (b == "new") { d = "G" } c += "" + d + a.getAttribute("n") + "" + Traverse(a.childNodes.item(0), b) + "" } else { c += "<" + a.nodeName + ">"; for (var e = 0; e < a.childNodes.length; e++) { c += Traverse(a.childNodes.item(e), b) } c += "" + a.nodeName + ">" } } else { if (a.nodeValue != null) { if (a.nodeValue.search(/^(\,|\.|\:|\?|\;|\!)/) != -1) { c += a.nodeValue } else { c += " " + a.nodeValue } } } } return c } catch (f) { Util.HandleError(f) } } function SortNumeric(a, b) { return a - b } String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, "") }; String.prototype.ltrim = function() { return this.replace(/^\s+/, "") }; String.prototype.rtrim = function() { return this.replace(/\s+$/, "") }; var Settings = { ShowHideSearch: function() { var a = $("#showhidesearch"); var b = $("#searchresultswrap"); var c = $("#resultwrap"); if (b.css("display") != "none") { b.css("display", "none"); a.html("Show Search"); c.css("width", "100%") } else { b.css("display", "block"); a.html("Hide Search"); c.css("width", "70%") } }, SwitchPanes: function() { var a = $("#searchresultswrap"); var b = $("#resultwrap"); var c = a.css("float"); if (c == "right") { a.css("float", "left"); b.css("float", "left") } else { a.css("float", "right"); b.css("float", "right") } }, IncreaseResultFontSize: function() { var a = $("#result").css("font-size"); $("#result").css("font-size", parseInt(a) + 1) }, DecreaseResultFontSize: function() { var a = $("#result").css("font-size"); $("#result").css("font-size", parseInt(a) - 1) }, ChangeResultFont: function(a) { $("#result").css("font-family", a) } }; var Util = { HandleLink: function(a) { Search($(a.target).text()) }, HandleHiddenLink: function(a) { Search($(a.target).find(".searchvalue").text()) }, RemoveResult: function(a) { $(a.target).parent().parent().remove() }, HandleError: function(a) { var b = $("
" + a + " "); return false } }; var Bible = { DisplayPassage: function(a, b, c, d, e, f, g) { try { var h = ""; var i = a[a.length - 1].vs.length; if (f == "*" || f > i) { f = i } for (var j = 0; j < a.length; j++) { if (c < d) { h += "Chapter: " + a[j].ch + "
" } var k = a[j].vs; for (var l = 0; l < k.length; l++) { var m = k[l]; h += "" + $(m).attr("n") + ". "; for (var n = 0; n < m.childNodes.length; n++) { h += Traverse(m.childNodes[n], g) } h += "
" } } var o = $("
" + "" + bookName(b) + " " + c + ":" + e + "-" + d + ":" + f + "
" + h + " "); o.find(".hiddenlink").click(function(a) { Util.HandleHiddenLink(a) }); o.find(".removeresult").click(function(a) { Util.RemoveResult(a) }); $("#result").prepend(o) } catch (p) { Util.HandleError(p) } }, GetPassage: function(a, b, c, d, e) { try { var f = []; var g = []; var h = {}; for (var i = b; i <= c; i++) { var j = "xml/" + a + "-" + i + ".xml"; $.ajax({ async: false, type: "GET", url: j, dataType: "xml", success: function(a, b, c) { f.push({ ch: i, vs: a }) }, error: function(a, b, c) { Util.HandleError(c, a) } }) } for (var k = 0; k < f.length; k++) { var l = []; var m; var n; if (k == 0) { m = d } else { m = 1 } if (k + 1 == f.length) { n = e } else { n = "*" } var o = $(f[k].vs).find("v").length; if (n == "*" || n > o) { n = o } for (var i = m; i <= n; i++) { l.push($(f[k].vs).find('v[n="' + i + '"]')[0]) } g.push({ ch: f[k].ch, vs: l }) } h.cs = g; h.testament = $(f[0].vs).find("b").attr("testament"); return h } catch (p) { Util.HandleError(p) } } }; var Strongs = { GetStrongs: function(a, b) { try { var c = this; var d = {}; var e = b + parseInt((a - 1) / 100) + ".xml"; if (b == "grk") { d.prefix = "G" } else { d.prefix = "H" } d.sn = a; $.ajax({ async: false, type: "GET", url: "xml/" + e, dataType: "xml", success: function(a, b, c) { d.strongs = a }, error: function(a, b, c) { Util.HandleError(c, a) } }); $.ajax({ async: false, type: "GET", url: "xml/cr" + e, dataType: "xml", success: function(a, b, c) { d.crossrefs = a }, error: function(a, b, c) { Util.HandleError(c, a) } }); if (b == "grk") { e = "xml/rs" + parseInt((a - 1) / 1e3) + ".xml"; $.ajax({ async: false, type: "GET", url: e, dataType: "xml", success: function(a, b, c) { d.rmac = a }, error: function(a, b, c) { Util.HandleError(c, a) } }); d.rmaccode = $(d.rmac).find('s[id="' + a + '"]').attr("r"); e = "xml/r-" + d.rmaccode.substring(0, 1) + ".xml"; $.ajax({ async: false, type: "GET", url: e, dataType: "xml", success: function(a, b, c) { d.rmac = a }, error: function(a, b, c) { Util.HandleError(c, a) } }) } return d } catch (f) { Util.HandleError(f) } }, DisplayStrongs: function(a) { try { var b = $(a.strongs).find("i#" + a.prefix + a.sn); var c = $(b).find("t").text(); var d = $(b).find("tr").text(); var e = $(b).find("p").text(); var f = Traverse($(b).find("d")[0]); var g = /([hg][0-9]{1,4})/gi; f = f.replace(g, "$1"); var h = $(a.crossrefs).find("i#" + a.prefix + a.sn).find("rs"); var i = "Cross References: Show"; h.each(function(a) { i += "" + $(this).find("t").text() + ": "; $(this).find("r").each(function(a) { var b = $(this).attr("r").split(";"); i += "" + bookName(b[0]) + " " + b[1] + ":" + b[2] + ", " }); i = i.substr(0, i.length - 2); i += "
" }); i += " "; var j = ""; if (a.prefix == "G") { j += "Robinsons Morphological Analysis Code: " + a.rmaccode + " Show"; $(a.rmac).find('i[id="' + a.rmaccode.toUpperCase() + '"]').find("d").each(function() { j += $(this).text() + "
" }); j += " " } var k = $("
" + d + " (" + a.sn + ") - " + e + " - " + c + " - " + f + "
" + j + i + " "); k.find(".link").click(function(a) { Util.HandleLink(a) }); k.find(".removeresult").click(function(a) { Util.RemoveResult(a) }); k.find(".showhide").click(function(a) { Strongs.ShowHide(a) }); $("#result").prepend(k); return false } catch (l) { Util.HandleError(l) } }, ShowHide: function(a) { var b = $(a.target); var c = b.parent().find(".contents"); if (c.css("display") != "none") { c.css("display", "none"); b.html("Show") } else { c.css("display", "inline"); b.html("Hide") } } }; var Words = { ConvertResultsToArray: function(a) { try { var b = new Array; $(a).each(function() { b.push([$(this).attr("b"), $(this).attr("ch"), $(this).attr("v")]) }); return b } catch (c) { Util.HandleError(c) } }, DisplayResults: function(a, b) { try { var c = ""; var f = $(c); f.find(".link").click(function(a) { Util.HandleLink(a) }); $("#searchresults").html(f); $("#searchTotal").html(a.length); return false } catch (g) { Util.HandleError(g) } }, FindReferences: function(a) { try { a = a.toLowerCase(); var b = a.split(" "); var c; var d = this.BuildIndexArray().sort(); var e = new Array; for (i = 0; i < b.length; i++) { var a = b[i]; for (var f = 0; f < d.length; f++) { if (f == d.length) { if (a >= d[f]) { e.unshift(this.ConvertResultsToArray(this.GetSearchReferences("index/i" + d[f] + ".xml", a))); break } } else { if (a >= d[f] && a < d[f + 1]) { e.unshift(this.ConvertResultsToArray(this.GetSearchReferences("index/i" + d[f] + ".xml", a))); break } } } } if (e.length == 1) { this.DisplayResults(e[0], a) } else { this.DisplayResults(this.FindSharedSet(e), a) } return false } catch (g) { Util.HandleError(g) } }, GetSearchReferences: function(a, b) { try { var c; $.ajax({ async: false, type: "GET", url: a, dataType: "xml", success: function(a, b, d) { c = a }, error: function(a, b, c) { Util.HandleError(c, a) } }); var d = $(c).find('i[w="' + b + '"]').children(); return d } catch (e) { Util.HandleError(e) } }, BuildIndexArray: function() { try { var a = new Array; a.unshift("abhorring"); a.unshift("abinoam"); a.unshift("abounding"); a.unshift("acceptest"); a.unshift("accuseth"); a.unshift("acquainting"); a.unshift("addeth"); a.unshift("admonition"); a.unshift("adulteries"); a.unshift("affected"); a.unshift("afterwards"); a.unshift("aharah"); a.unshift("ahio"); a.unshift("aijalon"); a.unshift("aliah"); a.unshift("alms"); a.unshift("amad"); a.unshift("amerce"); a.unshift("amos"); a.unshift("ancestors"); a.unshift("annas"); a.unshift("antothite"); a.unshift("apostleship"); a.unshift("apples"); a.unshift("arabia"); a.unshift("ardites"); a.unshift("ark"); a.unshift("array"); a.unshift("asarelah"); a.unshift("ashkelon"); a.unshift("aspatha"); a.unshift("assurance"); a.unshift("athenians"); a.unshift("augment"); a.unshift("await"); a.unshift("azem"); a.unshift("baana"); a.unshift("backslider"); a.unshift("balah"); a.unshift("baptism"); a.unshift("bark"); a.unshift("basin"); a.unshift("bazluth"); a.unshift("beauties"); a.unshift("beelzebub"); a.unshift("beggar"); a.unshift("beholdeth"); a.unshift("belong"); a.unshift("benjamite"); a.unshift("berothai"); a.unshift("bethel"); a.unshift("bewailed"); a.unshift("bilhah"); a.unshift("biteth"); a.unshift("blasphemers"); a.unshift("blind"); a.unshift("boanerges"); a.unshift("bold"); a.unshift("booties"); a.unshift("boughs"); a.unshift("bracelet"); a.unshift("breakest"); a.unshift("bride"); a.unshift("broken"); a.unshift("bucklers"); a.unshift("bulwarks"); a.unshift("bush"); a.unshift("cab"); a.unshift("calleth"); a.unshift("canaanitish"); a.unshift("carbuncle"); a.unshift("carpenter"); a.unshift("casteth"); a.unshift("ceased"); a.unshift("chain"); a.unshift("changers"); a.unshift("chariots"); a.unshift("chedorlaomer"); a.unshift("cherished"); a.unshift("child"); a.unshift("choosest"); a.unshift("cinnamon"); a.unshift("claudius"); a.unshift("climb"); a.unshift("cluster"); a.unshift("color"); a.unshift("comings"); a.unshift("commonly"); a.unshift("compassed"); a.unshift("conceit"); a.unshift("condition"); a.unshift("confirming"); a.unshift("consent"); a.unshift("consultation"); a.unshift("content"); a.unshift("convert"); a.unshift("cord"); a.unshift("corruptly"); a.unshift("countenances"); a.unshift("covenants"); a.unshift("crag"); a.unshift("cried"); a.unshift("crowns"); a.unshift("cups"); a.unshift("cuth"); a.unshift("dalmatia"); a.unshift("darda"); a.unshift("dawning"); a.unshift("deaths"); a.unshift("deceiver"); a.unshift("decrees"); a.unshift("defer"); a.unshift("deliciously"); a.unshift("den"); a.unshift("descendeth"); a.unshift("despair"); a.unshift("determinate"); a.unshift("dew"); a.unshift("diggedst"); a.unshift("dip"); a.unshift("disciple"); a.unshift("disguised"); a.unshift("displease"); a.unshift("dissolvest"); a.unshift("divideth"); a.unshift("doers"); a.unshift("doubled"); a.unshift("drawers"); a.unshift("drinking"); a.unshift("drunken"); a.unshift("dwellers"); a.unshift("earthquakes"); a.unshift("edar"); a.unshift("eglon"); a.unshift("elder"); a.unshift("eliashib"); a.unshift("elishua"); a.unshift("elymas"); a.unshift("emptied"); a.unshift("encumbereth"); a.unshift("enfolding"); a.unshift("enos"); a.unshift("entrance"); a.unshift("ephesian"); a.unshift("eranites"); a.unshift("eshcol"); a.unshift("esteeming"); a.unshift("euroclydon"); a.unshift("evilfavoredness"); a.unshift("exceeding"); a.unshift("execution"); a.unshift("expound"); a.unshift("ezbon"); a.unshift("fainted"); a.unshift("familiar"); a.unshift("fasted"); a.unshift("favorable"); a.unshift("feedest"); a.unshift("fence"); a.unshift("fifteenth"); a.unshift("filthy"); a.unshift("firstfruit"); a.unshift("flags"); a.unshift("fleshhooks"); a.unshift("floweth"); a.unshift("followeth"); a.unshift("forbore"); a.unshift("foreseeth"); a.unshift("forgiveness"); a.unshift("fort"); a.unshift("fountains"); a.unshift("freed"); a.unshift("front"); a.unshift("fully"); a.unshift("gad"); a.unshift("galilaeans"); a.unshift("garmite"); a.unshift("gaze"); a.unshift("genealogy"); a.unshift("geshurites"); a.unshift("gideon"); a.unshift("girding"); a.unshift("glass"); a.unshift("gnasheth"); a.unshift("gog"); a.unshift("gorgeously"); a.unshift("grasshopper"); a.unshift("greediness"); a.unshift("grinding"); a.unshift("guests"); a.unshift("habergeons"); a.unshift("hadst"); a.unshift("hakupha"); a.unshift("hammer"); a.unshift("handkerchiefs"); a.unshift("hanun"); a.unshift("hare"); a.unshift("harpers"); a.unshift("hashum"); a.unshift("hateth"); a.unshift("hazael"); a.unshift("healed"); a.unshift("hearth"); a.unshift("hedged"); a.unshift("helez"); a.unshift("hena"); a.unshift("heresy"); a.unshift("hewed"); a.unshift("higher"); a.unshift("hiram"); a.unshift("hodaiah"); a.unshift("holy"); a.unshift("hopeth"); a.unshift("horseback"); a.unshift("household"); a.unshift("humiliation"); a.unshift("hurl"); a.unshift("hypocrisy"); a.unshift("idolatry"); a.unshift("imagined"); a.unshift("impoverish"); a.unshift("increasest"); a.unshift("inflicted"); a.unshift("inkhorn"); a.unshift("instructor"); a.unshift("into"); a.unshift("is"); a.unshift("islands"); a.unshift("ithmah"); a.unshift("jaalam"); a.unshift("jadon"); a.unshift("jakeh"); a.unshift("jarkon"); a.unshift("jeaterai"); a.unshift("jehieli"); a.unshift("jehudijah"); a.unshift("jerimoth"); a.unshift("jesse"); a.unshift("jeziah"); a.unshift("joed"); a.unshift("jona"); a.unshift("josiphiah"); a.unshift("juda"); a.unshift("justification"); a.unshift("kedemoth"); a.unshift("kernels"); a.unshift("kindle"); a.unshift("kishion"); a.unshift("knocketh"); a.unshift("laban"); a.unshift("lady"); a.unshift("lancets"); a.unshift("lasea"); a.unshift("lawfully"); a.unshift("leannoth"); a.unshift("led"); a.unshift("leopard"); a.unshift("lewdly"); a.unshift("liest"); a.unshift("lign"); a.unshift("lintels"); a.unshift("lo"); a.unshift("lofty"); a.unshift("lords"); a.unshift("lowering"); a.unshift("lusty"); a.unshift("maaziah"); a.unshift("magicians"); a.unshift("mahol"); a.unshift("maktesh"); a.unshift("manaen"); a.unshift("maoch"); a.unshift("marred"); a.unshift("masrekah"); a.unshift("matthew"); a.unshift("measured"); a.unshift("meet"); a.unshift("melita"); a.unshift("mentioned"); a.unshift("merodach"); a.unshift("messes"); a.unshift("michmash"); a.unshift("mijamin"); a.unshift("minds"); a.unshift("mirth"); a.unshift("missing"); a.unshift("mock"); a.unshift("moneychangers"); a.unshift("mosera"); a.unshift("mouths"); a.unshift("munition"); a.unshift("mustereth"); a.unshift("nabal"); a.unshift("naioth"); a.unshift("naturally"); a.unshift("nebo"); a.unshift("neglecting"); a.unshift("nephtoah"); a.unshift("new"); a.unshift("nineteenth"); a.unshift("noon"); a.unshift("nourishing"); a.unshift("obed"); a.unshift("obtained"); a.unshift("offenses"); a.unshift("oldness"); a.unshift("ono"); a.unshift("oppress"); a.unshift("ordinary"); a.unshift("our"); a.unshift("overcometh"); a.unshift("overtaken"); a.unshift("ozias"); a.unshift("palace"); a.unshift("paphos"); a.unshift("part"); a.unshift("pass"); a.unshift("patience"); a.unshift("peaceable"); a.unshift("pelonite"); a.unshift("perfect"); a.unshift("perizzite"); a.unshift("persons"); a.unshift("pethor"); a.unshift("philemon"); a.unshift("pictures"); a.unshift("pine"); a.unshift("pithon"); a.unshift("planters"); a.unshift("please"); a.unshift("plucketh"); a.unshift("pommels"); a.unshift("portray"); a.unshift("pound"); a.unshift("pray"); a.unshift("prepare"); a.unshift("presume"); a.unshift("princess"); a.unshift("prochorus"); a.unshift("progenitors"); a.unshift("prophesyings"); a.unshift("proverb"); a.unshift("psalm"); a.unshift("pulse"); a.unshift("purim"); a.unshift("puttest"); a.unshift("quickened"); a.unshift("rachal"); a.unshift("raiser"); a.unshift("ransomed"); a.unshift("readeth"); a.unshift("rebel"); a.unshift("reckoned"); a.unshift("redeemedst"); a.unshift("refuse"); a.unshift("reigneth"); a.unshift("remainest"); a.unshift("rendered"); a.unshift("repentest"); a.unshift("reproofs"); a.unshift("reserve"); a.unshift("restoreth"); a.unshift("revealeth"); a.unshift("revolt"); a.unshift("richly"); a.unshift("rinsed"); a.unshift("roaring"); a.unshift("rohgah"); a.unshift("rottenness"); a.unshift("ruins"); a.unshift("s"); a.unshift("sadducees"); a.unshift("salcah"); a.unshift("samaritans"); a.unshift("sapphire"); a.unshift("satyr"); a.unshift("scabbed"); a.unshift("scoff"); a.unshift("scribes"); a.unshift("seas"); a.unshift("seduced"); a.unshift("seir"); a.unshift("sending"); a.unshift("serah"); a.unshift("settest"); a.unshift("shaalbonite"); a.unshift("shalim"); a.unshift("shammah"); a.unshift("sharpeneth"); a.unshift("sheaves"); a.unshift("sheepskins"); a.unshift("shemidaites"); a.unshift("sheth"); a.unshift("shimeath"); a.unshift("shiphrah"); a.unshift("shoco"); a.unshift("shoulders"); a.unshift("shubael"); a.unshift("sibbecai"); a.unshift("sighs"); a.unshift("silverlings"); a.unshift("single"); a.unshift("sitnah"); a.unshift("skippedst"); a.unshift("sleeper"); a.unshift("slowly"); a.unshift("smooth"); a.unshift("soberness"); a.unshift("sold"); a.unshift("soothsayer"); a.unshift("sosipater"); a.unshift("space"); a.unshift("spears"); a.unshift("spikenard"); a.unshift("spokes"); a.unshift("sprinkled"); a.unshift("stalled"); a.unshift("staves"); a.unshift("steward"); a.unshift("stocks"); a.unshift("storehouse"); a.unshift("strangled"); a.unshift("striker"); a.unshift("struck"); a.unshift("subjection"); a.unshift("suchathites"); a.unshift("summer"); a.unshift("supply"); a.unshift("sustenance"); a.unshift("swellings"); a.unshift("syntyche"); a.unshift("tachmonite"); a.unshift("tales"); a.unshift("tarea"); a.unshift("taunting"); a.unshift("tekoa"); a.unshift("temple"); a.unshift("teresh"); a.unshift("thahash"); a.unshift("themselves"); a.unshift("thick"); a.unshift("thirteenth"); a.unshift("threatening"); a.unshift("throughout"); a.unshift("tidings"); a.unshift("timnathserah"); a.unshift("tittle"); a.unshift("tolerable"); a.unshift("tormentors"); a.unshift("trading"); a.unshift("translated"); a.unshift("treason"); a.unshift("tribulations"); a.unshift("troublest"); a.unshift("tubal"); a.unshift("twins"); a.unshift("uncircumcised"); a.unshift("undertook"); a.unshift("unleavened"); a.unshift("unsearchable"); a.unshift("upbraideth"); a.unshift("uriel"); a.unshift("uzai"); a.unshift("vaniah"); a.unshift("venture"); a.unshift("vilely"); a.unshift("virtuous"); a.unshift("vowedst"); a.unshift("waketh"); a.unshift("wanton"); a.unshift("wash"); a.unshift("watchtower"); a.unshift("wayfaring"); a.unshift("weather"); a.unshift("well"); a.unshift("when"); a.unshift("which"); a.unshift("whips"); a.unshift("whoremongers"); a.unshift("willing"); a.unshift("winneth"); a.unshift("withdraw"); a.unshift("wives"); a.unshift("woods"); a.unshift("worshiped"); a.unshift("wrath"); a.unshift("wrongeth"); a.unshift("yoke"); a.unshift("zaccai"); a.unshift("zareth"); a.unshift("zedad"); a.unshift("zereda"); a.unshift("ziklag"); a.unshift("zoba"); return a } catch (b) { Util.HandleError(b) } }, FindSharedSet: function(a) { try { for (var b in a) { var c = a[b]; for (var d = 0; d < c.length; d++) { var e = c[d]; var f = parseInt(e[0]) * 1e8; f = f + parseInt(e[1]) * 1e4; f = f + parseInt(e[2]); a[b][d] = f } } var g = a[0]; for (var d = 1; d < a.length; d++) { g = this.ReturnSharedSet(a[d], g) } for (var d = 0; d < g.length; d++) { var f = g[d]; g[d] = [parseInt(f / 1e8), parseInt(f % 1e8 / 1e4), f % 1e8 % 1e4] } return g } catch (h) { Util.HandleError(h) } }, ReturnSharedSet: function(a, b) { try { var c = 0; var d = a.length < b.length ? a.length : b.length; a.sort(SortNumeric); b.sort(SortNumeric); while (c < d) { if (a[c] == b[c]) { c++ } if (a[c] < b[c]) { a.splice(c, 1) } if (a[c] > b[c]) { b.splice(c, 1) } d = a.length < b.length ? a.length : b.length; if (d == c && d < a.length) { a.splice(c, a.length - c) } if (d == c && d < b.length) { b.splice(c, a.length - c) } } return a } catch (e) { Util.HandleError(e) } } }
\ No newline at end of file