 
function sumit(plans){
	band1=125
	band2=143
	band3=167
	band4=170
	snk=40
	spol=75
	bel3=30
	bel=80
	dbl=100
	hob=42
	four=80
	five=95
	fan=100
	th=12
	tp=70
	tpf=1
	ft=230
	ftf=1
    blln=45
	demi=30
	og=50
	fltpol=0
	nch2=16
	nch3=24
	xcorn=10
	intcorn=20
	brkfr=55
	rc1=15
	rc2=30
	crv=24
	scr=25
	vat=100
	
	if (plans.granite.value=="band4"){
		gpm=band4;
	} 
	else {
		if (plans.granite.value=="band2"){
			gpm=band2;
		} 
		else {
			if (plans.granite.value=="band3"){
				gpm=band3;
			} 	
			else {
				gpm=band1;
			}
		}
	}
	
	if (plans.measure.value=="Square"){
			gm=((10*plans.granitemetres.value)/6);
	}	else {
		gm=plans.granitemetres.value;
	}
	 
	if (plans.template.value=="Yes"){
		tp = (tp + (tpf * gm));
	} else {
		tp = 0;
	}
	
	if (plans.fitting.value=="Yes"){
		ft = (ft + (ftf * gm));
	} else {
		ft = 0;
	}
	
	workcost = (snk * plans.sinkunpolished.value) + (spol * plans.sinkpolished.value) + (bel3 * plans.belfastthree.value)
	 + (bel * plans.belfast.value) + (dbl * plans.dblbelfast.value) + (hob * plans.hobcut.value) + (four * plans.fourgrooves.value) 
	 + (five * plans.fivegrooves.value) + (fan * plans.fannedgrooves.value)  + (th * plans.taphole.value) + (blln * plans.fullbullnose.value)
	 + (demi * plans.demibullnose.value) + (og * plans.ogee.value) + (fltpol * plans.flatpolish.value) + (nch2 * plans.notch2.value) + (nch3 * plans.notch3.value)
	 + (xcorn * plans.extcorner.value) + (intcorn * plans.intcorner.value) + (brkfr * plans.breakfront.value) + (rc1 * plans.radcorner300.value) + (rc2 * plans.radcorner600.value)
	 + (crv * plans.curvedcut.value) + (scr * plans.scribe.value);
	 
	if (plans.granitemetres.value > "0"){
		plans.estimate.value = parseInt((gpm * gm) + tp + ft + workcost);
	}
	
		if (plans.granitemetres.value > "0"){
		plans.vat.value = parseInt(((gpm * gm) + tp + ft + workcost)*117.5/100);
	
	} else {
		window.alert ("You must enter how much granite you require");
	}

}

