// Prevents double-clicking submit button ...
function checkAccept() {
	// Value of index 1 is 'Y' ... payment terms accepted ...
	if (document.payform.paymentterms.selectedIndex == 1) {
		document.payform.submit.disable = true;
		return true;
	} else {
		// Do not process payment unless terms are selected ...
		alert("You must accept payment terms")
		return false;
	}
}

// Displays text windows for payment terms and verification code ...
function showWindow(name, width, height) {
var screenx = (screen.availWidth - width)/2;
var screeny = (screen.availHeight - height)/2;
var url = name;
var features = "menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no";

features += ",left=" + screenx + ",top=" + screeny;
features += ",width=" + width;
features += ",height=" + height;

var winInfo = window.open(url,"",features);
winInfo.focus();
}

function clearall() {
document.payform.stmtdate.value = '';
document.payform.stmtacctnum.value = '';
document.payform.stmtamtdue.value = '';
document.payform.stmtname.value = '';
document.payform.email.value = '';
document.payform.chargetotal.value = '';
document.payform.name.value = '';
document.payform.cardnumber.value = '';
document.payform.cvmvalue.value = '';
document.payform.phone.value = '';
document.payform.address1.value = '';
document.payform.city.value = '';
document.payform.zip.value = '';

document.payform.paymentterms.selectedIndex = 0;
document.payform.cctype.selectedIndex = 0;
document.payform.cardexpmonth.selectedIndex = 0;
document.payform.cardexpyear.selectedIndex = 0;
document.payform.state.selectedIndex = 0;
return true;
}