<!--

		function toCurrency(num)
		{
			var conv = ((Math.round(num * 100) / 100).toString() + '.00').split(".");
			return (conv[0] + "." + conv[1] + (conv[1].length < 2 ? "0" : "" ));
		}

		function calculateGiftaid(donation)
		{
			if (isNaN(donation)) {
				 document.giftform.result.value = "Numbers Only";
				} else {  
					// work out the gift aid value and round the number
					var aid  = Number((donation * 22 / 78)) + Number(donation);
		
					// now print the value in the form field
					document.giftform.result.value = toCurrency(aid);
				}
		}
		
		function calculatePayroll(donation, taxband)
		{
			if (isNaN(donation)) {
				 document.payrollform.contrib.value = "Numbers Only";
				} else {
				// work out the payroll amounts and then round the numbers
				var donationCost  = donation - (donation * (taxband / 100));
				var totalDonation = donation * 1;
			
				// now print the value in the form field
				document.payrollform.contrib.value = toCurrency(donationCost);
				//document.payrollform.total.value = toCurrency(totalDonation);
				}
		}
		
		
		function calculatePayroll2(donation, taxband)
		{
			if (isNaN(donation)) {
				 document.payrollform2.contrib.value = "Numbers Only";
				} else {
				// work out the payroll amounts and then round the numbers
				var donationCost  = donation - (donation * (taxband / 100));
				var totalDonation = donation * 1;
			
				// now print the value in the form field
				document.payrollform2.contrib.value = toCurrency(donationCost);
				//document.payrollform.total.value = toCurrency(totalDonation);
				}
		}
		
	//-->

