
function CalculateRPM(theForm)
{
   if (theForm.SFM.value > 0 && theForm.ToolDiameter.value > 0)
   {
	RPM = ((theForm.SFM.value * 3.82) / theForm.ToolDiameter.value)
	theForm.RPMResult.value = RPM
   }
}
function CalculateSFM(theForm)
{
   if (theForm.RPM.value > 0 && theForm.ToolDiameter.value > 0)
   {
	SFM = ((theForm.RPM.value * theForm.ToolDiameter.value) / 3.82)
	theForm.SFMResult.value = SFM
   }
}
function CalculateIPM(theForm)
{
   if (theForm.RPM.value > 0 && theForm.ChipLoad.value > 0 && theForm.NbrTeeth.value > 0)
   {
	IPM = (theForm.RPM.value * theForm.ChipLoad.value * theForm.NbrTeeth.value)
	theForm.IPMResult.value = IPM
   }
}
function CalculateChipLoad(theForm)
{
   if (theForm.RPM.value > 0 && theForm.IPM.value > 0 && theForm.NbrTeeth.value > 0)
   {
	ChipLoad = theForm.IPM.value / (theForm.RPM.value * theForm.NbrTeeth.value)
	theForm.ChipLoadResult.value = ChipLoad
   }
}
function CalculateCubicInch(theForm)
{
   if (theForm.IPM.value > 0 && theForm.WOC.value > 0 && theForm.DOC.value > 0)
   {
	CubicInch = theForm.IPM.value * theForm.WOC.value * theForm.DOC.value
	theForm.CubicInchResult.value = CubicInch
   }
}
function CalculateHP(theForm)
{
   if (theForm.CIM.value > 0 && theForm.UHP.value > 0)
   {
	HP = theForm.CIM.value * theForm.UHP.value
	theForm.HPResult.value = HP
   }
}
function CalculateIPR(theForm)
{
   if (theForm.IPM.value > 0 && theForm.RPM.value > 0)
   {
	IPR = theForm.IPM.value / theForm.RPM.value
	theForm.IPRResult.value = IPR
   }
}
function ClearRPM(theForm)
{
	theForm.SFM.value=""
	theForm.ToolDiameter.value=""
	theForm.RPMResult.value=""
}
function ClearSFM(theForm)
{
	theForm.RPM.value=""
	theForm.ToolDiameter.value=""
	theForm.SFMResult.value=""
}
function ClearIPM(theForm)
{
	theForm.RPM.value=""
	theForm.ChipLoad.value=""
	theForm.NbrTeeth.value=""
	theForm.IPMResult.value=""
}
function ClearChipLoad(theForm)
{
	theForm.RPM.value=""
	theForm.IPM.value=""
	theForm.NbrTeeth.value=""
	theForm.ChipLoadResult.value=""
}
function ClearCubicInch(theForm)
{
	theForm.WOC.value=""
	theForm.IPM.value=""
	theForm.DOC.value=""
	theForm.CubicInchResult.value=""
}
function ClearHP(theForm)
{
	theForm.CIM.value=""
	theForm.UHP.value=""
	theForm.HPResult.value=""
}
function ClearIPR(theForm)
{
	theForm.IPM.value=""
	theForm.RPM.value=""
	theForm.IPRResult.value=""
}