<!-- hide
// Copyright (c) BENJAMIN Z. LEVY 2000
// JavaScript Data and routines to implement Book Chapter Verse Selection
// Quotes implementation 9-21-00
// Stories implementation 1-23-01
Stories = new Array (
"1,1,3-5","1,3,1-24","1,4,3-7",
"1,4,3-15","1,7,17-24","1,7,7-12",
"1,11,1-9","1,17,1-23","1,19,12-26",
"1,21,9-14","1,21,14-20","1,22,1-15",
"1,22,16-17","1,23,1-20","1,24,1-26",
"1,24,63-67","1,27,10-12","1,29,16-20",
"1,32,10-13","1,32,25-31","1,37,18-29",
"1,41,1-38","1,45,1-5","1,46, 5-7",
"2,2,5-10","2,3,4-17","2,7,8-13",
"2,12,29-31","2,12,31-33","2,32,15",
"2,32,15-19","4,13,1-25","4,16,1-35",
"4,21,4-9","4,22,21-36","6,5,13-15",
"6,6,1-20","6,6,25","6,7,1-25",
"6,8,1-29","6,10,1-11","7,4,15-22",
"7,9,1-5","7,9,50-56","7,14,5-6",
"7,15,14-17","7,16,4-22","7,16,27-31",
"7,19,28-30","7,21,1-23","8,10,1",
"8,15,32-34","8,17,23-55","8,19,1-7",
"8,24,1-22","8,28,7-25","8,31,4-5",
"8,31,11-13","9,2,12-17","9,18,9-15",
"9,19,1-2","9,21,8-10","9,21,15-17",
"9,24,1-25","10,3,16-28","10,5,16-25",
"10,10,1-13","10,17,8-24","10,18,19-40",
"10,19,1-9","10,20,1-29","10,22,34",
"11,1,9-12","11,2,11","11,2,23-24",
"11,6,25-26","11,9,30-33","11,9,34-37",
"11,11,13-16","11,17,25","11,19,35",
"11,25,7","12,27,1","13,36,4",
"14,37,1-14","19,3,4","25,6,1",
"29,1,14-20","29,2,8","31,2,5-17",
"34,1,10-12","34,4,4","34,6,10-11",
"34,7,1-6","35,3,32-26","35,4,1-4",
"35,5,1-5","35,6,25","36,1,7-8",
"36,3,10-13","36,7,11-26","37,2,13",
"37,8,1-5"
);
function StoryNum (CategoryNum,ShouldSel)
{
var j=0;
var i = CategoryNum;
var QuotesInCategory;
var QuoteText;
var QinCat;

	if (CategoryNum == "0")
		{ return; }



// 1st get all quotes for this category.
    QuoteText = Stories[parseInt(i)-1];


// 2nd split quotes in this category into an array. based on ~ separator
	QinCat = QuoteText.split("~");


// 	  get how many quotes in this category
		QuotesInCategory = QinCat.length;
		
//    document.myForm.quotes.length = QuotesInCategory;
//	  for(j=0;j< QuotesInCategory;j++)	{
//	     document.myForm.quotes.options[j].value =(j+1);
//	     document.myForm.quotes.options[j].text = "Quote "+(j+1);
// 	  }
        if (ShouldSel)	{
//           document.myForm.quotes.options[0].selected = true;    //select first quote when category changes.

// parse the quote in table. 9-26-00

// 3rd split into book chapter verse array. example: 1 1 1
	BCV = QinCat[0].split(",");


// 4th set the Book and Chapter  fields:
document.myForm.books.selectedIndex=parseInt(BCV[0])-1;
// run the chapter stuffer 
ChapNum (parseInt(BCV[0]),0);

document.myForm.chapters.selectedIndex=parseInt(BCV[1])-1;

// run the verses stuffer 
VerseNum (parseInt(BCV[0]),parseInt(BCV[1]),0);

// 5th set the verses1 and verses2 fields
	QVerses = BCV[2].split("-");
	document.myForm.verses1.selectedIndex=parseInt(QVerses[0])-1;
	if (QVerses.length ==1)	{

		document.myForm.verses2.selectedIndex=parseInt(QVerses[0])-1;
	}
	else	{
		document.myForm.verses2.selectedIndex=parseInt(QVerses[1])-1;

	}

//	alert("Book= "+BCV[0] +" Chapter = "+BCV[1]+" length of Verse = "+QVerses.length);
        }
  return;
}


