function toggleStateProvince () {
	if (document.register.country_id.value == 'US'){
		document.getElementById('provinces').style.display = "none";
		document.getElementById('states').style.display = "block";
	}
	else if (document.register.country_id.value == 'CA'){
		document.getElementById('states').style.display = "none";
		document.getElementById('provinces').style.display = "block";
	}
	else {
		document.getElementById('states').style.display = "none";
		document.getElementById('provinces').style.display = "none";
	}
}

function validateRegistration (x){
	var errormessage = new String();

	// Put field checks below this point.
		if (WithoutContent(x.member_name.value)) {
			errormessage += "\nName required for registration.";
		}
		if (!validateEmail(x.member_email.value)) {
			errormessage += "\nValid Email required for registration.";
		}
		if (WithoutContent(x.member_password.value)) {
			errormessage += "\nPassword required for registration.";
		}
		else if (x.member_password.value != x.confirm_password.value) {
			errormessage += "\nPassword Confirmation does not match.";
		}
		if (WithoutContent(x.member_phone.value)) {
			errormessage += "\nPhone Number required for registration.";
		}
		if (WithoutContent(x.member_address1.value)) {
			errormessage += "\nAddress required for registration.";
		}
		if (WithoutContent(x.member_city.value)) {
			errormessage += "\nCity required for registration.";
		}
		if (WithoutContent(x.postal_code.value)) {
			errormessage += "\nPostal Code required for registration.";
		}
		if (x.agree.checked == false){
			errormessage += "\nAcceptance of our Terms and Conditions required for registration.";
		}
	// Put field checks above this point.

	if (errormessage.length > 2) {
		alert('Attention:\n' + errormessage);
		return false;
	}
	return true;
}