	var intTotal

	function calculate(){
	
		strType = document.frmCalc.areaType.value;
		strDepthType = document.frmCalc.depthType.value;
		Width = new Number(document.frmCalc.Width.value);
		Length = new Number(document.frmCalc.Length.value);
		intDepth = new Number(document.frmCalc.intDepth.value);
		
		
		if(strType == "feet"){
			Width = Width * 0.3048;
			Length = Length * 0.3048;
		}
		if(strType == "yards"){
			Width = Width * 0.9144;
			Length = Length * 0.9144;
		}
		
		if (strDepthType == "inches"){
			intDepth = (intDepth * 25)  / 1000;
		}
		if (strDepthType == "cm"){
			intDepth = (intDepth * 10) / 1000;
		}
		
		intTotal = Width * Length;
		intTotal = intTotal * intDepth;
		intTotal1 = intTotal;
		intTotal = intTotal * 1.2;
				
		intTotal = intTotal.toString();
		if(intTotal.indexOf('.') != -1){
			intTotal = new Number(intTotal);
			intTotal = intTotal + 0.5;
			intTotal = Math.round(intTotal);
		}
		
		document.frmCalc.total.value = intTotal;
		document.frmCalc.total1.value = intTotal1;
	}
	
	function addArea(){
		if(intTotal != ''){
			window.opener.formField.value = intTotal;
			window.close();
		}
	}