Quote = new Array (
"13,33,6~27,37,11","12,30,20-21","27,34,19~29,5,6-7",
"2,20,12~28,3,1-2~27,71,18","28,20,1~28,23,20-21","28,16,32~28,30,33",
"28,15,1","28,16,16~8,2,3","3,23,27",
"27,84,10~28,16,20~2,23,2","27,119,105","4,6,24-26",
"28,27,2","2,23,8~33,7,7~28,15,27","27,133,1~28,18,19~1,4,9",
"33,5,10","3,25,10","13,13,23",
"28,15,13~28,15,15","27,8,2~28,10,1~1,9,7","12,7,15~6,24,15~10,17,16",
"27,27,4~12,56,7~27,122,1","5,16,18-19","27,23,1-4~27,9,9~27,30,5",
"27,37,5","28,18,11~28,26,12","27,51,3~27,51,7~27,51,10",
"28,25,8-9","10,19,12~27,38,4","28,14,30~28,17,1",
"5,31,20~28,28,1~27,27,1","29,13,4","2,20,17",
"1,1,1-3~12,40,12","12,21,11~28,27,12","15,13,14~9,14,14~9,12,23~29,5,26~29,3,17",
"28,22,7~28,3,27-28","28,20,17~27,120,2","27,55,4-6~27,14,22",
"28,21,6~28,19,18~28,3,12~28,15,32","26,2,14-16","13,8,22",
"28,31,6-7","29,15,12~28,4,23","27,138,3",
"28,16,7~27,35,5-6~28,25,21~27,27,5-6","12,11,9~4,35,33~12,66,1~1,2,15","29,5,2~28,14,30",
"27,7,11~2,23,2~27,97,10~12,48,22","35,5,27","27,98,9~33,9,11",
"28,20,7~27,128,3~1,28,14~14,16,44~28,17,6","27,23,4~27,111,10~12,41,13~27,46,1-2~27,91,5-7","1,1,29",
"27,14,1~28,29,11","3,25,10","33,4,9-10",
"28,27,1","33,3,13","33,11,1-2~28,28,27",
"28,15,1~28,11,17","27,22,1~29,6,11","28,13,16",
"5,33,27~27,100,3~27,104,2-4~2,15,18~27,73,23-26~13,16,19~9,22,29~27,121,1-3~27,121,8","1,50,20~17,5,14","28,20,19~28,25,18~28,16,28~3,19,16",
"28,15,27","12,35,10","13,14,20~28,28,1~14,18,20",
"12,35,5-6","29,5,17-18~5,26,11~27,118,24","3,19,17~28,10,12",
"27,147,3","28,14,30","27,51,10",
"27,46,1","27,68,6~28,11,29~28,24,3-4","29,6,25~2,20,15-16",
"28,13,12","27,37,11","2,20,3-5",
"27,16,8-9","29,8,21~1,21,6","28,6,6~28,20,4~33,5,18-19",
"28,1,7~15,4,6~28,10,14","27,39,4~33,3,1-2","27,102,7~1,2,18",
"30,6,3","28,17,17","2,20,16~28,12,22",
"28,18,22~1,2,23~1,29,20","6,1,8~27,1,1-2","27,37,11~28,15,1",
"27,85,10","28,23,4-5~27,37,16~28,27,24","38,16,23~12,30,29",
"1,1,31~29,37,14","28,27,10~28,3,29","28,15,30~28,25,25~12,52,7",
"1,31,16~10,3,14","3,19,32~29,11,17~28,20,29~1,15,15~29,32,7","28,3,31~27,9,9~12,1,17",
"2,20,12~28,1,8","27,37,7-9","27,33,12~28,14,34",
"12,2,4","2,23,2~28,4,15-16","12,9,10",
"1,45,18~2,3,8","28,29,18~27,144,15~12,2,4~27,58,1-2","5,15,7-8~5,24,14-15~28,14,31",
"27,50,15","28,16,18~27,138,6","1,9,13~1,8,22",
"28,13,10","27,46,10~12,30,15~28,17,1","27,60,3",
"12,1,18","28,18,14","5,8,2",
"27,34,18","28,22,1","2,3,5~3,19,32",
"1,2,3","35,2,22~5,29,28","14,21,27",
"27,55,12","2,20,8-10~14,20,43","8,15,22",
"27,27,1~27,62,1","33,7,25~30,7,17-21","33,3,1~30,2,11-13",
"27,44,21","28,25,28","28,18,1",
"12,65,3-5~28,25,14","30,1,2","13,17,14",
"27,119,176~12,1,18~4,32,23","1,2,7","25,4,6~28,20,27",
"3,24,22~2,2,22","28,13,19","2,20,7",
"28,16,24~28,17,27~28,29,20","27,107,1~27,100,4~27,92,1~27,79,13","27,90,4",
"27,46,1","27,85,10~27,119,30","28,4,7~10,3,9",
"29,11,16~27,126,5","17,3,3","33,1,2-4",
"28,26,27","20,7,2~28,16,29~28,4,17-18","29,8,20~27,51,10",
"33,5,5~28,20,25","27,40,1~27,27,14","9,1,25~9,2,26~27,44,6~5,20,1",
"30,2,10-13","29,28,12~29,28,28","33,9,10~28,28,19",
"12,40,15~3,14,21","27,127,2");


