// JavaScript Document

var ZipFilesOT = 0;
function OTAudioClick(a_index, Books) {		// check box name, the book
	if (document.getElementById("OT_audio_"+a_index).checked) {
		ZipFilesOT += Books;
	}
	else {
		ZipFilesOT -= Books;
	}
	ZipFilesOT = Math.round(ZipFilesOT*100)/100;		// rounded just does integers!
	if (ZipFilesOT <= 0.049) {
		document.getElementById("OT_Download_MB").style.display = 'none';
	}
	else {
		document.getElementById("OT_Download_MB").style.display = 'block';
		document.getElementById("OT_Download_MB").innerHTML = "~"+ZipFilesOT + " MB&nbsp;";
	}
}

var ZipFilesNT = 0;
function NTAudioClick(a_index, Books) {		// check box name, the book
	if (document.getElementById("NT_audio_"+a_index).checked) {
		ZipFilesNT += Books;
	}
	else {
		ZipFilesNT -= Books;
	}
	ZipFilesNT = Math.round(ZipFilesNT*100)/100;		// rounded just does integers!
	if (ZipFilesNT <= 0.049) {
		document.getElementById("NT_Download_MB").style.display = 'none';
	}
	else {
		document.getElementById("NT_Download_MB").style.display = 'block';
		document.getElementById("NT_Download_MB").innerHTML = "~"+ZipFilesNT + " MB&nbsp;";
	}
}

function send(sel) {
	//var sel_option = sel.options[sel.selectedIndex].value;
	switch (sel.options[sel.selectedIndex].value) {
		case "Eng":
			location.href="00i-Scripture_Index.php";
			break;
		case "Spa":
			location.href="00e-Escrituras_Indice.php";
			break;
		case "Por":
			location.href="00p-Escrituras_Indice.php";
			break;
		case "Fra":
			location.href="00f-Ecritures_Indice.php";
			break;
		case "Dut":
			location.href="00d-Bijbel_Indice.php";
			break;
		default:
			alert ("This isn't suppossed to happen (switch code)");
	}
}

var FCBHVisible = 0;
function FCBHClick() {
	var divHeight = 0;
	if (FCBHVisible == 0) {
		document.getElementById("FCBHb").style.display = "block";
		FCBHVisible = 1;
		divHeight += 122;
	}
	else {
		document.getElementById("FCBHb").style.display = "none";
		FCBHVisible = 0;
		divHeight -= 126;
	}
	$(document).ready(function() {
		divHeight += document.getElementById("container").offsetHeight;
		document.getElementById("container").style.height = divHeight + "px";
		// if the table is long enough IE goes to dark black (blur and opacity). I don't know why.
		$("#container").redrawShadow({left: 5, top: 5, blur: 2, opacity: 0.5, color: "black", swap: false});
	});
}

var OTTableVisible = 0;
function OTTableClick() {
	var divHeight = 0;
	if (OTTableVisible == 0) {
		document.getElementById("OTTable").style.display = "block";
		OTTableVisible = 1;
		divHeight += 122;
	}
	else {
		document.getElementById("OTTable").style.display = "none";
		OTTableVisible = 0;
		divHeight -= 126;
	}
	$(document).ready(function() {
		divHeight += document.getElementById("container").offsetHeight;
		document.getElementById("container").style.height = divHeight + "px";
		// if the table is long enough IE goes to dark black (blur and opacity). I don't know why.
		$("#container").redrawShadow({left: 5, top: 5, blur: 2, opacity: 0.5, color: "black", swap: false});
	});
}

var NTTableVisible = 0;
function NTTableClick() {
	var divHeight = 0;
	if (NTTableVisible == 0) {
		document.getElementById("NTTable").style.display = "block";
		NTTableVisible = 1;
		divHeight += 122;
	}
	else {
		document.getElementById("NTTable").style.display = "none";
		NTTableVisible = 0;
		divHeight -= 126;
	}
	$(document).ready(function() {
		divHeight += document.getElementById("container").offsetHeight;
		document.getElementById("container").style.height = divHeight + "px";
		// if the table is long enough IE goes to dark black (blur and opacity). I don't know why.
		$("#container").redrawShadow({left: 5, top: 5, blur: 2, opacity: 0.5, color: "black", swap: false});
	});
}

