// Umrechnungsroutinen Volumen
// geschrieben am 20.11.2001 von Alfred Müller
// Hinweise, Fragen etc. bitte per E-Mail an alfred.mueller@dagmar-mueller.de

var xxl;
var was;
var wert1;
var wert2;
var wert3;
var wert4;
var wert5;
var wert6;
var wert7;

function rechVolumen() {
  xxl=document.vol1.volumen2.selectedIndex;
  was=document.vol1.volumen2.options[xxl].value;

  wert2=document.vol1.volumen1.value;
  if (was == 1) {
    wert1 = wert2 * 16.387;
    rundeWert1();
    alert(wert2 + " cubic inches sind " + wert1 + " Kubikzentimeter")
  }
  if (was == 2) {
    wert1 = wert2 * 0.061;
    rundeWert1();
    alert(wert2 + " Kubikzentimeter sind " + wert1 + " cubic inches")
  }
  if (was == 3) {
    wert1 = wert2 * 28.413;
    rundeWert1();
    alert(wert2 + " UK fluid ounces sind " + wert1 + " Milliliter")
  }
  if (was == 4) {
    wert1 = wert2 * 0.0338;
    rundeWert1();
    alert(wert2 + " Milliliter sind " + wert1 + " UK fluid ounces")
  }
  if (was == 5) {
    wert1 = wert2 * 1.137;
    rundeWert1();
    alert(wert2 + " UK quarts sind " + wert1 + " Liter")
  }
  if (was == 6) {
    wert1 = wert2 * 0.88;
    rundeWert1();
    alert(wert2 + " Liter sind " + wert1 + " UK quarts")
  }
  if (was == 7) {
    wert1 = wert2 * 4.546;
    rundeWert1();
    alert(wert2 + " UK gallons sind " + wert1 + " Liter")
  }
  if (was == 8) {
    wert1 = wert2 * 0.22;
    rundeWert1();
    alert(wert2 + " Liter sind " + wert1 + " UK gallons")
  }
  if (was == 9) {
    wert1 = wert2 * 1.76;
    rundeWert1();
    alert(wert2 + " Liter sind " + wert1 + " UK pints")
  }
  if (was == 10) {
    wert1 = wert2 * 0.568;
    rundeWert1();
    alert(wert2 + " UK pints sind " + wert1 + " Liter")
  }
  if (was == 11) {
    wert1 = wert2 * 35.315;
    rundeWert1();
    alert(wert2 + " Kubikmeter sind " + wert1 + " cubic feet")
  }
  if (was == 12) {
    wert1 = wert2 * 0.028;
    rundeWert1();
    alert(wert2 + " cubic feet sind " + wert1 + " Kubikmeter")
  }
  if (was == 13) {
    wert1 = wert2 * 1.308;
    rundeWert1();
    alert(wert2 + " Kubikmeter sind " + wert1 + " cubic yards")
  }
  if (was == 14) {
    wert1 = wert2 * 0.765;
    rundeWert1();
    alert(wert2 + " cubic yards sind " + wert1 + " Kubikmeter")
  }
  if (was == 15) {
    wert1 = wert2 * 219.97;
    rundeWert1();
    alert(wert2 + " Kubikmeter sind " + wert1 + " UK gallons")
  }
  if (was == 16) {
    wert1 = wert2 * 0.005;
    rundeWert1();
    alert(wert2 + " UK gallons sind " + wert1 + " Kubikmeter")
  }
  if (was == 17) {
    wert1 = wert2 * 29.5735;
    rundeWert1();
    alert(wert2 + " US fluid ounces sind " + wert1 + " Milliliter")
  }
  if (was == 18) {
    wert1 = wert2 * 0.034;
    rundeWert1();
    alert(wert2 + " Milliliter sind " + wert1 + " US fluid ounces")
  }
  if (was == 19) {
    wert1 = wert2 * 3.785;
    rundeWert1();
    alert(wert2 + " US fluid gallons sind " + wert1 + " Liter")
  }
  if (was == 20) {
    wert1 = wert2 * 0.264;
    rundeWert1();
    alert(wert2 + " Liter sind " + wert1 + " US fluid gallons")
  }
  if (was == 21) {
    wert1 = wert2 * 2.113;
    rundeWert1();
    alert(wert2 + " Liter sind " + wert1 + " US fluid pints")
  }
  if (was == 22) {
    wert1 = wert2 * 0.473;
    rundeWert1();
    alert(wert2 + " US fluid pints sind " + wert1 + " Liter")
  }
  if (was == 23) {
    wert1 = wert2 * 1.056;
    rundeWert1();
    alert(wert2 + " Liter sind " + wert1 + " US fluid quarts")
  }
  if (was == 24) {
    wert1 = wert2 * 0.947;
    rundeWert1();
    alert(wert2 + " US fluid quarts sind " + wert1 + " Liter")
  }
  if (was == 25) {
    wert1 = wert2 * 264.173;
    rundeWert1();
    alert(wert2 + " Kubikmeter sind " + wert1 + " US fluid gallons")
  }
  if (was == 26) {
    wert1 = wert2 * 0.004;
    rundeWert1();
    alert(wert2 + " US fluid gallons sind " + wert1 + " Kubikmeter")
  }
  if (was == 27) {
    wert1 = wert2 * 227.02;
    rundeWert1();
    alert(wert2 + " Kubikmeter sind " + wert1 + " US dry gallons")
  }
  if (was == 28) {
    wert1 = wert2 * 0.004;
    rundeWert1();
    alert(wert2 + " US dry gallons sind " + wert1 + " Kubikmeter")
  }
  if (was == 29) {
    wert1 = wert2 * 1.609;
    rundeWert1();
    wert5 = wert1;
    wert1 = wert5 * 0.264;
    rundeWert1();
    wert6 = wert1;
    wert1 = 100 / wert6
    rundeWert1();
    alert(wert2 + " l auf 100 km sind " + wert5 + " l auf 100 Meilen, " + wert6 + " US fluid gallons auf 100 Meilen und " + wert1 + " Meilen je US fluid gallon")
  }
  if (was == 30) {
    wert1 = 100 / wert2;
    rundeWert1();
    wert5 = wert1;
    wert1 = wert5 * 3.785;
    rundeWert1();
    wert6 = wert1;
    wert1 = wert6 * 0.621
    rundeWert1();
    alert(wert2 + " Meilen je US fluid gallon sind " + wert5 + " US fluid gallons auf 100 Meilen, " + wert6 + " l auf 100 Meilen und " + wert1 + " l auf 100 km")
  }
  if (was == 31) {
    wert1 = wert2 * 3.785;
    rundeWert1();
    wert6 = wert1;
    wert1 = wert6 * 0.621
    rundeWert1();
    alert(wert2 + " US fluid gallons je 100 Meilen sind " + wert6 + " l auf 100 Meilen und " + wert1 + " l auf 100 km")
  }
  if (was == 32) {
    wert1 = wert2 * 1.609;
    rundeWert1();
    wert5 = wert1;
    wert1 = wert5 * 0.22;
    rundeWert1();
    wert6 = wert1;
    wert1 = 100 / wert6
    rundeWert1();
    alert(wert2 + " l auf 100 km sind " + wert5 + " l auf 100 Meilen, " + wert6 + " UK gallons auf 100 Meilen und " + wert1 + " Meilen je UK gallon")
  }
  if (was == 33) {
    wert1 = 100 / wert2;
    rundeWert1();
    wert5 = wert1;
    wert1 = wert5 * 4.546;
    rundeWert1();
    wert6 = wert1;
    wert1 = wert6 * 0.621
    rundeWert1();
    alert(wert2 + " Meilen je UK gallon sind " + wert5 + " UK gallons auf 100 Meilen, " + wert6 + " l auf 100 Meilen und " + wert1 + " l auf 100 km")
  }
  if (was == 34) {
    wert1 = wert2 * 4.546;
    rundeWert1();
    wert6 = wert1;
    wert1 = wert6 * 0.621
    rundeWert1();
    alert(wert2 + " UK gallons je 100 Meilen sind " + wert6 + " l auf 100 Meilen und " + wert1 + " l auf 100 km")
  }
}

