	function calculate()
	{
		function formatCurrency(num)
		{
		  num = num.toString().replace(/\$|\,/g,'');
		  if(isNaN(num))
		     num = "0";
		  sign = (num == (num = Math.abs(num)));
		  num = Math.floor(num*100+0.50000000001);
		  cents = num%100;
		  num = Math.floor(num/100).toString();
		  if(cents<10)
		      cents = "0" + cents;
		  for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		      num = num.substring(0,num.length-(4*i+3)) + ',' + num.substring(num.length-(4*i+3));
		  return (((sign)?'':'-') + '$' + num + '.' + cents);
		}
		if(document.registration.Lapping[0].checked)
			{
				lappingcost = 0
			}
		if(document.registration.Lapping[1].checked)
			{
				lappingcost = 125
			}
		if(document.registration.Lapping[2].checked)
			{
				lappingcost = 125
			}
		if(document.registration.Lapping[3].checked)
			{
				lappingcost = 125
			}
		if(document.registration.Drifting[0].checked)
			{
				driftingcost = 0
			}
		if(document.registration.Drifting[1].checked)
			{
				driftingcost = 50
			}
		if(document.registration.Rally[0].checked)
			{
				rallycost = 0
			}
		if(document.registration.Rally[1].checked)
			{
				rallycost = 50
			}
		if(document.registration.CarShow[0].checked)
			{
				showcost = 15
			}
		if(document.registration.CarShow[1].checked)
			{
				showcost = 0
			}
		racingcost = lappingcost + driftingcost + rallycost
		if(racingcost > 0)
			{
				racingcost = racingcost + 25
			}
		SM = document.registration.SM.value
		MD = document.registration.MD.value
		LG = document.registration.LG.value
		XL = document.registration.XL.value
		X2 = document.registration.X2.value
		X3 = document.registration.X3.value
		X4 = document.registration.X4.value
		Raffle = document.registration.Raffle.value
		Picnic = document.registration.Picnic.value
			
		shirtcost = (15 * SM) + (15 * MD) + (15 * LG) + (15 * XL) + (16 * X2) + (17 * X3) + (18 * X4)
		rcost0 = Raffle/50
		rcost1 = (Math.floor(rcost0)*100)+Math.floor((Raffle-(Math.floor(rcost0)*50))/20)*50
		rcost2 = ((Raffle-(Math.floor(rcost0)*50))-Math.floor((Raffle-(Math.floor(rcost0)*50))/20)*20)*3
		rafflecost = rcost1 + rcost2
		picniccost = 15 * Picnic
		
		total = racingcost + shirtcost + rafflecost + showcost + picniccost
		
		document.registration.totalcost.value = formatCurrency(total)
	}
	function makeChoice()
	{
		var val = 0;
		for( i = 0; i < document.registration.Car.length; i++ )
		{
			if( document.registration.Car[i].checked == true )
				{
					val = document.registration.Car[i].value;
					if(val=='My Car')
						{
							document.registration.Year.disabled=false;
							document.registration.Year.focus();
						}
					else
						{
							document.registration.Year.disabled=true;
						}
				}
		}
	}
		function makeChoice2()
	{
		var val = 0;
		for( i = 0; i < document.registration.Car.length; i++ )
		{
			if( document.registration.Car[i].checked == true )
				{
					val = document.registration.Car[i].value;
					if(val=='My Car')
						{
							document.registration.Model.disabled=false;
							document.registration.Model.focus();
						}
					else
						{
							document.registration.Model.disabled=true;
						}
				}
		}
	}