function t_and_c() {
	var ni  = document.getElementById("p_submit_next");
	var tc  = document.getElementById("p_t_and_c");
	
	if(tc && tc.checked) {
		// now that the t&c's have been agreed to, hide them
		// t_and_c_disp();
		return true;
	} else {
		alert("Please ensure you have read the terms & conditions.");
		return false;
	}
}
function t_and_c_disp() {
	var tcd = document.getElementById("t_and_c");
	if(tcd && tcd.style) {
		// alert(tcd.style.display);
		if(tcd.style.display == "none") {
			Effect.BlindDown("t_and_c", {duration: 1});
			// tcd.style.display = "block";
		} else {
			Effect.BlindUp("t_and_c", {duration: 1});
			// tcd.style.display = "none";
		}
	}
}
function t_and_c_ndisp() {
	var tcd = document.getElementById("t_and_c");
	if(tcd && tcd.style) {
		tcd.style.display = "none";
	}
}
function toggle_details_area(area,state) {
	var area_id = document.getElementById(area);
	if(area_id) {
		if(state === true) {
			area_id.style.display = "block";
		} else if(state === false) {
			area_id.style.display = "none";
		} else {
			if(area_id.style.display == "none") {
				area_id.style.display = "block";
			} else {
				area_id.style.display = "none";
			}
		}
	}
}
function hide_area(area) {
	var area_id = document.getElementById(area);
	
	if(area_id) {
		area_id.style.display = "none";
	}
}
function cart_payment_select(type) {
	if(type && type.length > 0) {
		// console.log("p_payment_method_"+type);
		var payment_method_option_element = document.getElementById("p_payment_method_"+type);
		if(payment_method_option_element) {
			payment_method_option_element.checked = true;
		}
	}
	return false;
}