// JavaScript Document
// Change these values for different prices, leave the ; on the end! //
// off--- refers to off peak prices. //

offPitch1 = 14.00; 
Pitch1 =    20.00;
offPitch2 = 13.00;
Pitch2 =    19.00;
offPitch3 =  10.00;
Pitch3  =   16.00;
offAdult =   2.00;
Adult =      3.00;
offChild =   1.50;
Child =      2.00;
offHiker =   4.50;
Hiker =      5.50;
offCar =     0.00;
Car=         3.00; //Past here all values are Off peak and peak //
Dog=         1.00;
Pup=         2.00;
thisYear=    2010; // Change this to the next season year //

// Don't change anything past here //

function NumberCalc()
{

PitchNo1=document.myForm.Text1.value;
PitchNo2=document.myForm.Text2.value;
PitchNo3=document.myForm.Text3.value;
ExtraAdult=document.myForm.Text4.value;
ExtraChild=document.myForm.Text5.value;
ExtraHiker=document.myForm.Text6.value;
ExtraCar=document.myForm.Text7.value;
ExtraDog=document.myForm.Text8.value;
ExtraPup=document.myForm.Text9.value;

offTotal=(offPitch1*PitchNo1)+(offPitch2*PitchNo2)+(offPitch3*PitchNo3)+(ExtraAdult*offAdult)+(ExtraChild*offChild)+(ExtraHiker*offHiker)+(offCar*ExtraCar)+(Dog*ExtraDog)+(Pup*ExtraPup);
temp=offTotal;
temp=parseFloat(temp);
temp=Math.floor(100*temp)/100;
temp=String(temp);
if (temp.indexOf(".") == -1) {
temp=temp+".00";
}
if (temp.indexOf(".") == temp.length -2) {
temp=temp + "0";
}
document.myForm.Text10.value= " £ " + temp;


Total=(Pitch1*PitchNo1)+(Pitch2*PitchNo2)+(Pitch3*PitchNo3)+(ExtraAdult*Adult)+(ExtraChild*Child)+(ExtraHiker*Hiker)+(Car*ExtraCar)+(Dog*ExtraDog)+(Pup*ExtraPup);
temp=Total;
temp=parseFloat(temp);
temp=Math.floor(100*temp)/100;
temp=String(temp);
if (temp.indexOf(".") == -1) {
temp=temp+".00";
}
if (temp.indexOf(".") == temp.length -2) {
temp=temp + "0";
}
document.myForm.Text11.value= " £ " + temp;

}
function callValue(q){
if (q==1) { temp2=offPitch1;}
if (q==2) { temp2=Pitch1;}
if (q==3) { temp2=offPitch2;}
if (q==4) { temp2=Pitch2;}
if (q==5) { temp2=offPitch3;}
if (q==6) { temp2=Pitch3;}
if (q==7) { temp2=offAdult;}
if (q==8) { temp2=Adult;}
if (q==9) { temp2=offChild;}
if (q==10) { temp2=Child;}
if (q==11) { temp2=offHiker;}
if (q==12) { temp2=Hiker;}
if (q==13) { temp2=Car;}
if (q==14) { temp2=Dog;}
if (q==15) { temp2=Pup;}
if (q==16) { temp2=offCar;}
temp2=parseFloat(temp2);
temp2=Math.floor(100*temp2)/100;
temp2=String(temp2);
if (temp2.indexOf(".") == -1) {
temp2=temp2+".00";
}
if (temp2.indexOf(".") == temp2.length -2) {
temp2=temp2 + "0";
}


document.write("&pound;" + temp2);

}
