aType = document.formcalc.areaType.value;
		//alert(aType);
		dType = document.formcalc.depthType.value;
		vA = new Number(document.formcalc.vA.value);
		vB = new Number(document.formcalc.vB.value);
		vDepth = new Number(document.formcalc.vDepth.value);
		//vWeight = window.opener.myWeight;
		vWeight = document.getElementById('price_con').value;

		if (dType == "2"){
			vDepth = (vDepth * 25)  / 1000;
		}
		if (dType == "1"){
			vDepth = (vDepth * 10) / 1000;
		}
		if(aType == "1"){
			vA = vA;
			vB = vB;
		}
		if(aType == "2"){
			vA = vA * 0.3048;
			vB = vB * 0.3048;
		}
		if(aType == "3"){
			vA = vA * 0.9144;
			vB = vB * 0.9144;
		}
		intTotal = vA * vB;
		intTotal = intTotal * vDepth;
		intTotal = intTotal * vWeight // this is the tonnage
		
		
		Ltr25tot = intTotal * 40;
		Ltr50tot = intTotal * 40 / 2;
		tonnetot = intTotal;
		intTotal = (intTotal.toFixed(1));
		
		//document.formcalc.total.value = intTotal;
		document.formcalc.total_tonne.value = Math.round(tonnetot);
    if(typeof(type)=='undefined'){
      document.formcalc.total_25L.value = Math.round(Ltr25tot);
    }
    else if(type==50){
      document.formcalc.total_50L.value = Math.round(Ltr50tot);
    }
    else{
      //cond for bulk goes here
    }
Your Answer
Login
Enter email and password to comment or answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.