<!-- the following routines handle the conversion to and from scientific notation--><!-- sn(b,p) converts number with power of 10 to a number-->function sn(b,p){return b*Math.pow(10,p)}<!--snp(x) returns the power of 10 for a number-->function snp(x){return Math.round(Math.log(x)/Math.LN10)}<!--snb(x) returns the base of number with which to multiply the power of 10-->function snb(x){return x/Math.pow(10,snp(x))}<!--svb(b,p) takes input base and power and scales to make base between 1 and 10, returns base-->function svb(b,p){n=sn(b,p);return snb(n)}<!--svp(b,p) takes input base and power and scales to make base between 1 and 10, returns power-->function svp(b,p){n=sn(b,p);return snp(n)}

<!--display(x) checks to see if a number is too small or too large to fit in a 6-space field, and if so, displays ellipsis ...-->function display(x){xx=x;if(x<Math.pow(10,-4))xx="...";if(x>.99*Math.pow(10,5))xx="...";return xx}

<!--default values are set for parameters which have zero values--><!--There is value in having an overall default function for a calculation to provide values for all parameter which you dont want to default to zero-->function def(){fh=document.forms[0];if (fh.r0.value==0)fh.r0.value=100;if (fh.r.value==0)fh.r.value=131.2;if (fh.t0.value==0)fh.t0.value=20;if (fh.t.value==0)fh.t.value=100;if (fh.alp.value==0)fh.alp.value=3.9;if (fh.alpp.value==0)fh.alpp.value=-3}