// JavaScript Document

//preload images for mouseover effects
  var pics = new Array();
  pics[0] = "images/bulk_feed_gray_text.png";
  pics[1] = "images/stores_gray_text.png";
  pics[2] = "images/agr_gray_text.png";
  pics[3] = "images/garden_gray_text.png";
        
  var preload = new Array();
        
  for ( var i = 0; i < pics.length; i++ )
  {
	preload[i] = new Image();
	preload[i].src = pics[i];
  }
		
  //image changes for nav mouseover effects
  function swap(n)
  {
	if( n == 0 )document.images.navImage1.src = "images/bulk_feed_text.png";
	if( n == 1 )document.images.navImage1.src = "images/bulk_feed_gray_text.png";
	if( n == 2 )document.images.navImage2.src = "images/stores_text.png";
	if( n == 3 )document.images.navImage2.src = "images/stores_gray_text.png";
	if( n == 4 )document.images.navImage3.src = "images/agr_text.png";
	if( n == 5 )document.images.navImage3.src = "images/agr_gray_text.png";
	if( n == 6 )document.images.navImage4.src = "images/garden_text.png";
	if( n == 7 )document.images.navImage4.src = "images/garden_gray_text.png";
  }


<!-- Hide script from really really old browsers...
// JavaScript1.1 code for use in convert1.html
// Requires HTML form values from
//              http://www.people.virginia.edu/~rmf8a/convert.html 
// by Rick Fleming, rmf8a[at]virginia[dot.edu
// (C) 2001-2005 by the Rector & Visitors of the University of Virginia.
// Permission is granted to use for non-commercial purposes only.
// For disclaimer, please see http://www.people.virginia.edu/~rmf8a/
// Conversion factor sources:
// http://www.unc.edu/~rowlett/units/index.html
// http://ts.nist.gov/ts/htdocs/230/235/appxc/appxc.htm
// 
var round=1E8;
function sciVal(num){
 var exp=1, len=1, pose=0, posp=1, posz=1, r=0, rnd=" ", str=" ", out=" ";
 len=round.toString().length - 1;
 str=num.toString();
 pose=str.indexOf("e-");
 posp=str.lastIndexOf(".");
 if (pose == -1) {

// lastIndexOf method returns 0-relative index of last occurence of arg in string
   str=str.substr(posp+1);
   for (posz=0; str.substr(posz,1)=="0"; posz++) {continue};
   exp=posz+1;  // "E-" exponent value
   posz=posz-1; // pos of last leading 0 in fraction
   out=str.substring(posz+1,posz+2);
   if (len>0) {r = Math.round(str.substring(posz+2,posz+len+3)/10) * 10;
               rnd=r.toString();
               out=out + "." + rnd.substring(0,len) + "e-" + exp;}
   else       {out=out + "." + "000000000".substr(1,len+1) + "e-" + exp;}
   }
 else {
   exp=str.substr(pose+2);
   out=str.substring(0,posp); // any digits before the "."
   str=str.substring(posp+1,pose) + "0000000000";
   r=Math.round(str.substring(0,len+1)/10) * 10;
   rnd=r.toString();
   out=out + "." + rnd.substring(0,len) + "e-" + exp;
   }
 return out;
}
      
function reCalcTemp(){
var j=1, k=1, f=new String(" "), t=new String(" "), inn=0.0, out=3.1415926E1
with (document.tempForm) {
  j=from_temp.selectedIndex;
  k=to_temp.selectedIndex;
  f=from_temp.options[j].value;
  t=to_temp.options[k].value;
  inn=parseFloat(in_temp.value);
  if (inn==0 || parseFloat(inn)=='NaN') z=1.0;
  // Convert input temp to Celsius if necessary.  This saves many many
  // lines of if-else-if-else code.
  if (f=="C") inn += 0.0
   else 
   {if (f=="F") {inn = (inn - 32) / 1.8}
    else 
     {if (f=="K") {inn -= 273.15}
      else 
       {if (f=="RA") 
              {inn = ((inn - 491.67) / 1.8)} // -32, -459.67, *5/9 
         else {inn *= 1.25}
       }
     }
   }
  if (t=="C") {out = inn}
  else 
   {if (t=="F") {out = (1.8 * inn) + 32} // C->Fahr.
    else
     {if (t=="K") {out = inn + 273.15} // C->Kelvin
      else
       {if (t=="RA") {out = (1.8 * inn) + 491.67} // C->Fahr.->Rankine
        else {out = inn * 0.8} // C->Reaumur
       }
     }
   }
  outtemp.value=Math.round(out*round)/round;
  } // End of "with (document.tempForm)"
} // End of function

function reCalcLen(){
var j=1, k=1, w=0, x=0, y=0, z=3.1415926E1
with (document.lenForm) {
  j=from_len.selectedIndex;
  k=to_len.selectedIndex;
  x=from_len.options[j].value;
  y=to_len.options[k].value;
  z=parseFloat(in_len.value);
  if (z==0 || z=='NaN') z=1.0;
  w=z*(x/y);
// Math.round rounds argument to nearest INTEGER:
  x=Math.round(w*round)/round;
  if (x != 0) outlen.value=x; 
  else        outlen.value=sciVal(w)
  }
}

