


/*	*********************************************************
	*********************************************************
	**************	Checkout Code			*********
	*********************************************************
	********************************************************/
	function sameShipping($flag) {
		if ($flag) {
			with (document.checkoutform) {
				ship_firstname.value = bill_firstname.value;
				ship_lastname.value = bill_lastname.value;
				ship_street1.value = bill_street1.value;
				ship_street2.value = bill_street2.value;
				ship_city.value = bill_city.value;
				ship_state.value = bill_state.value;
				ship_zip.value = bill_zip.value;
				ship_country.value = bill_country.value;
			}
		} else {
			with (document.checkoutform) {
				ship_firstname.value = '';
				ship_lastname.value = '';
				ship_street1.value = '';
				ship_street2.value = '';
				ship_city.value = '';
				ship_state.value = '';
				ship_zip.value = '';
				ship_country.value = '';
			}
		}
	}
	function validate_required(field,alerttxt) {
		with (field) {
			if (value==null||value=="") {
				alert(alerttxt);
				return false
			} else {
				return true
			}
		}
	}
	function selection_required(field,alerttxt) {
		with (field) {
			if (selectedIndex<=-1) {
				alert(alerttxt);
				return false
			} else {
				return true
			}
		}
	}
	function validate_form() {
		validatefields = new Array( 'bill_firstname', 'bill_lastname', 'bill_street1', 'bill_city', 'bill_state', 'bill_zip', 'bill_country', 'bill_email',  'ship_street1', 'ship_city', 'ship_state', 'ship_zip', 'ship_country', 'ccnum');
		validatefieldnames = new Array( 'Billing First Name', 'Billing Last Name', 'Billing Street 1', 'Billing City/Town/Village', 'Billing State/Province', 'Billing Zip/Postal Code', 'Billing Country', 'Billing Email', 'Shipping Street 1', 'Shipping City/Town/Village', 'Shipping State/Province', 'Shipping Zip/Postal Code', 'Shipping Country', 'Credit Card Number' );
		with (document.checkoutform) {
			for (i in validatefields) {
				if (validate_required(elements[validatefields[i]], validatefieldnames[i] + ' is a required field.')==false) {
					elements[validatefields[i]].focus();
					return false;
				}
			}
		}
	}