function Calculate(){
        var stop = 0;

        var oWidth = document.forms[0].oWidth.value;

        var nWidth = document.forms[0].nWidth.value;

        var oRatio = document.forms[0].oRatio.value;

        var nRatio = document.forms[0].nRatio.value;

        var oRim = document.forms[0].oRim.value;

        var nRim = document.forms[0].nRim.value;

        var oSpeed = document.forms[0].oSpeed.value;

		 var umfangdif = document.forms[0].umfangdif.value;

		 var R1 = document.forms[0].Radbreite.value;

		 var R2 = document.forms[0].Radbreite2.value;

		 var oFB = document.forms[0].oFB.value;

		 var nFB = document.forms[0].nFB.value;

		 var oET = document.forms[0].oET.value;

		 var nET = document.forms[0].nET.value;

        if (oWidth == 0 || oRatio == 0 || oRim == 0) {

        alert("Bitte Dimension des Basisreifens (linke Spalte) eingeben.");

stop = 1; } if (nWidth == 0 || nRatio == 0 || nRim == 0) {alert("Bitte Dimension des neuen Reifens (rechte Spalte) eingeben.");

                stop = 1;

                }

        if (oSpeed == 0) {

                alert("Bitte Fahrgeschwindigkeit eingeben.");

                stop = 1;

                }

        if (stop == 0) {

                var oDia = Math.round(oWidth*0.02*oRatio) + (oRim / 0.03937);

                var nDia = Math.round(nWidth*0.02*nRatio) + (nRim / 0.03937);

                var Ratio = oDia/nDia;

                var FB = Math.round((nFB-oFB)*25,4);

                var ET = (oET-nET);

                document.forms[0].tachodif.value = Math.round ((oSpeed*Ratio-oSpeed)*100 /oSpeed)  ;

                document.forms[0].nSpeed.value = Math.round(oSpeed*Ratio);

                document.forms[0].Radbreite.value = Math.round(10*(oWidth/10));

	  			  document.forms[0].Radbreite2.value = Math.round(10*(nWidth/10));

	  			  document.forms[0].Radbreitedif.value = Math.round(10*(nWidth/10-oWidth/10));

	  			  document.forms[0].oRim2.value = (oRim);

	  			  document.forms[0].nRim2.value = (nRim);

	  			  document.forms[0].Spurweite.value = (FB/2+ET);
     }
}


function rechnen(f,b,h,f2,b2,h2)

    {

      var u1=0;

      var u2=0;

      document.forms[0].durchmesser.value =Math.round(f*25.4+2*(b*h/100));

      d1=Math.round(f*25.4+2*(b*h/100));

          u1=Math.round((f*25.4+2*(b*h/100))*3.0500);

      document.forms[0].umfang.value =u1;

      document.forms[0].durchmesser2.value =Math.round(f2*25.4+2*(b2*h2/100));

          d2=Math.round(f2*25.4+2*(b2*h2/100));

      u2=Math.round((f2*25.4+2*(b2*h2/100))*3.0500);

      document.forms[0].umfang2.value =u2;

	  document.forms[0].differenz.value =Math.round(u2*1000/u1-1000)/10;

      document.forms[0].boden.value=Math.round((d2*10)-(d1*10))/20;

	   document.forms[0].umfangdif.value = Math.round(10*(u2-u1))/10;

	   document.forms[0].durchmesserdif.value = Math.round(10*(d2-d1))/10;
}