



function calcCamp() {

var aDate   = document.campRes.arrivalDate.options[document.campRes.arrivalDate.selectedIndex].value
var nights  = document.campRes.nightsStay.options[document.campRes.nightsStay.selectedIndex].value

 
var site    = '';
var Total   = 0;

  if (   document.campRes.res1212.checked) {
         document.campRes.tot1212.value = currency(nights * 30); 
	 site = 'y';
	 Total = (Total + (nights * 30)) }
  else { document.campRes.tot1212.value = '' }

  if (   document.campRes.res1212T.checked) {
         document.campRes.tot1212T.value = currency(nights * 60); 
	 site = 'y';
	 Total = (Total + (nights * 60)) }
  else { document.campRes.tot1212T.value = '' }




  if (   document.campRes.res1221.checked) {
         document.campRes.tot1221.value = currency(nights * 40); 
	 site = 'y';
	 Total = (Total + (nights * 40)) }
  else { document.campRes.tot1221.value = '' }


  if (   document.campRes.res1820.checked) {
         document.campRes.tot1820.value = currency(nights * 50); 
	 site = 'y';
	 Total = (Total + (nights * 50)) }
  else { document.campRes.tot1820.value = '' }


  if (   document.campRes.res1628.checked) {
         document.campRes.tot1628.value = currency(nights * 60); 
	 site = 'y';
	 Total = (Total + (nights * 60)) }
  else { document.campRes.tot1628.value = '' }



	document.campRes.total.value   = currency(Total)
	document.campRes.deposit.value = currency(Total / 2)

	if (document.campRes.res1212T.checked) {
		var depTent = (Total / 2) + 60
		deTent = currency(depTent)

		document.campRes.deposit.value = deTent
	}

  if ( (aDate != 'Select' ) && (nights != 'Select') && (site == 'y')  )
   
			{ document.campRes.donext[0].disabled = false
			  document.campRes.donext[1].disabled = false }	

  else			{ document.campRes.donext[0].disabled = true
			  document.campRes.donext[1].disabled = true  }


}


function currency(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);
}