function rechFlach() {
  xxl=document.fla1.flach2.selectedIndex;
  was=document.fla1.flach2.options[xxl].value;

  wert2=document.fla1.flach1.value;
  if (was == 1) {
    wert1 = wert2 * 25.4;
    rundeWert1();
    alert(wert2 + " inches sind " + wert1 + " Millimeter")
  }
  if (was == 2) {
    wert1 = wert2 * 0.0394;
    rundeWert1();
    alert(wert2 + " Millimeter sind " + wert1 + " inches")
  }
  if (was == 3) {
    wert1 = wert2 * 2.54;
    rundeWert1();
    alert(wert2 + " inches sind " + wert1 + " Zentimeter")
  }
  if (was == 4) {
    wert1 = wert2 * 0.394;
    rundeWert1();
    alert(wert2 + " Zentimeter sind " + wert1 + " inches")
  }
  if (was == 5) {
    wert1 = wert2 * 0.305;
    rundeWert1();
    alert(wert2 + " feet sind " + wert1 + " Meter")
  }
  if (was == 6) {
    wert1 = wert2 * 3.281;
    rundeWert1();
    alert(wert2 + " Meter sind " + wert1 + " feet")
  }
  if (was == 7) {
    wert1 = wert2 * 0.914;
    rundeWert1();
    alert(wert2 + " yards sind " + wert1 + " Meter")
  }
  if (was == 8) {
    wert1 = wert2 * 1.094;
    rundeWert1();
    alert(wert2 + " Meter sind " + wert1 + " yards")
  }
  if (was == 9) {
    wert1 = wert2 * 1.83;
    rundeWert1();
    alert(wert2 + " fathoms sind " + wert1 + " Meter")
  }
  if (was == 10) {
    wert1 = wert2 * 0.547;
    rundeWert1();
    alert(wert2 + " Meter sind " + wert1 + " fathoms")
  }
  if (was == 11) {
    wert1 = wert2 * 20.108;
    rundeWert1();
    alert(wert2 + " chains sind " + wert1 + " Meter")
  }
  if (was == 12) {
    wert1 = wert2 * 0.0497;
    rundeWert1();
    alert(wert2 + " Meter sind " + wert1 + " chains")
  }
  if (was == 13) {
    wert1 = wert2 * 201.17;
    rundeWert1();
    alert(wert2 + " furlongs sind " + wert1 + " Meter")
  }
  if (was == 14) {
    wert1 = wert2 * 0.005;
    rundeWert1();
    alert(wert2 + " Meter sind " + wert1 + " furlongs")
  }
  if (was == 15) {
    wert1 = wert2 * 1.609;
    rundeWert1();
    alert(wert2 + " miles sind " + wert1 + " Kilometer")
  }
  if (was == 16) {
    wert1 = wert2 * 0.621;
    rundeWert1();
    alert(wert2 + " Kilometer sind " + wert1 + " miles")
  }
  if (was == 17) {
    wert1 = wert2 * 1.852;
    rundeWert1();
    alert(wert2 + " Nautische Meilen sind " + wert1 + " Kilometer")
  }
  if (was == 18) {
    wert1 = wert2 * 0.54;
    rundeWert1();
    alert(wert2 + " Kilometer sind " + wert1 + " Nautische Meilen")
  }
  if (was == 19) {
    wert1 = wert2 * 645.2;
    rundeWert1();
    alert(wert2 + " square inches sind " + wert1 + " Quadratmillimeter")
  }
  if (was == 20) {
    wert1 = wert2 * 0.0015;
    rundeWert1();
    alert(wert2 + " Quadratmillimeter sind " + wert1 + " square inches")
  }
  if (was == 21) {
    wert1 = wert2 * 6.452;
    rundeWert1();
    alert(wert2 + " square inches sind " + wert1 + " Quadratzentimeter")
  }
  if (was == 22) {
    wert1 = wert2 * 0.15;
    rundeWert1();
    alert(wert2 + " Quadratzentimeter sind " + wert1 + " square inches")
  }
  if (was == 23) {
    wert1 = wert2 * 0.093;
    rundeWert1();
    alert(wert2 + " square feet sind " + wert1 + " Quadratmeter")
  }
  if (was == 24) {
    wert1 = wert2 * 10.764;
    rundeWert1();
    alert(wert2 + " Quadratmeter sind " + wert1 + " square feet")
  }
  if (was == 25) {
    wert1 = wert2 * 0.836;
    rundeWert1();
    alert(wert2 + " square yards sind " + wert1 + " Quadratmeter")
  }
  if (was == 26) {
    wert1 = wert2 * 1.196;
    rundeWert1();
    alert(wert2 + " Quadratmeter sind " + wert1 + " square yards")
  }
  if (was == 27) {
    wert1 = wert2 * 404.686;
    rundeWert1();
    alert(wert2 + " square chains sind " + wert1 + " Quadratmeter")
  }
  if (was == 28) {
    wert1 = wert2 * 0.0025;
    rundeWert1();
    alert(wert2 + " Quadratmeter sind " + wert1 + " square chains")
  }
  if (was == 29) {
    wert1 = wert2 * 2.59;
    rundeWert1();
    alert(wert2 + " square miles sind " + wert1 + " Quadratkilometer")
  }
  if (was == 30) {
    wert1 = wert2 * 0.386;
    rundeWert1();
    alert(wert2 + " Quadratkilometer sind " + wert1 + " square miles")
  }
  if (was == 31) {
    wert1 = wert2 * 258.999;
    rundeWert1();
    alert(wert2 + " square miles sind " + wert1 + " Hektar")
  }
  if (was == 32) {
    wert1 = wert2 * 0.0039;
    rundeWert1();
    alert(wert2 + " Hektar sind " + wert1 + " square miles")
  }
  if (was == 33) {
    wert1 = wert2 * 0.405;
    rundeWert1();
    alert(wert2 + " acre sind " + wert1 + " Hektar")
  }
  if (was == 34) {
    wert1 = wert2 * 2.471;
    rundeWert1();
    alert(wert2 + " Hektar sind " + wert1 + " acre")
  }
}

