/* 	==============================================================
	Selects the option from the given list box whose value matches
		- listbox: list box object
		- value: value to select
	==============================================================
*/
function selectFromListbox(listbox, value) {
	for (var i = 0; i < listbox.options.length; i++)
	{
		if (listbox.options[i].value == value)
		{
			listbox.options[i].selected = true;
			break;
		}
	}
}

/* 	================================================
	Shows or hides the CC details section.
	- showCC: true to show CC section, false to hide
	================================================
*/
function showCreditCardDetails(showCC)
{
	var s = "";
	if(!showCC) s = "none";
	document.getElementById("cc_details_table").style.display = s;
}

/* 	================================================
	Disables form buttons.
	================================================
*/
function submitForm()
{
	document.getElementById("button_process").disabled = true;
	document.getElementById("button_discard").disabled = true;
	document.getElementById("text_processing").style.display = "";
	document.forms[0].submit();
}