function test_it(entry) {
 if (entry.value && entry.value.length!=0) {
  entry.value=""+ eval(entry.value);
  }
 computeForm(entry.form);
  }
 
function computeForm(form) {
   d=form.rod.value;
   s=form.stroke.value;
   D=form.bore.value;
   G=form.gpm.value;
   p=G*3.85
 
   pi=3.14159;
   R=Math.round(p*10/(pi*D*D/4))/10;
   r=Math.round(p*10/(pi/4*(D*D-d*d)))/10;
   form.speed.value=R+" inch/sec             "+r+" inch/sec";
 
   et=Math.round(form.stroke.value/R*10)/10;
   rt=Math.round(form.stroke.value/r*10)/10;
   ct=et+rt
   form.cycle.value="Extend Time=  "+et+" sec.    Retract Time= "+rt+" sec.   Cycle Time= "+ct+" sec.";
   }
function reset_it(form) {
 form.bore.value="";
 form.stroke.value="";
 form.rod.value="";
 form.gpm.value="";
 form.speed.value="";
 form.cycle.value="";
 document.FrontPage_Form1.gpm.focus(); 
 
 }
 
function alrt_msg(entry,low,high,prompt) {
 prompt="You couldn't know. "+prompt 
 +" entry has unacceptable stuff: "+entry.value;
 var scratch=entry.value;
 for (var i=0;i<scratch.length;i++) {
  var letter=scratch.substring(i,i+1);
  if ((letter<"0" || "9"<letter) && letter!='.') {
   alert(prompt);
   return false;
   }
    }
 var errtst=parseFloat(scratch)
 if (errtst<low || high<errtst) {
  alert("I'm sorry. "+prompt+ " is not in the range"
  +" from "+low+" to "+high+"!");
  return false;
  }
 entry.value=scratch;
 return true;
 }
 
 
 
 
 <!--webbot BOT="GeneratedScript" PREVIEW=" " startspan -->
function FrontPage_Form1_Validator(theForm)
{
 
  if (theForm.gpm.value == "")
  {
    alert("Please enter a value for the \"gpm\" field.");
    theForm.gpm.focus();
    return (false);
  }
 
  if (theForm.gpm.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"gpm\" field.");
    theForm.gpm.focus();
    return (false);
  }
 
  var checkOK = "0123456789-.,";
  var checkStr = theForm.gpm.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"gpm\" field.");
    theForm.gpm.focus();
    return (false);
  }
 
  if (decPoints > 1)
  {
    alert("Please enter a valid number in the \"gpm\" field.");
    theForm.gpm.focus();
    return (false);
  }
 
  var chkVal = allNum;
  var prsVal = parseFloat(allNum);
  if (chkVal != "" && !(prsVal > "0"))
  {
    alert("Please enter a value greater than \"0\" in the \"gpm\" field.");
    theForm.gpm.focus();
    return (false);
  }
 
  if (theForm.bore.value == "")
  {
    alert("Please enter a value for the \"bore\" field.");
    theForm.bore.focus();
    return (false);
  }
 
  if (theForm.bore.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"bore\" field.");
    theForm.bore.focus();
    return (false);
  }
 
  var checkOK = "0123456789-.,";
  var checkStr = theForm.bore.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"bore\" field.");
    theForm.bore.focus();
    return (false);
  }
 
  if (decPoints > 1)
  {
    alert("Please enter a valid number in the \"bore\" field.");
    theForm.bore.focus();
    return (false);
  }
 
  var chkVal = allNum;
  var prsVal = parseFloat(allNum);
  if (chkVal != "" && !(prsVal > "0"))
  {
    alert("Please enter a value greater than \"0\" in the \"bore\" field.");
    theForm.bore.focus();
    return (false);
  }
 
  if (theForm.stroke.value == "")
  {
    alert("Please enter a value for the \"stroke\" field.");
    theForm.stroke.focus();
    return (false);
  }
 
  var checkOK = "0123456789-,";
  var checkStr = theForm.stroke.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"stroke\" field.");
    theForm.stroke.focus();
    return (false);
  }
 
  var chkVal = allNum;
  var prsVal = parseInt(allNum);
  if (chkVal != "" && !(prsVal > "0"))
  {
    alert("Please enter a value greater than \"0\" in the \"stroke\" field.");
    theForm.stroke.focus();
    return (false);
  }
 
  if (theForm.rod.value == "")
  {
    alert("Please enter a value for the \"rod\" field.");
    theForm.rod.focus();
    return (false);
  }
 
  if (theForm.rod.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"rod\" field.");
    theForm.rod.focus();
    return (false);
  }
 
  var checkOK = "0123456789-.,";
  var checkStr = theForm.rod.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"rod\" field.");
    theForm.rod.focus();
    return (false);
  }
 
  if (decPoints > 1)
  {
    alert("Please enter a valid number in the \"rod\" field.");
    theForm.rod.focus();
    return (false);
  }
 
  var chkVal = allNum;
  var prsVal = parseFloat(allNum);
  if (chkVal != "" && !(prsVal > "0"))
  {
    alert("Please enter a value greater than \"0\" in the \"rod\" field.");
    theForm.rod.focus();
    return (false);
  }
  return (true);
}

<!-- Hide from JS-Impaired Browsers 
document.FrontPage_Form1.gpm.focus();
