  
function addTotals() //function to return an amount to the total field dependent on user inputs
{ 

  strPeople = calculator.people.value
  strNights = calculator.nights.value
  strPetNo = calculator.pet.value
  
  
/*
//array(strCaravan,strMotorHome,strTrailer,strTent,strTwoMan,strPersonRate,strAwningRate,strCTentRate,strHookUp,	strExtraCarRate,strPetRate)
kjgh

*/  

switch(calculator.season.value){
	//LOW SEASON PRICES  
	case"low":
	strCaravan = 11.5
	strMotorHome = 11.5
	strTrailer = 11.5
	strTent = 11
	strTwoMan = 11
	strPersonRate = 1.5
	strAwningRate = 1 
	strCTentRate = 1
	strHookUp = 2
	strExtraCarRate = 2
	strPetRate = 2
break
	//MID SEASON PRICES
	case"mid":
	strCaravan = 13.5
	strMotorHome = 13.5
	strTrailer = 13.5
	strTent = 13
	strTwoMan = 13
	strPersonRate = 1.5
	strAwningRate = 2 
	strCTentRate = 2
	strHookUp = 2
	strExtraCarRate = 2
	strPetRate = 2
break	
	//HIGH SEASON PRICES 
	case"high":
 	strCaravan = 19
	strMotorHome = 19
	strTrailer = 21
	strTent = 20
	strTwoMan = 13
	strPersonRate = 2.5
	strAwningRate = 2
	strCTentRate = 2
	strHookUp = 2
	strExtraCarRate = 2
	strPetRate = 2
default:
	}
  
//set season type
switch(calculator.type.value){ 
	case"caravan":
	strType = strCaravan
	break
	case"camper":
	strType = strMotorHome
	break
	case"trailer":
	strType = strTrailer
	break
	case"tent":
	strType = strTent
	break
	case"twoman":
	strType = strTwoMan
default:
	}  
   
   //create veriable to return amount to total field
  calculator.total.value = 0
	//set the number of extra people to add, up to 2 are free
  	if (strPeople >2){strExtraPeople = strPersonRate * (strPeople - 2)} 
		else{strExtraPeople = 0}
		// calculate an amount to return to total field		
    strTotal = (strType + strExtraPeople) * strNights
		// add any extras
	if (calculator.awning.checked){strTotal = (strNights * strAwningRate) + strTotal}
	if (calculator.childsTent.checked){strTotal = (strNights * strCTentRate) + strTotal}
	if (calculator.hookUp.checked){strTotal = (strNights * strHookUp) + strTotal}
	if (calculator.extraCar.checked){strTotal = (strNights * strExtraCarRate) + strTotal}	 
	strPetTotal = (strNights * strPetRate) * strPetNo 
	strTotal = strTotal + strPetTotal
	  
	calculator.total.value = strTotal//return value
  
}//close function
