function compute(form) {
	window.status="Starting calculations"
	if (form.copyright.value=="(c) V. Reijs, 2000")
	{}
	else
	{alert("(C) Copyright JavaScript V. Reijs, 2000")}
//parse form field values and check them on boundary values. 
	temp=parseFloat(form.temp.value)
	pressure=parseFloat(form.pressure.value)
	RH=parseFloat(form.RH.value)
	freq=parseFloat(form.freq.value)
	radius=parseFloat(form.radius.value)
	efflength=parseFloat(form.efflength.value)
	volume=parseFloat(form.volume.value)
	flanged=form.flanged.checked
	T0=273.15
	density=pressure*100/(temp+T0)/287.05
	speed=Math.sqrt(1.402*pressure*100/density)
	viscosity=0.000001458*Math.pow(temp+T0,1.5)/(temp+T0+110.4)
//air 20 degrees (Kinsler, page 528)
              gamma=1.402
              Pr=0.710
              gammaprandtl=1+(gamma-1)/Math.sqrt(Pr)
	wavelength=speed/freq
              if (efflength*10>wavelength)
                  {alert("WARNING: The LENGTH of the pipe is too big, compared to FREQUENCY")}
              if (radius*2*10>wavelength)
                  {alert("WARNING: The RADIUS of the pipe is too big, compared to FREQUENCY")}
              if (Math.pow(volume/Math.PI/4*3,1/3)*2*10>wavelength)
                  {alert("WARNING: The VOLUME of the container is too big, compared to FREQUENCY")}
	area=Math.PI*radius*radius
	L=density*efflength/area
	C=volume/density/Math.pow(speed,2)
	requiv=Math.pow(volume/Math.PI/2,1/3)
	// is called Rct in the webpage
Rcw=density*Math.pow(speed,2)/(Math.sqrt(Math.PI*viscosity*freq/density)*(gammaprandtl-1)*Math.PI*Math.pow(requiv,2))
	fhelm=1/(2*Math.PI*Math.sqrt(L*C))
	Rcwhelm=density*Math.pow(speed,2)/(Math.sqrt(Math.PI*viscosity*fhelm/density)*(gammaprandtl-1)*Math.PI*Math.pow(requiv,2))
	wavelengthhelm=speed/fhelm
              if (efflength*10>wavelengthhelm)
                  {alert("WARNING: The LENGTH of the pipe is too big, compared to FHELM")}
              if (radius*2*10>wavelengthhelm)
                  {alert("WARNING: The RADIUS of the pipe is too big, compared to FHELM")}
              if (Math.pow(volume/Math.PI/4*3,1/3)*2*10>wavelengthhelm)
                  {alert("WARNING: The VOLUME of the container is too big, compared to FHELM")}
	//viscous penetration depth
	d=Math.sqrt(2*viscosity/density/2/Math.PI/freq)
//	alert(d)
	dk=d/Math.sqrt(Pr)
//	alert(dk)
	Rw=gammaprandtl*efflength/Math.PI/Math.pow(radius,3)*Math.sqrt(4*Math.PI*density*viscosity*freq)
	Rwhelm=gammaprandtl*efflength/Math.PI/Math.pow(radius,3)*Math.sqrt(4*Math.PI*density*viscosity*fhelm)
	Rc=gammaprandtl*8*viscosity*efflength/Math.PI/Math.pow(radius,4)
	Rr=Math.PI*density*freq*freq/speed
	Rrhelm=Math.PI*density*fhelm*fhelm/speed
	if (flanged) {
		Rr=Rr*2
		Rrhelm=Rrhelm*2
		}
	Rt=Rw
	if(Rc>Rt){Rt=Rc}
              Rt=Rt+Rr
              Rthelm=1/(1/(Rrhelm+Rwhelm)+1/Rcwhelm)
	Q=2*Math.PI*fhelm*L/(Rthelm)
	form.Q.value=Math.round(Q)
	form.density.value=Math.round(density*1000)/1000
	form.speed.value=Math.round(speed)
	form.viscosity.value=Math.round(viscosity*10000000)/10000000
	intL=Math.floor(Math.log(L)/Math.log(10))
	form.intL.value=intL
	form.L.value=Math.round(L*Math.pow(10,-intL)*1000)/1000
	intC=Math.floor(Math.log(C)/Math.log(10))
	form.C.value=Math.round(C*Math.pow(10,-intC)*1000)/1000
	form.intC.value=intC
	form.fhelm.value=Math.round(fhelm*10)/10
	form.Rw.value=Math.round(Rw)
	intR=Math.floor(Math.log(Rcw)/Math.log(10))
	form.Rcw.value=Math.round(Rcw*Math.pow(10,-intR)*1000)/1000
	form.Rc.value=Math.round(Rc)
	form.Rr.value=Math.round(Rr)
	form.Rt.value=Math.round(Rt)
	form.Rthelm.value=Math.round(Rthelm)
	window.status="Calculations finished"
}

