
function handleBioDiversityFormEdit(updateSavedFlag) {
	calcBioScore();

	Forms.setTabState('tabBioDiversity', 'Bio Diversity', updateSavedFlag, parseFloat($('bioTotal').value) >= 0);
}

function calcBioScore() {
	var total = 0;
	for (i = 1; i <= 50; i++) {
		var id = "q" + i;
		if ($(id) != null) {
			var value = 0/0;
			if (parseInt($(id).value) >= 0) {
				value = parseInt($(id).value);
				$(id+"Perc").update ((value * 100.0) + "%");
				$(id+"Score").update (value);
			} else {
				$(id+"Perc").update ("");
				$(id+"Score").update ("");
			}
			total += value;
		}
	}
	var fTotal = formatNumber(total, 2);
	$('bioTotal').value = fTotal;
	$('bioTotalP').update(fTotal);
}