function c_erg() {
var a, c1, c2;
a=document.ummeter.c1.value/2.54;
document.ummeter.c2.value=runden(parseFloat(a)); 
}
function i_erg() {
var a, c3, c4;
a=0;
a=document.ummeter.c3.value*2.54;
document.ummeter.c4.value=runden(parseFloat(a));
}
function k_erg() {
var a, k1, k2;
a=0;
a=document.ungew.k1.value/0.454;
document.ungew.k2.value=runden(parseFloat(a));
}
function l_erg() {
var a, k3, k4;
a=0;
a=document.ungew.k3.value*0.454;
document.ungew.k4.value=runden(parseFloat(a));
}
function f_erg() {
var a, gew, h, h1, hub, fed, hart, v;
h=document.feder.hub.value;
h1=h/25.4;
v=document.feder.fed.value/h;
a=document.feder.gew.value*4.5;
a=a/h1;
a=a*v;
document.feder.hart.value=runden(parseFloat(a));
document.feder.hart1.value=runden(parseFloat(a/5.714));
}
function n_erg() {
var a, n1, n2;
a=document.kraft.n1.value*5.714;
document.kraft.n2.value=runden(parseFloat(a));;
}
function z_erg() {
var a, n3, n4;
a=document.kraft.n3.value/5.714;
document.kraft.n4.value=runden(parseFloat(a));
}
function mph() {
var a, k1, k2;
a=document.tempo.k1.value/1.609344;
document.tempo.k2.value=runden(parseFloat(a));;
}
function km() {
var a, n3, n4;
a=document.tempo.k3.value*1.609344;
document.tempo.k4.value=runden(parseFloat(a));
}
function p_erg() {
var a, p1, p2;
a=document.luft.p1.value*14.35;
document.luft.p2.value=runden(parseFloat(a));
}
function b_erg() {
var a, p3, p4;
a=document.luft.p3.value/14.35;
document.luft.p4.value=runden(parseFloat(a));
}
function v_erg() {
var a, b, c, v1, v2, v3, v4;  
a=document.akku.v1.value;
b=document.akku.v2.value;
c=document.akku.v3.value/a;
d=b/c;
d=d-((d/100)*10);
document.akku.v4.value=runden(parseFloat(d));
}
function w_erg() {
var a,b,c,i,s1,s2,s3;
a=document.strom.s1.value;
b=document.strom.s2.value;
c=document.strom.s3.value; 
i=0; 
if (a>0) i=i+1;
if (b>0) i=i+2;
if (c>0) i=i+4;
if (i==7) alert ("Es dürfen nur zwei Parameter eingegeben werden!"+i); 
if (i==3) document.strom.s3.value=runden(parseFloat(a*b));  
if (i==5) document.strom.s2.value=runden(parseFloat(c/a)); 
if (i==6) document.strom.s1.value=runden(parseFloat(c/b)); 
}
function test(eingabe) 
{
  Eingabe= eingabe;
  zahl = parseFloat(eingabe);
  if (isNaN(zahl)) zahlString = ""
    else zahlString = new String(zahl);
  if (eingabe.length != zahlString.length) {
   alert("Eingabe nicht korrekt." +( Eingabe));
   KeineZahl=true;}
   else (KeineZahl=false);
 return(dispnum(zahlString));
}
function Ausgabe()
{
Kl=Kettenlenge(document.data.RiZ.value,document.data.KbZ.value,document.data.KeStLe.value);
//alert("Kettenlänge ungerundet: "+(Kl));
Kl=parseInt(Kl);
//alert("Kettenlänge Integer: "+(Kl));
if (Kl % 2 != 0) {Kl=Kl+1};
Klcm=Kl*1.275;
Klcm=dispnum(Klcm);
document.data.ket1.value=Klcm
document.data.ket2.value=Kl 
}