function rechEnergie() {
  xxl=document.ene1.energ2.selectedIndex;
  was=document.ene1.energ2.options[xxl].value;

  wert2=document.ene1.energ1.value;
  if (was == 1) {
    wert1 = wert2 * 1.358;
    rundeWert1();
    alert(wert2 + " Kilowatt sind " + wert1 + " PS")
  }
  if (was == 2) {
    wert1 = wert2 * 0.736;
    rundeWert1();
    alert(wert2 + " PS sind " + wert1 + " Kilowatt")
  }
  if (was == 3) {
    wert1 = wert2 * 4.187;
    rundeWert1();
    alert(wert2 + " (Kilo)Kalorien sind " + wert1 + " (Kilo)Joule")
  }
  if (was == 4) {
    wert1 = wert2 * 0.239;
    rundeWert1();
    alert(wert2 + " (Kilo)Joule sind " + wert1 + " (Kilo)Kalorien")
  }
}

function rechSpeed() {
  xxl=document.spe1.speed2.selectedIndex;
  was=document.spe1.speed2.options[xxl].value;

  wert2=document.spe1.speed1.value;
  if (was == 1) {
    wert1 = wert2 * 2.54;
    rundeWert1();
    alert(wert2 + " inches/sec sind " + wert1 + " Zentimeter/Sek.")
  }
  if (was == 2) {
    wert1 = wert2 * 0.394;
    rundeWert1();
    alert(wert2 + " Zentimeter/Sek. sind " + wert1 + " inches/sec.")
  }
  if (was == 3) {
    wert1 = wert2 * 0.305;
    rundeWert1();
    alert(wert2 + " feet/min. sind " + wert1 + " Meter/Min.")
  }
  if (was == 4) {
    wert1 = wert2 * 3.281;
    rundeWert1();
    alert(wert2 + " Meter/Min. sind " + wert1 + " feet/min.")
  }
  if (was == 5) {
    wert1 = wert2 * 0.914;
    rundeWert1();
    alert(wert2 + " yards/min. sind " + wert1 + " Meter/Min.")
  }
  if (was == 6) {
    wert1 = wert2 * 1.094;
    rundeWert1();
    alert(wert2 + " Meter/Min. sind " + wert1 + " yards/min.")
  }
  if (was == 7) {
    wert1 = wert2 * 1.609;
    rundeWert1();
    alert(wert2 + " miles/hour sind " + wert1 + " km/h")
  }
  if (was == 8) {
    wert1 = wert2 * 0.621;
    rundeWert1();
    alert(wert2 + " km/h sind " + wert1 + " miles/hour")
  }
  if (was == 9) {
    wert1 = wert2 * 1.852;
    rundeWert1();
    alert(wert2 + " Knoten sind " + wert1 + " km/h")
  }
  if (was == 10) {
    wert1 = wert2 * 0.540;
    rundeWert1();
    alert(wert2 + " km/h sind " + wert1 + " Knoten")
  }
  if (was == 11) {
    wert1 = wert2 * 3.6;
    rundeWert1();
    alert(wert2 + " Meter/Sek. sind " + wert1 + " km/h")
  }
  if (was == 12) {
    wert1 = wert2 * 0.278;
    rundeWert1();
    alert(wert2 + " km/h sind " + wert1 + " Meter/Sek.")
  }
}

