function CalculatePrice() {

if (document.getElementById("price_type").innerHTML == "per delegate") {

	num_of_delegates = document.getElementById("num_of_delegates").value;

	if (document.all) {
		theprice = document.getElementById("price").innerText;
	} else {
		theprice = document.getElementById("price").innerHTML;
	}
	thecost = num_of_delegates * theprice;

	if (document.all) {
		document.getElementById("cost").innerText = "&pound;" + (thecost).toFixed(2);
		document.getElementById("vat").innerText = "&pound;" + ((thecost) * 0.175).toFixed(2);
		document.getElementById("total_cost").innerText = "&pound;" + ((thecost) + ((thecost) * 0.175)).toFixed(2);
	} else {
		document.getElementById("cost").innerHTML = "&pound;" + (thecost).toFixed(2);
		document.getElementById("vat").innerHTML = "&pound;" + ((thecost) * 0.175).toFixed(2);
		document.getElementById("total_cost").innerHTML = "&pound;" + ((thecost) + ((thecost) * 0.175)).toFixed(2);
	}

	document.getElementById("course_total_cost").value = "&pound;" + ((thecost) + ((thecost) * 0.175)).toFixed(2);

	}
}
