function OptionData(value,text){
	this.value = value;
	this.text = text;
}

// builds <option> element with the corresponding value and title
// in the specified <select> element
OptionData.prototype.buildOptionElement = function (selectElement, idAsValue){
    this.optionElement = document.createElement("option")
	this.optionElement.optionData = this
	this.setOptionValue(idAsValue)
	this.optionElement.appendChild(document.createTextNode(this.text))
	selectElement.appendChild(this.optionElement)
	return this.optionElement
}

OptionData.prototype.setOptionValue = function(idAsValue){
	this.optionElement.setAttribute("value",this.value);
}

OptionData.prototype.getDataArray = function(){
	return this.dataArray;
}

// Book Data Structure
function BookData(value,text,abbr,dataArray){
	this.base = OptionData;
	this.base(value,text);
	this.abbr = abbr;
	this.dataArray = dataArray;	
}

BookData.prototype = new OptionData();

function ChapterData(value,text,firstVerseId,verseNumber){
	this.base = OptionData;
	this.base(value,text);
	this.firstVerseId = firstVerseId;
	this.verseNumber = verseNumber;
}

ChapterData.prototype = new OptionData();

ChapterData.prototype.getDataArray = function(){
	var dataArray = new Array();
	for (var i = 0; i < this.verseNumber; i++){
		dataArray[i] = new VerseData(this.firstVerseId+i, i+1);
	}
	return dataArray;
}

function VerseData(value,text){
	this.base = OptionData;
	this.base(value,text);
}

VerseData.prototype = new OptionData();

VerseData.prototype.setOptionValue = function(idAsValue){
	this.optionElement.setAttribute("value",(idAsValue)? this.value : this.text);
}

function _c(value,text,firstVerseId,verseNumber){
	return new ChapterData(value,text,firstVerseId,verseNumber);
}

var bookData = new Array();