function rechGewicht() {
  xxl=document.gew1.gewicht2.selectedIndex;
  was=document.gew1.gewicht2.options[xxl].value;

  wert2=document.gew1.gewicht1.value;
  if (was == 1) {
    wert1 = wert2 * 5;
    rundeWert1();
    alert(wert2 + " Gramm sind " + wert1 + " Karat")
  }
  if (was == 2) {
    wert1 = wert2 * 0.2;
    rundeWert1();
    alert(wert2 + " Karat sind " + wert1 + " Gramm")
  }
  if (was == 3) {
    wert1 = wert2 * 0.065;
    rundeWert1();
    alert(wert2 + " grains sind " + wert1 + " Gramm")
  }
  if (was == 4) {
    wert1 = wert2 * 15.432;
    rundeWert1();
    alert(wert2 + " Gramm sind " + wert1 + " graines")
  }
  if (was == 5) {
    wert1 = wert2 * 28.349;
    rundeWert1();
    alert(wert2 + " ounces sind " + wert1 + " Gramm")
  }
  if (was == 6) {
    wert1 = wert2 * 0.035;
    rundeWert1();
    alert(wert2 + " Gramm sind " + wert1 + " ounces")
  }
  if (was == 7) {
    wert1 = wert2 * 31.103;
    rundeWert1();
    alert(wert2 + " ounces troy sind " + wert1 + " Gramm")
  }
  if (was == 8) {
    wert1 = wert2 * 0.32;
    rundeWert1();
    alert(wert2 + " Gramm sind " + wert1 + " ounces troy")
  }
  if (was == 9) {
    wert1 = wert2 * 6.350;
    rundeWert1();
    alert(wert2 + " stones sind " + wert1 + " Kilogramm")
  }
  if (was == 10) {
    wert1 = wert2 * 0.157;
    rundeWert1();
    alert(wert2 + " Kilogramm " + wert1 + " stones")
  }
  if (was == 11) {
    wert1 = wert2 * 1.016;
    rundeWert1();
    alert(wert2 + " long tons sind " + wert1 + " Tonnen")
  }
  if (was == 12) {
    wert1 = wert2 * 0.984;
    rundeWert1();
    alert(wert2 + " Tonnen sind " + wert1 + " long tons")
  }
  if (was == 13) {
    wert1 = wert2 * 0.907;
    rundeWert1();
    alert(wert2 + " short tons sind " + wert1 + " Tonnen")
  }
  if (was == 14) {
    wert1 = wert2 * 1.102;
    rundeWert1();
    alert(wert2 + " Tonnen sind " + wert1 + " short tons")
  }
  if (was == 15) {
    wert1 = wert2 * 0.454;
    rundeWert1();
    alert(wert2 + " pounds sind " + wert1 + " Kilogramm")
  }
  if (was == 16) {
    wert1 = wert2 * 2.205;
    rundeWert1();
    alert(wert2 + " Kilogramm sind " + wert1 + " pounds")
  }
  if (was == 17) {
    wert1 = wert2 * 14.223;
    rundeWert1();
    alert(wert2 + " Kilogramm pro cm² sind " + wert1 + " pounds per square inch")
  }
  if (was == 18) {
    wert1 = wert2 * 0.07;
    rundeWert1();
    alert(wert2 + " pounds per square inch sind " + wert1 + " Kilogramm pro cm²")
  }
}


function rundeWert1() {
  wert3 = wert1 * 1000;
  wert4 = Math.round(wert3);
  wert1 = wert4 / 1000;
}
