/* * * * * * * * * *    CONVERT SCRIPT 2   * * * * * * * * * *\
*                                                             *
*    Converts between U.S./Imperial and SI (Metric) units.    *
*                                                             *
*        --  Written by Bo Johansson  2002-05-23  --          *
*        --  Pressure measures moved                          *
*             from script convert.js  2002-05-23  --          *
*        --  Torque, power and                                *
*              energy measures added  2002-05-23  --          *
*        --  Common functions moved                           *
*                 to file convert.js  2002-06-14  --          *
*        --   Velocity (speed) added  2002-09-14  --          *
*        --      GW and TW corrected  2002-10-29  --          *
*                                                             *
*   --   http://w1.545.telia.com/~u54504162/index_e.htm   --  *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */


function SPEED_MEASURES()       //******* function added 2002-09-14
{
  this.sikm_h = 1000 / 3600
  this.sikm_s = 1000
  this.sim_s = 1

  this.engFeet_s = 0.3048
  this.engFeet_m = this.engFeet_s / 60
  this.engMiles_h = 5280 * this.engFeet_s / 3600

  this.nautKnot = 1852 / 3600

  this.astrC = 299792458
}


function PRESS_MEASURES()       //******* function added 2000-05-17
{
  this.mKilopascal = 1000
  this.mHectopascal = 100
  this.mPascal = 1
  this.mBar = 100000
  this.mMillibar = 100
  this.mAtm = 101325
  this.mMillimeter_Hg = this.mAtm / 760

  this.engInch_Hg = 25.4 * this.mMillimeter_Hg
  
  this.engPound_sq_inch = 6894.757 
  this.engPound_sq_foot = this.engPound_sq_inch / 144
  
  this.xpressKg_sq_cm = 98066.5      //******* added 2002-03-21 
  this.xpressKg_sq_m = 9.80665       //******* added 2002-03-21
}


function TORQUE_MEASURES()       //******* function added 2002-05-23
{
  this.siNm = 1
  this.sikNm = 1000
  this.simNm = 0.001

  this.xtorqueKg_m = 9.80665

  this.engPound_foot = 1.355817948
  this.engPound_inch = 0.112984829
}


function POWER_MEASURES()       //******* function added 2002-05-23
{
  this.siPowTWatt = 1000000000000   //******* corrected 2002-10-29
  this.siPowGWatt = 1000000000      //******* added 2002-10-29
  this.siPowMWatt = 1000000
  this.siPowkWatt = 1000
  this.siPowWatt = 1
  this.siPowmWatt = 0.001

  this.hpPowUShp = 550 * 1.355817948
  this.hpPowMhp = 735.5
  this.hpPowEhp = 746

  this.engPowLbft_s = 1.355817948
  this.engPowBTU_s = 1055.0559 
  this.engPowBTU_h = this.engPowBTU_s/3600
}


function ENERGY_MEASURES()       //******* function added 2002-05-23
{
  this.siEnWh = 3600
  this.siEnTWh = 1000000000000 * this.siEnWh
  this.siEnGWh = 1000000000 * this.siEnWh
  this.siEnMWh = 1000000 * this.siEnWh
  this.siEnkWh = 1000 * this.siEnWh

  this.siEnMJoule = 1000000
  this.siEnkJoule = 1000
  this.siEnJoule = 1
  this.siEn_mJoule = 0.001

  this.xEn_cal = 4.1868
  this.xEn_kcal = 1000 * this.xEn_cal

  this.xEn_erg = 0.0000001

  this.engEnBTU = 1055.0559
  this.engEnTherm = 100000 * this.engEnBTU
}


var speed_data = new SPEED_MEASURES();       //******* added 2002-09-14

var press_data = new PRESS_MEASURES();

var torque_data = new TORQUE_MEASURES();

var power_data = new POWER_MEASURES();

var energy_data = new ENERGY_MEASURES();



function resetAll(form)    // *** Hack for Opera 4.0  2000-10-14
{
  resetValues(form,speed_data);       //******* added 2002-09-14
  resetValues(form,press_data);
  resetValues(form,torque_data);
  resetValues(form,power_data);
  resetValues(form,energy_data);

}  // * * * * * * * END function resetAll() * * * * * * * * *


//* * * * * * * *   CONVERT SCRIPT 2 - END -  * * * * * * * *


