function design() { var T, A, B, L; T=document.f1.dimT.value; //tubing OD if(isNaN(T)) alert("Numerical input only! No text or blank spaces!"); T=Math.round(1000*T)/1000; //tubing OD to 3 places A=Math.round(1000*(T-.002))/1000; //fitment ID at opening B=Math.round(1000*(T*.925-.001))/1000; //fitment ID at tubing stop L=Math.round(1000*(T*.5+.3))/1000; //distance between A and B document.f1.dimA.value=A; //display "create"output document.f1.dimB.value=B; document.f1.dimL.value=L; document.f2.dimT.value=T; //populate "check" input document.f2.dimA.value=A; document.f2.dimB.value=B; document.f2.dimL.value=L; } function check() { var Ttol, Atol, Btol, Ltol; //Tubing and fitting tolerances var Tmin, Tnom, Tmax; //Outside Diameter of tubing var Amin, Anom, Amax; //Diameter at end of lead-in var Bmin, Bnom, Bmax; //Diameter at tubing stop var Lmin, Lnom, Lmax; //Distance between A and B var ILmin, ILmax; //Length of tubing interference var Imin, Imax; //Percent interference Tnom=document.f2.dimT.value; Ttol=document.f2.tolT.value; Anom=document.f2.dimA.value; Atol=document.f2.tolA.value; Bnom=document.f2.dimB.value; Btol=document.f2.tolB.value; Lnom=document.f2.dimL.value; Ltol=document.f2.tolL.value; if(isNaN(Tnom)||isNaN(Ttol)||isNaN(Anom)||isNaN(Atol)||isNaN(Bnom)||isNaN(Btol)||isNaN(Lnom)||isNaN(Ltol)) alert("Numerical input only! No letters or blank spaces!"); Tnom*=1; Ttol*=1; Anom*=1; Atol*=1; Bnom*=1; Btol*=1; Lnom*=1; Ltol*=1; Tmin=Tnom-Ttol; Tmax=Tnom+Ttol; Amin=Anom-Atol; Amax=Anom+Atol; Bmin=Bnom-Btol; Bmax=Bnom+Btol; Lmin=Lnom-Ltol; Lmax=Lnom+Ltol; if(Amax>=Tmin) //ILmin ILmin=(Lmin*(Tmin-Bmax))/(Amax-Bmax); else ILmin=Lmin; if(Amin>=Tmax) //ILmax ILmax=(Lmax*(Tmax-Bmin))/(Amin-Bmin); else ILmax=Lmax; if(Amax