<!--
var submitted = false;

function submitCheck(){

  if (submitted) {
    alert("You have already submitted this payment. Please wait....");
    return false;
  }
  else {
    submitted = true;
    return true;
  }
}

function ValidateForm()
{
	form = document.forms[0]

	var val = form.card_type.options[form.card_type.selectedIndex].value;
	if ((val == '') || (val == null)) { 
		alert("Please enter your Card Type.");
		form.card_type.focus();
		return false;
	}

	val = form.card_month.options[form.card_month.selectedIndex].value;
	if ((val == '') || (val == null)) { 
		alert("Please enter the Month of the Expiration Date of your Card.");
		form.card_month.focus();
		return false;
	}

	val = form.card_year.options[form.card_year.selectedIndex].value;
	if ((val == '') || (val == null)) { 
		alert("Please enter the Year of the Expiration Date of your Card.");
		form.card_year.focus();
		return false;
	}

	if (form.card_number.value.length == 0) {
		alert("Please enter your Card Number.");
		form.card_number.focus();
		return false;
	}
	if (form.card_fname.value.length == 0) {
		alert("Please enter the First Name as it appears on your Card.");
		form.card_fname.focus();
		return false;
	}
	if (form.card_lname.value.length == 0) {
		alert("Please enter the Last Name as it appears on your Card.");
		form.card_lname.focus();
		return false;
	}
	if (form.card_address.value.length == 0) {
		alert("Please enter the Address of your Card.");
		form.card_address.focus();
		return false;
	}
	if (form.card_city.value.length == 0) {
		alert("Please enter the City of your Card.");
		form.card_city.focus();
		return false;
	}

	var country = form.card_country.options[form.card_country.selectedIndex].value;
	if ((country == '') || (country == null)) { 
		alert("Please select the Country (as registered with your Credit Card).");
		form.card_country.focus();
		return false;
	}

	if (country == 'US' || country == 'CA') // country is US or Canada, must provide state
	{
		val = form.card_state.options[form.card_state.selectedIndex].value;
		if ((val == '') || (val == null)) { 
			alert("Please select the State (as registered with your Credit Card).");
			form.card_state.focus();
			return false;
		}
		if (form.card_zip.value.length == 0) {
			alert("Please enter the ZIP/Postal code of your Card.");
			form.card_zip.focus();
			return false;
		}
	}

	if (form.card_phone.value.length == 0) {
		alert("Please enter the Phone of your Card.");
		form.card_phone.focus();
		return false;
	}

	return true;
}

function perform_check(form)
{
	// check to see that fields are valid
	if (ValidateForm())
	{
		// now check to see that they haven't submitted request before
		if (submitCheck())
		{
			 return true;
		}
	}
	return false;
}

// -->