function QuoteNum (CategoryNum,ShouldSel)
{
var j=0;
var i = CategoryNum;
var QuotesInCategory;
var QuoteText;
var QinCat;

	if (CategoryNum == "0")
		{ return; }

// 1st get all quotes for this category.
	QuoteText = Quote[parseInt(i)-1];
// 2nd split quotes in this category into an array. based on ~ separator
	QinCat = QuoteText.split("~");


// 	  get how many quotes in this category
		QuotesInCategory = QinCat.length;
		
    document.myForm.quotes.length = QuotesInCategory;  
	  for(j=0;j< QuotesInCategory;j++)	{
	     document.myForm.quotes.options[j].value =(j+1);
	     document.myForm.quotes.options[j].text = "Quote "+(j+1);
 	  }
        if (ShouldSel)	{
           document.myForm.quotes.options[0].selected = true;    //select first quote when category changes.

// parse the quote in table. 9-26-00

// 3rd split into book chapter verse array. example: 1 1 1
	BCV = QinCat[0].split(",");


// 4th set the Book and Chapter  fields:
document.myForm.books.selectedIndex=parseInt(BCV[0])-1;
// run the chapter stuffer 
ChapNum (parseInt(BCV[0]),0);

document.myForm.chapters.selectedIndex=parseInt(BCV[1])-1;

// run the verses stuffer 
VerseNum (parseInt(BCV[0]),parseInt(BCV[1]),0);

// 5th set the verses1 and verses2 fields
	QVerses = BCV[2].split("-");
	document.myForm.verses1.selectedIndex=parseInt(QVerses[0])-1;
	if (QVerses.length ==1)	{

		document.myForm.verses2.selectedIndex=parseInt(QVerses[0])-1;
	}
	else	{
		document.myForm.verses2.selectedIndex=parseInt(QVerses[1])-1;

	}

//	alert("Book= "+BCV[0] +" Chapter = "+BCV[1]+" length of Verse = "+QVerses.length);
        }
  return;
}

//~~~~~~~~~~~~~~~~
function QuoteChange (CategoryNum,QuoteNum,ShouldSel)
{
var j=0;
var i = CategoryNum;
var QuotesInCategory;
var QuoteText;
var QinCat;
var BCV;
var QVerses;
 var k = QuoteNum;

        if (ShouldSel)	{

// parse the quote in table. 9-26-00

// 1st get all quotes for this category.
	QuoteText = Quote[parseInt(i)-1];
// 2nd split quotes in this category into an array. based on ~ separator
	QinCat = QuoteText.split("~");
// 3rd split into book chapter verse array. example: 1 1 1
	BCV = QinCat[parseInt(k)-1].split(",");


// 4th set the Book and Chapter  fields:
document.myForm.books.selectedIndex=parseInt(BCV[0])-1;
// run the chapter stuffer 
ChapNum (parseInt(BCV[0]),0);

document.myForm.chapters.selectedIndex=parseInt(BCV[1])-1;

// run the verses stuffer 
VerseNum (parseInt(BCV[0]),parseInt(BCV[1]),0);

// 5th set the verses1 and verses2 fields
	QVerses = BCV[2].split("-");
	document.myForm.verses1.selectedIndex=parseInt(QVerses[0])-1;
	if (QVerses.length ==1)	{

		document.myForm.verses2.selectedIndex=parseInt(QVerses[0])-1;
	}
	else	{
		document.myForm.verses2.selectedIndex=parseInt(QVerses[1])-1;

	}

//	alert("Book= "+BCV[0] +" Chapter = "+BCV[1]+" length of Verse = "+QVerses.length);
        }
  return;
}