function Kettenlenge(x1,x2,x3) {
	x = dispnum(0.157*x3+x1/2+x2/2+2);
	return(x);
}
function dispnum(x) {
	x = Math.floor(x*10)/10; // give me two decimal places
	return(x);
}
function compute()  // the main routine
{
 fehler=0;
  h=test(document.data.RiZ.value);  // test auf Zahl
 	if (KeineZahl==false)
  { 
    //alert("fehler : " +( fehler));
		if (h <= 5) {
			alert(dispnum(h)+" Zähne?  Das ist sehr klein! \n\nVersuch es noch einmal!");
			fehler=1;	}
		if (h >= 50) {
			alert(dispnum(h)+" Zähne? Das ist sehr groß!\n\nVersuch es noch einmal!");
			fehler=1;}
 } else {fehler =1}

w = test(document.data.KeStLe.value);
	if (KeineZahl==false)
 {
// alert("fehler  " +( fehler));
		if (w <= 10) {
		alert(dispnum(w)+" mm?  Das ist zu kurz!\n\nEingabe korrigieren!");
		fehler=1;}
	if (w >= 2000) {
		alert(dispnum(w)+" mm? Das ist zu lang!\n\nVersuch es noch einmal!");
	fehler=1; }
  } else { fehler =1 }

// alert("fehler: " +( fehler));
if (fehler == 0) 
Ausgabe();
 
}

MSFPhover = 
  (((navigator.appName == "Netscape") && 
  (parseInt(navigator.appVersion) >= 3 )) || 
  ((navigator.appName == "Microsoft Internet Explorer") && 
  (parseInt(navigator.appVersion) >= 4 ))); 
function MSFPpreload(img) 
{
  var a=new Image(); a.src=img; return a; 
}
<!-- vor alten Browsern verstecken

function multiplikation(r1,r2,w,wl,x,y,k) {
  var ergebnis;
  r1 = r1/2;
  r2 = r2/2;
  winkel  = 360 / x * k;
  y = y/2;
  c =  Math.cos(winkel/57,3)
  w = w/2 - wl
  L = Math.sqrt(r1*r1 + r2*r2 +w*w - 2*r1*r2*c);
  L = L - y;
  L =(L*100-(L*100)%1)/100;
  ergebnis = L;
document.spei.sp1.value=ergebnis;
}
function calculate_t1()
{var RV11   = document.t1.RV11.value;
var RH1   = document.t1.RH1.value;

var M11 = ((207.35*RV11)/RH1)/100
{document.t1.M11.value = Math.round(M11*100)/100;}}