function reCalcArea(){
var j=1, k=1, w=0, x=0, y=0, z=3.1415926E1
with (document.areaForm) {
  j=from_area.selectedIndex
  k=to_area.selectedIndex
  x=from_area.options[j].value
  y=to_area.options[k].value
  z=parseFloat(in_area.value)
  if (z==0 || z=='NaN') z=1.0;
  w=z*(x/y);
  x=Math.round(w*round)/round;
  if (x != 0) outarea.value=x;
  else        outarea.value=sciVal(w)
  }
}

function reCalcWt(){
var j=1, k=1, w=0, x=0, y=0, z=3.1415926;
with (document.wtForm) {
  j=from_weight.selectedIndex;
  k=to_weight.selectedIndex;
  x=from_weight.options[j].value;
  y=to_weight.options[k].value;
  z=parseFloat(in_weight.value);
  if (z==0 || z=='NaN') z=1.0;
  w=z*(x/y);
  x=Math.round(w*round)/round;
  if (x != 0) outweight.value=x;
  else        outweight.value=sciVal(w)
  }
}

function reCalcWk() {
var j=1, k=1, x=0, w=0, y=0, z=3.1415926E1;
with (document.workForm) {
  j=from_work.selectedIndex;
  k=to_work.selectedIndex;
  x=from_work.options[j].value;
  y=to_work.options[k].value;
  z=parseFloat(in_work.value);
  if (z==0 || z=='NaN') z=1.0;
  w=z*(x/y);
  x=Math.round(w*round)/round;
  if (x != 0) outwork.value=x;
  else        outwork.value=sciVal(w)
  }
}

function reCalcVol(){
var j=1, k=1, x=0, y=0, z=3.1415926E1;
with (document.volForm) {
  j=from_vol.selectedIndex
  k=to_vol.selectedIndex
  x=from_vol.options[j].value
  y=to_vol.options[k].value
  z=parseFloat(in_vol.value)
  if (z==0 || z=='NaN') z=1.0;
  w=z*(x/y);
  x=Math.round(w*round)/round;
  if (x != 0) outvol.value=x;
  else        outvol.value=sciVal(w)
  }
}

function reCalcFr(){
var j=1, k=1, x=0, y=0, z=3.1415926E1;
with (document.forceForm) {
  j=from_force.selectedIndex;
  k=to_force.selectedIndex;
  x=from_force.options[j].value;
  y=to_force.options[k].value;
  z=parseFloat(in_force.value);
  if (z==0 || z=='NaN') z=1.0;
  w=z*(x/y);
  x=Math.round(w*round)/round;
  if (x != 0) outforce.value=x;
  else        outforce.value=sciVal(w)
  }
}

function reCalcPw() {
var j=1, k=1, x=0, y=0, z=3.1415926E1;
with (document.powerForm) {
  j=from_power.selectedIndex;
  k=to_power.selectedIndex;
  x=from_power.options[j].value;
  y=to_power.options[k].value;
  z=parseFloat(in_power.value);
  if (z==0 || z=='NaN') z=1.0;
  w=z*(x/y);
  x=Math.round(w*round)/round;
  if (x != 0) outpower.value=x;
  else        outpower.value=sciVal(w)
  }
}

function reCalcPr(){
var j=1, k=1, x=0, y=0, z=3.1415926E1;
with (document.pressForm) {
  j=from_press.selectedIndex;
  k=to_press.selectedIndex;
  x=from_press.options[j].value;
  y=to_press.options[k].value;
  z=parseFloat(in_press.value);
  if (z==0 || z=='NaN') z=1.0;
  w=z*(x/y);
  x=Math.round(w*round)/round;
  if (x != 0) outpress.value=x;
  else        outpress.value=sciVal(w)
  }
}
function resetRnd(val){
   round=val;
   with (document) {
    if ( parseFloat(tempForm.outtemp.value) != "NaN" && tempForm.outtemp.value !=0 ) reCalcTemp();
    if ( parseFloat(lenForm.outlen.value) != "NaN" && lenForm.outlen.value != 0) {
      reCalcLen();
      }
    if ( parseFloat(areaForm.outarea.value)  !='NaN' 
      && areaForm.outarea.value != 0)   reCalcArea();
    if ( parseFloat(wtForm.outweight.value)  !='NaN' 
      && wtForm.outweight.value != 0)   reCalcWt();  
    if ( parseFloat(workForm.outwork.value)  !='NaN' 
      && workForm.outwork.value != 0)   reCalcWk();
    if ( parseFloat(volForm.outvol.value)    !='NaN' 
      && volForm.outvol.value != 0)     reCalcVol();
    if ( parseFloat(forceForm.outforce.value)!='NaN' 
      && forceForm.outforce.value != 0) reCalcFr();
    if ( parseFloat(powerForm.outpower.value)!='NaN' 
      && powerForm.outpower.value != 0) reCalcPw();
    if ( parseFloat(pressForm.outpress.value)!='NaN' 
      && pressForm.outpress.value != 0) reCalcPr();
   }
}
// ...end of hidden script -->