//~~~~~~~~~~~~~~~~~

Verses = new Array (39);
Verses[0] = new Array (
//book01 Genesis
51,31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,54,33,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,33,26);
Verses[1] = new Array (
//book02 Exodus
41,22,25,22,31,23,30,29,28,35,29,10,51,22,31,27,36,16,27,25,23,37,30,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38);
Verses[2] = new Array (
//book03 Leviticus
28,17,16,17,35,26,23,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,46,34);
Verses[3] = new Array (
//book04 Numbers
37,54,34,51,49,31,27,89,26,23,36,35,16,33,45,41,35,28,32,22,29,35,41,30,25,18,65,23,31,39,17,54,42,56,29,34,13);
Verses[4] = new Array (
//book05 Deutoranomy
35,46,37,29,49,30,25,26,20,29,22,32,31,19,29,23,22,20,22,21,20,23,29,26,22,19,19,26,69,28,20,30,52,29,12);
Verses[5] = new Array (
//book06 Joshua
25,18,24,17,24,15,27,26,35,27,43,23,24,33,15,63,10,18,28,51,9,43,34,16,33);
Verses[6] = new Array (
//book07 Judges
22,36,23,31,24,31,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,25);
Verses[7] = new Array (
//book08 Samuel 1
32,28,36,21,22,12,21,17,22,27,27,15,25,23,52,35,23,58,30,24,42,16,23,29,22,44,25,12,25,11,31,13);
Verses[8] = new Array (
//book09 Samuel 2
25,27,32,39,12,25,23,29,18,13,19,27,31,39,33,37,23,29,32,44,26,22,51,39,25);
Verses[9] = new Array (
//book10 Kings 1
23,53,46,28,20,32,38,51,66,28,29,43,33,34,31,34,34,24,46,21,43,29,54);
Verses[10] = new Array (
//book11 Kings 2
26,18,25,27,44,27,33,20,29,37,36,20,22,25,29,38,20,41,37,37,21,26,20,37,20,30);
Verses[11] = new Array (
//book12 Isaiah
67,31,22,26,6,30,13,25,23,20,34,16,6,22,32,9,14,14,7,25,6,17,25,18,23,12,21,13,29,24,33,9,20,24,17,10,22,38,22,8,31,29,25,28,28,25,13,15,22,26,11,23,15,12,17,13,12,21,14,21,22,11,12,19,11,25,24);
Verses[12] = new Array (
//book13 Jeremiah
53,19,37,25,31,31,30,34,23,25,25,23,17,27,22,21,21,27,23,15,18,14,30,40,10,38,24,22,17,32,25,39,44,26,22,19,32,21,28,18,16,18,22,13,30,5,28,7,47,39,46,64,34);
Verses[13] = new Array (
//book14 Ezekiel
49,28,10,27,17,17,14,27,18,11,22,25,28,23,23,8,63,24,32,14,44,37,31,49,27,17,21,36,26,21,26,18,32,33,31,15,38,28,23,29,49,26,20,27,31,25,24,23,35);
Verses[14] = new Array (
//book15 Hoshea
15,9,25,5,19,15,11,16,14,17,15,11,15,15,10);
Verses[15] = new Array (
//book16 Joel
5,20,27,5,21);
Verses[16] = new Array (
//book17 Amos
10,15,16,15,13,27,14,17,14,15);
Verses[17] = new Array (
//book18 Obadia
2,21);
Verses[18] = new Array (
//book19 Jonah
5,16,11,10,11);
Verses[19] = new Array (
//book20 Micha
8,16,13,12,14,14,16,20);
Verses[20] = new Array (
//book21 Nakhum
4,14,14,19);
Verses[21] = new Array (
//book22 Habakkuk
4,17,20,19);
Verses[22] = new Array (
//book23 Zephania
4,18,15,20);
Verses[23] = new Array (
//book24 Haggai
3,15,23);
Verses[24] = new Array (
//book25 Zekharia
15,17,17,10,14,11,15,14,23,17,12,17,14,9,21);
Verses[25] = new Array (
//book26 Malakhi
4,14,17,24);
Verses[26] = new Array (
//book27 Psalms
151,6,12,9,9,13,11,18,10,21,18,7,9,6,7,5,11,15,51,15,10,14,32,6,10,22,12,14,9,11,13,25,11,22,23,28,13,40,23,14,18,14,12,5,27,18,12,10,15,21,23,21,11,7,9,24,14,12,12,18,14,9,13,12,11,14,20,8,36,37,6,24,20,28,23,11,13,21,72,13,20,17,8,19,13,14,17,7,19,53,17,16,16,5,23,11,13,12,9,9,5,8,29,22,35,45,48,43,14,31,7,10,10,9,8,18,19,2,29,176,7,8,9,4,8,5,6,5,6,8,8,3,18,3,3,21,26,9,8,24,14,10,8,12,15,21,10,20,14,9,6);
Verses[27] = new Array (
//book28 Proverbs
32,33,22,35,27,23,35,27,36,18,32,31,28,25,35,33,33,28,24,29,30,31,29,35,34,28,28,27,28,27,33,31);
Verses[28] = new Array (
//book29 Job
43,22,13,26,21,27,30,21,22,35,22,20,25,28,22,35,22,16,21,29,29,34,30,17,25,6,14,23,28,25,31,40,22,33,37,16,33,24,41,30,32,26,17);
Verses[29] = new Array (
//book30 Song of Songs
9,17,17,11,16,16,12,14,14);
Verses[30] = new Array (
//book31 Ruth
5,22,23,18,22);
Verses[31] = new Array (
//book32 Lamentations
6,22,22,66,22,22);
Verses[32] = new Array (
//book33 Ecclesientes
13,18,26,22,17,19,12,29,17,18,20,10,14);
Verses[33] = new Array (
//book34 Esther
11,22,23,15,17,14,14,10,17,32,3);
Verses[34] = new Array (
//book35 Daniel
13,21,49,33,34,30,29,28,27,27,21,45,13);
Verses[35] = new Array (
//book36 Ezra
11,11,70,13,24,17,22,28,36,15,44);
Verses[36] = new Array (
//book37 Nekhemia
14,11,20,38,17,19,19,72,18,37,40,36,47,31);
Verses[37] = new Array (
//book38 Chronicles 1
30,54,55,24,43,41,66,40,40,44,14,47,40,14,17,29,43,27,17,19,8,30,19,32,31,31,32,34,21,30);
Verses[38] = new Array (
//book39 Chronicles 2
37,18,17,17,22,14,42,22,18,31,19,23,16,23,14,19,14,19,34,11,37,20,12,21,27,28,23,9,27,36,27,21,33,25,33,27,23);

