// functions for enabling the tab-based db selection
var curTab = 0;
var idxIncrement = 1;

var db = new Array();
db[0] = "default";
db[1] = "rodeo";
db[2] = "r_bac";

function selectTab(idx) {
	deselectTab(curTab);

	document.getElementById("tabCaption" + idx).style.backgroundColor = "#FFFFFF";
	document.getElementById("tabCaption" + idx).style.border = "solid thin #999999";
	document.getElementById("tabCaption" + idx).style.borderWidth = "1px 1px 0px 1px";

	document.getElementById("tabCaptionLink" + idx).style.display = "none";
	document.getElementById("tabCaptionNoLink" + idx).style.display = "inline";

	//document.getElementById("tabCaption" + idx).style.border-width = "1px 1px 0px 1px";

	document.getElementById("divBody" + idx).style.display = "block";

	//document.forms.main.requestid = db[idx];

	curTab = idx;
}

function deselectTab(idx) {
	document.getElementById("tabCaption" + idx).style.backgroundColor = "#EEEEEE";
	document.getElementById("tabCaption" + idx).style.borderWidth = "1px 1px 1px 1px";

	document.getElementById("tabCaptionLink" + idx).style.display = "inline";
	document.getElementById("tabCaptionNoLink" + idx).style.display = "none";

	document.getElementById("divBody" + idx).style.display = "none";
}

// hiding boxes when updating results based on parameters
function hideBox() {
	if (document.all||document.getElementById){
		if (document.forms.main.min_len.disabled == false){
			document.forms.main.min_len_bak.value = 
				document.forms.main.min_len.value;
			document.forms.main.max_gap_bak.value = 
				document.forms.main.max_gap.value;
			document.forms.main.min_len.value = "0";
			document.forms.main.max_gap.value = "0";

			document.forms.main.min_len.disabled = true;
			document.forms.main.max_gap.disabled = true;
		} else {
			document.forms.main.min_len.disabled = false;
			document.forms.main.max_gap.disabled = false;

			document.forms.main.min_len.value = 
				document.forms.main.min_len_bak.value;
			document.forms.main.max_gap.value = 
				document.forms.main.max_gap_bak.value;
		}
	}
}
