
function check_payment_method(){
	radioObj = document.forms['place_order_form'].elements['payment_method'];
	myPaymentMethod=getCheckedValue(radioObj);
	if (!myPaymentMethod){
		alert("Please select a payment method");
		return;
	} else {
		document.forms['place_order_form'].submit();
	}
}

function checkNotesDiv(checkedVal){
	if (checkedVal){
		document.getElementById('ordernotes').style.display='block';
	} else {
		document.getElementById('ordernotes').style.display='none';
	}
}

function checkUserDetails(){
	returnValue=true;
	shoppingCartUserDetailsRequired=new Array("name","email","company","production","terms_and_conditions");
	alertListText = "Name\nEmail\nCompany\nProduction\nAgree to Terms And Conditions\n";

	for (i=0;i<shoppingCartUserDetailsRequired.length;i++){
		fieldName= "new_" + shoppingCartUserDetailsRequired[i];
		if (!document.forms['place_order_form'].elements[fieldName].value){
			returnValue=false;
		}
	}

	if (!returnValue){
		returnMessage="Please note: in order to continue you must fill in all of the following fields:\n\n";
		returnMessage += alertListText; 
		returnMessage += "\nPlease amend these details before saving your details.";
		alert(returnMessage);
	}

	//return returnValue;
	// we dont return this time, just do the form submit
	if (returnValue){
		document.forms['place_order_form'].submit()
	}
}