function ChapNum (Book,ShouldSel)
{
var jj=0;
var i = Book;
var ChaptersInBook;
	  ChaptersInBook = (Verses[parseInt(i)-1][0])-1;
 	  document.myForm.chapters.length =  ChaptersInBook;

	  for(i=0;i< ChaptersInBook;i++)	{
	     document.myForm.chapters.options[i].value =(i+1);
	     document.myForm.chapters.options[i].text = "Chapter "+(i+1);
 	  }
        if (ShouldSel)	{
           document.myForm.chapters.options[0].selected = true;    //select first chapter when book changes
        }
  return ChaptersInBook
}

function VerseNum (Book,Chapter,ShouldSel)
{
var jj=0;
var i = Book;
var k= Chapter;
var VersesInChapter;

	  VersesInChapter =Verses[parseInt(i)-1][k];

	  document.myForm.verses1.length =  VersesInChapter
	  document.myForm.verses2.length =  VersesInChapter
	  for(i=0;i< VersesInChapter;i++)	{
	     document.myForm.verses1.options[i].value =(i+1);
	     document.myForm.verses1.options[i].text = "Verse "+(i+1);
	     document.myForm.verses2.options[i].value =(i+1);
	     document.myForm.verses2.options[i].text = "Verse "+(i+1);

	  }
        if (ShouldSel)	{
         document.myForm.verses1.options[0].selected = true;  //select first verse when chapter changes
        document.myForm.verses2.options[0].selected = true;
       }
  return VersesInChapter
}
function checkForm()
{
// makes sure that verse1 is not greater than verse2

 var val1 = document.myForm.verses1.selectedIndex;
 var val2 = document.myForm.verses2.selectedIndex;
   if (val1>val2)	{

   alert("Please select a higher To Verse");
   
    return false;
   }

   return true;

}
// -->