bookData[0] = new BookData(40, "Matthew", "Mat", new Array(
_c(930,"1",23146,25),
_c(931,"2",23171,23),
_c(932,"3",23194,17),
_c(933,"4",23211,25),
_c(934,"5",23236,48),
_c(935,"6",23284,34),
_c(936,"7",23318,29),
_c(937,"8",23347,34),
_c(938,"9",23381,38),
_c(939,"10",23419,42),
_c(940,"11",23461,30),
_c(941,"12",23491,50),
_c(942,"13",23541,58),
_c(943,"14",23599,36),
_c(944,"15",23635,39),
_c(945,"16",23674,28),
_c(946,"17",23702,27),
_c(947,"18",23729,35),
_c(948,"19",23764,30),
_c(949,"20",23794,34),
_c(950,"21",23828,46),
_c(951,"22",23874,46),
_c(952,"23",23920,39),
_c(953,"24",23959,51),
_c(954,"25",24010,46),
_c(955,"26",24056,75),
_c(956,"27",24131,66),
_c(957,"28",24197,20)
));
bookData[1] = new BookData(41, "Mark", "Mar", new Array(
_c(958,"1",24217,45),
_c(959,"2",24262,28),
_c(960,"3",24290,35),
_c(961,"4",24325,41),
_c(962,"5",24366,43),
_c(963,"6",24409,56),
_c(964,"7",24465,37),
_c(965,"8",24502,38),
_c(966,"9",24540,50),
_c(967,"10",24590,52),
_c(968,"11",24642,33),
_c(969,"12",24675,44),
_c(970,"13",24719,37),
_c(971,"14",24756,72),
_c(972,"15",24828,47),
_c(973,"16",24875,20)
));
bookData[2] = new BookData(42, "Luke", "Luk", new Array(
_c(974,"1",24895,80),
_c(975,"2",24975,52),
_c(976,"3",25027,38),
_c(977,"4",25065,44),
_c(978,"5",25109,39),
_c(979,"6",25148,49),
_c(980,"7",25197,50),
_c(981,"8",25247,56),
_c(982,"9",25303,62),
_c(983,"10",25365,42),
_c(984,"11",25407,54),
_c(985,"12",25461,59),
_c(986,"13",25520,35),
_c(987,"14",25555,35),
_c(988,"15",25590,32),
_c(989,"16",25622,31),
_c(990,"17",25653,37),
_c(991,"18",25690,43),
_c(992,"19",25733,48),
_c(993,"20",25781,47),
_c(994,"21",25828,38),
_c(995,"22",25866,71),
_c(996,"23",25937,56),
_c(997,"24",25993,53)
));
bookData[3] = new BookData(43, "John", "Joh", new Array(
_c(998,"1",26046,52),
_c(999,"2",26098,25),
_c(1000,"3",26123,36),
_c(1001,"4",26159,54),
_c(1002,"5",26213,47),
_c(1003,"6",26260,71),
_c(1004,"7",26331,53),
_c(1005,"8",26384,59),
_c(1006,"9",26443,41),
_c(1007,"10",26484,42),
_c(1008,"11",26526,57),
_c(1009,"12",26583,50),
_c(1010,"13",26633,38),
_c(1011,"14",26671,31),
_c(1012,"15",26702,27),
_c(1013,"16",26729,33),
_c(1014,"17",26762,26),
_c(1015,"18",26788,40),
_c(1016,"19",26828,42),
_c(1017,"20",26870,31),
_c(1018,"21",26901,25)
));
bookData[4] = new BookData(44, "Acts", "Act", new Array(
_c(1019,"1",26926,26),
_c(1020,"2",26952,47),
_c(1021,"3",26999,26),
_c(1022,"4",27025,37),
_c(1023,"5",27062,42),
_c(1024,"6",27104,15),
_c(1025,"7",27119,60),
_c(1026,"8",27179,40),
_c(1027,"9",27219,43),
_c(1028,"10",27262,48),
_c(1029,"11",27310,30),
_c(1030,"12",27340,25),
_c(1031,"13",27365,52),
_c(1032,"14",27417,28),
_c(1033,"15",27445,41),
_c(1034,"16",27486,40),
_c(1035,"17",27526,34),
_c(1036,"18",27560,28),
_c(1037,"19",27588,41),
_c(1038,"20",27629,38),
_c(1039,"21",27667,40),
_c(1040,"22",27707,30),
_c(1041,"23",27737,35),
_c(1042,"24",27772,27),
_c(1043,"25",27799,27),
_c(1044,"26",27826,32),
_c(1045,"27",27858,44),
_c(1046,"28",27902,31)
));
bookData[5] = new BookData(45, "Romans", "Rom", new Array(
_c(1047,"1",27933,32),
_c(1048,"2",27965,29),
_c(1049,"3",27994,31),
_c(1050,"4",28025,25),
_c(1051,"5",28050,21),
_c(1052,"6",28071,23),
_c(1053,"7",28094,25),
_c(1054,"8",28119,39),
_c(1055,"9",28158,33),
_c(1056,"10",28191,21),
_c(1057,"11",28212,36),
_c(1058,"12",28248,21),
_c(1059,"13",28269,14),
_c(1060,"14",28283,23),
_c(1061,"15",28306,33),
_c(1062,"16",28339,27)
));
bookData[6] = new BookData(46, "1 Corinthians", "1Co", new Array(
_c(1063,"1",28366,31),
_c(1064,"2",28397,16),
_c(1065,"3",28413,23),
_c(1066,"4",28436,21),
_c(1067,"5",28457,13),
_c(1068,"6",28470,20),
_c(1069,"7",28490,40),
_c(1070,"8",28530,13),
_c(1071,"9",28543,27),
_c(1072,"10",28570,33),
_c(1073,"11",28603,34),
_c(1074,"12",28637,31),
_c(1075,"13",28668,13),
_c(1076,"14",28681,40),
_c(1077,"15",28721,58),
_c(1078,"16",28779,24)
));
bookData[7] = new BookData(47, "2 Corinthians", "2Co", new Array(
_c(1079,"1",28803,24),
_c(1080,"2",28827,17),
_c(1081,"3",28844,18),
_c(1082,"4",28862,18),
_c(1083,"5",28880,21),
_c(1084,"6",28901,18),
_c(1085,"7",28919,16),
_c(1086,"8",28935,24),
_c(1087,"9",28959,15),
_c(1088,"10",28974,18),
_c(1089,"11",28992,33),
_c(1090,"12",29025,21),
_c(1091,"13",29046,14)
));
bookData[8] = new BookData(48, "Galatians", "Gal", new Array(
_c(1092,"1",29060,24),
_c(1093,"2",29084,21),
_c(1094,"3",29105,29),
_c(1095,"4",29134,31),
_c(1096,"5",29165,26),
_c(1097,"6",29191,18)
));
bookData[9] = new BookData(49, "Ephesians", "Eph", new Array(
_c(1098,"1",29209,23),
_c(1099,"2",29232,22),
_c(1100,"3",29254,21),
_c(1101,"4",29275,32),
_c(1102,"5",29307,33),
_c(1103,"6",29340,24)
));
bookData[10] = new BookData(50, "Philippians", "Php", new Array(
_c(1104,"1",29364,30),
_c(1105,"2",29394,30),
_c(1106,"3",29424,21),
_c(1107,"4",29445,23)
));
bookData[11] = new BookData(51, "Colossians", "Col", new Array(
_c(1108,"1",29468,29),
_c(1109,"2",29497,23),
_c(1110,"3",29520,25),
_c(1111,"4",29545,18)
));
bookData[12] = new BookData(52, "1 Thessalonians", "1Th", new Array(
_c(1112,"1",29563,10),
_c(1113,"2",29573,20),
_c(1114,"3",29593,13),
_c(1115,"4",29606,18),
_c(1116,"5",29624,28)
));
bookData[13] = new BookData(53, "2 Thessalonians", "2Th", new Array(
_c(1117,"1",29652,12),
_c(1118,"2",29664,17),
_c(1119,"3",29681,18)
));
bookData[14] = new BookData(54, "1 Timothy", "1Ti", new Array(
_c(1120,"1",29699,20),
_c(1121,"2",29719,15),
_c(1122,"3",29734,16),
_c(1123,"4",29750,16),
_c(1124,"5",29766,25),
_c(1125,"6",29791,21)
));
bookData[15] = new BookData(55, "2 Timothy", "2Ti", new Array(
_c(1126,"1",29812,18),
_c(1127,"2",29830,26),
_c(1128,"3",29856,17),
_c(1129,"4",29873,22)
));
bookData[16] = new BookData(56, "Titus", "Tit", new Array(
_c(1130,"1",29895,16),
_c(1131,"2",29911,15),
_c(1132,"3",29926,15)
));
bookData[17] = new BookData(57, "Philemon", "Phm", new Array(
_c(1133,"1",29941,25)
));
bookData[18] = new BookData(58, "Hebrews", "Heb", new Array(
_c(1134,"1",29966,14),
_c(1135,"2",29980,18),
_c(1136,"3",29998,19),
_c(1137,"4",30017,16),
_c(1138,"5",30033,14),
_c(1139,"6",30047,20),
_c(1140,"7",30067,28),
_c(1141,"8",30095,13),
_c(1142,"9",30108,28),
_c(1143,"10",30136,39),
_c(1144,"11",30175,40),
_c(1145,"12",30215,29),
_c(1146,"13",30244,25)
));
bookData[19] = new BookData(59, "James", "Jas", new Array(
_c(1147,"1",30269,27),
_c(1148,"2",30296,26),
_c(1149,"3",30322,18),
_c(1150,"4",30340,17),
_c(1151,"5",30357,20)
));
bookData[20] = new BookData(60, "1 Peter", "1Pe", new Array(
_c(1152,"1",30377,25),
_c(1153,"2",30402,25),
_c(1154,"3",30427,22),
_c(1155,"4",30449,19),
_c(1156,"5",30468,14)
));
bookData[21] = new BookData(61, "2 Peter", "2Pe", new Array(
_c(1157,"1",30482,21),
_c(1158,"2",30503,22),
_c(1159,"3",30525,18)
));
bookData[22] = new BookData(62, "1 John", "1Jo", new Array(
_c(1160,"1",30543,10),
_c(1161,"2",30553,29),
_c(1162,"3",30582,24),
_c(1163,"4",30606,21),
_c(1164,"5",30627,21)
));
bookData[23] = new BookData(63, "2 John", "2Jo", new Array(
_c(1165,"1",30648,13)
));
bookData[24] = new BookData(64, "3 John", "3Jo", new Array(
_c(1166,"1",30661,15)
));
bookData[25] = new BookData(65, "Jude", "Jud", new Array(
_c(1167,"1",30676,25)
));
bookData[26] = new BookData(66, "Revelation", "Rev", new Array(
_c(1168,"1",30701,20),
_c(1169,"2",30721,29),
_c(1170,"3",30750,22),
_c(1171,"4",30772,11),
_c(1172,"5",30783,14),
_c(1173,"6",30797,17),
_c(1174,"7",30814,17),
_c(1175,"8",30831,13),
_c(1176,"9",30844,21),
_c(1177,"10",30865,11),
_c(1178,"11",30876,19),
_c(1179,"12",30895,18),
_c(1180,"13",30913,18),
_c(1181,"14",30931,20),
_c(1182,"15",30951,8),
_c(1183,"16",30959,21),
_c(1184,"17",30980,18),
_c(1185,"18",30998,24),
_c(1186,"19",31022,21),
_c(1187,"20",31043,15),
_c(1188,"21",31058,27),
_c(1189,"22",31085,21)
));
 