function zaehler(){
   var WertA = document.Form5.zahl1.value;
   var WertB = document.Form5.zahl2.value;
   var WertC = document.Form5.zahl3.value;
   var WertD = document.Form5.zahl4.value;
   var WertE = document.Form5.zahl5.value;
   var Wertf = document.Form5.zahl6.value;
   var WertJ = document.Form5.strom.value;

var WertAn = document.Form5.anreise.value;
var Extrakt = WertAn.slice(0, 2);
document.Form5.bdatum.value=Extrakt;
var Extrak = WertAn.slice(3, 5);
document.Form5.cdatum.value=Extrak;
var Extra = WertAn.slice(6, 10);
document.Form5.ddatum.value=Extra;
var WertAb = document.Form5.abreise.value;
var xtrakt = WertAb.slice(0, 2);
document.Form5.gdatum.value=xtrakt;
var xtrak = WertAb.slice(3, 5);
document.Form5.hdatum.value=xtrak;
var xtra = WertAb.slice(6, 10);
document.Form5.idatum.value=xtra;
document.Form5.jdatum.value=document.Form5.idatum.value-document.Form5.ddatum.value;

var WertN = document.Form5.gdatum.value;
var WertO = document.Form5.hdatum.value;
 if (document.Form5.hdatum.value ==1)
document.Form5.abrei.value=WertN*1 ;
if (document.Form5.hdatum.value==2)
document.Form5.abrei.value=31+WertN*1 ;
if (document.Form5.hdatum.value ==3)
document.Form5.abrei.value=59+WertN*1 ;
if (document.Form5.hdatum.value ==4)
document.Form5.abrei.value=90+WertN*1 ;
if (document.Form5.hdatum.value==5)
document.Form5.abrei.value=120+WertN*1 ;
if (document.Form5.hdatum.value ==6)
document.Form5.abrei.value=151+WertN*1 ;
if (document.Form5.hdatum.value ==7)
document.Form5.abrei.value=181+WertN*1 ;
if (document.Form5.hdatum.value ==8)
document.Form5.abrei.value=212+WertN*1 ;
if (document.Form5.hdatum.value ==9)
document.Form5.abrei.value=243+WertN*1 ;
if (document.Form5.hdatum.value ==10)
document.Form5.abrei.value=273+WertN*1 ;
if (document.Form5.hdatum.value ==11)
document.Form5.abrei.value=304+WertN*1 ;
if (document.Form5.hdatum.value ==12)
document.Form5.abrei.value=334+WertN*1 ;
var WertP = document.Form5.bdatum.value;
var WertR = document.Form5.cdatum.value;
 if (document.Form5.cdatum.value ==1)
document.Form5.anrei.value=WertP*1 ;
if (document.Form5.cdatum.value==2)
document.Form5.anrei.value=31+WertP*1 ;
if (document.Form5.cdatum.value ==3)
document.Form5.anrei.value=59+WertP*1 ;
if (document.Form5.cdatum.value ==4)
document.Form5.anrei.value=90+WertP*1 ;
if (document.Form5.cdatum.value ==5)
document.Form5.anrei.value=120+WertP*1 ;
if (document.Form5.cdatum.value ==6)
document.Form5.anrei.value=151+WertP*1 ;
if (document.Form5.cdatum.value ==7)
document.Form5.anrei.value=181+WertP*1 ;
if (document.Form5.cdatum.value ==8)
document.Form5.anrei.value=212+WertP*1 ;
if (document.Form5.cdatum.value ==9)
document.Form5.anrei.value=243+WertP*1 ;
if (document.Form5.cdatum.value ==10)
document.Form5.anrei.value=273+WertP*1 ;
if (document.Form5.cdatum.value ==11)
document.Form5.anrei.value=304+WertP*1 ;
if (document.Form5.cdatum.value ==12)
document.Form5.anrei.value=334+WertP*1 ;


var WertX = document.Form5.anrei.value;
var WertZ = document.Form5.abrei.value;
document.Form5.zahl6.value=WertZ-WertX ;
 var Wertf = document.Form5.zahl6.value;
 if (document.Form5.zahl6.value >=2)
document.Form5.ausgabe.value=WertA*6.00 + WertB*4.50 + WertC*5.00 + WertD*3.00 + WertE*7.00 + WertJ*1.90 ;
 if (document.Form5.zahl6.value <=1)  
   document.Form5.ausgabe.value=WertA*5.50 + WertB*4.50 + WertC*5.00 + WertD*3.00 + WertE*7.00 + WertJ*1.90 ;


document.Form5.au.value=Wertf;

 var WertG = document.Form5.ausgabe.value;
   var WertH = document.Form5.au.value;
        document.Form5.ausgab.value=WertG*WertH ;
var WertK = document.Form5.ausgab.value;
 document.Form5.ausg.value=WertK/Wertf ;
document.Form5.bar.value=WertK*0.98 ;

 }
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 testrunden() {		
document.Form5.ausga.value = runden(parseFloat(document.Form5.ausgab.value));
document.Form5.ptag.value = runden(parseFloat(document.Form5.ausg.value));


}