function calculate_us1()
{
var RV11  = document.us1.RV11.value;
var RV21  = document.us1.RV21.value;
var RV31  = document.us1.RV31.value;
var RH1   = document.us1.RH1.value;
var RH2   = document.us1.RH2.value;
var RH3   = document.us1.RH3.value;
var RH4   = document.us1.RH4.value;
var RH5   = document.us1.RH5.value;
var RH6   = document.us1.RH6.value;
var RH7   = document.us1.RH7.value;
var RH8   = document.us1.RH8.value;
var RH9   = document.us1.RH9.value;

var M11 = ((207.35*RV11)/RH1)/100
{document.us1.M11.value = Math.round(M11*100)/100;}
var M12 = ((207.35*RV11)/RH2)/100
{document.us1.M12.value = Math.round(M12*100)/100;}
var M13 = ((207.35*RV11)/RH3)/100
{document.us1.M13.value = Math.round(M13*100)/100;}
var M14 = ((207.35*RV11)/RH4)/100
{document.us1.M14.value = Math.round(M14*100)/100;}
var M15 = ((207.35*RV11)/RH5)/100
{document.us1.M15.value = Math.round(M15*100)/100;}
var M16 = ((207.35*RV11)/RH6)/100
{document.us1.M16.value = Math.round(M16*100)/100;}
var M17 = ((207.35*RV11)/RH7)/100
{document.us1.M17.value = Math.round(M17*100)/100;}
var M18 = ((207.35*RV11)/RH8)/100
{document.us1.M18.value = Math.round(M18*100)/100;}
var M19 = ((207.35*RV11)/RH9)/100
{document.us1.M19.value = Math.round(M19*100)/100;}

var D12 = (M11-M12)*100
{document.us1.D12.value = Math.round(D12*1)/1;}
var D13 = (M12-M13)*100
{document.us1.D13.value = Math.round(D13*1)/1;}
var D14 = (M13-M14)*100
{document.us1.D14.value = Math.round(D14*1)/1;}
var D15 = (M14-M15)*100
{document.us1.D15.value = Math.round(D15*1)/1;}
var D16 = (M15-M16)*100
{document.us1.D16.value = Math.round(D16*1)/1;}
var D17 = (M16-M17)*100
{document.us1.D17.value = Math.round(D17*1)/1;}
var D18 = (M17-M18)*100
{document.us1.D18.value = Math.round(D18*1)/1;}
var D19 = (M18-M19)*100
{document.us1.D19.value = Math.round(D19*1)/1;}


var M21 = ((207.35*RV21)/RH1)/100
{document.us1.M21.value = Math.round(M21*100)/100;}
var M22 = ((207.35*RV21)/RH2)/100
{document.us1.M22.value = Math.round(M22*100)/100;}
var M23 = ((207.35*RV21)/RH3)/100
{document.us1.M23.value = Math.round(M23*100)/100;}
var M24 = ((207.35*RV21)/RH4)/100
{document.us1.M24.value = Math.round(M24*100)/100;}
var M25 = ((207.35*RV21)/RH5)/100
{document.us1.M25.value = Math.round(M25*100)/100;}
var M26 = ((207.35*RV21)/RH6)/100
{document.us1.M26.value = Math.round(M26*100)/100;}
var M27 = ((207.35*RV21)/RH7)/100
{document.us1.M27.value = Math.round(M27*100)/100;}
var M28 = ((207.35*RV21)/RH8)/100
{document.us1.M28.value = Math.round(M28*100)/100;}
var M29 = ((207.35*RV21)/RH9)/100
{document.us1.M29.value = Math.round(M29*100)/100;}

var D22 = (M21-M22)*100
{document.us1.D22.value = Math.round(D22*1)/1;}
var D23 = (M22-M23)*100
{document.us1.D23.value = Math.round(D23*1)/1;}
var D24 = (M23-M24)*100
{document.us1.D24.value = Math.round(D24*1)/1;}
var D25 = (M24-M25)*100
{document.us1.D25.value = Math.round(D25*1)/1;}
var D26 = (M25-M26)*100
{document.us1.D26.value = Math.round(D26*1)/1;}
var D27 = (M26-M27)*100
{document.us1.D27.value = Math.round(D27*1)/1;}
var D28 = (M27-M28)*100
{document.us1.D28.value = Math.round(D28*1)/1;}
var D29 = (M28-M29)*100
{document.us1.D29.value = Math.round(D29*1)/1;}


var M31 = ((207.35*RV31)/RH1)/100
{document.us1.M31.value = Math.round(M31*100)/100;}
var M32 = ((207.35*RV31)/RH2)/100
{document.us1.M32.value = Math.round(M32*100)/100;}
var M33 = ((207.35*RV31)/RH3)/100
{document.us1.M33.value = Math.round(M33*100)/100;}
var M34 = ((207.35*RV31)/RH4)/100
{document.us1.M34.value = Math.round(M34*100)/100;}
var M35 = ((207.35*RV31)/RH5)/100
{document.us1.M35.value = Math.round(M35*100)/100;}
var M36 = ((207.35*RV31)/RH6)/100
{document.us1.M36.value = Math.round(M36*100)/100;}
var M37 = ((207.35*RV31)/RH7)/100
{document.us1.M37.value = Math.round(M37*100)/100;}
var M38 = ((207.35*RV31)/RH8)/100
{document.us1.M38.value = Math.round(M38*100)/100;}
var M39 = ((207.35*RV31)/RH9)/100
{document.us1.M39.value = Math.round(M39*100)/100;}

var D32 = (M31-M32)*100
{document.us1.D32.value = Math.round(D32*1)/1;}
var D33 = (M32-M33)*100
{document.us1.D33.value = Math.round(D33*1)/1;}
var D34 = (M33-M34)*100
{document.us1.D34.value = Math.round(D34*1)/1;}
var D35 = (M34-M35)*100
{document.us1.D35.value = Math.round(D35*1)/1;}
var D36 = (M35-M36)*100
{document.us1.D36.value = Math.round(D36*1)/1;}
var D37 = (M36-M37)*100
{document.us1.D37.value = Math.round(D37*1)/1;}
var D38 = (M37-M38)*100
{document.us1.D38.value = Math.round(D38*1)/1;}
var D39 = (M38-M39)*100
{document.us1.D39.value = Math.round(D39*1)/1;}
}
function runden(x) {
  var k = (Math.round(x * 100) / 100).toString();
  k += (k.indexOf('.') == -1)? '.00' : '00';
  var p = k.indexOf('.'), m = k.indexOf('-.');
  var f = (p == 0 || m == 0)? '0,' : ',';
  return k.substring(0, p) + f + k.substring(p+1, p+3);
}
function GRADFAR() {
var e;
e=document.temp.grad1.value;
e= 32 + (e* (9/5));
document.temp.fa1.value=e;   
  }
function FARGRAD() {
var f;
f=document.temp.fa2.value;
f= (5/9) * (f - 32);
document.temp.grad2.value=f;
  }

