 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 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.anrei.value <=74)
document.Form5.ausgabe.value=WertA*6.15 + WertB*2.82 + WertC*3.93 + WertD*3.00 + WertE*12.70 ;
 if (document.Form5.abrei.value >=92)  
        document.Form5.ausgabe.value=WertA*7.38 + WertB*3.37 + WertC*4.73 + WertD*3.00 + WertE*12.70 ;
  if (document.Form5.anrei.value >=92)  
        document.Form5.ausgabe.value=WertA*7.38 + WertB*3.37 + WertC*4.73+ WertD*3.00 + WertE*12.70 ;
 if (document.Form5.anrei.value >=181)  
        document.Form5.ausgabe.value=WertA*8.20 + WertB*3.75 + WertC*5.25 + WertD*3.00 + WertE*12.70 ;
 if (document.Form5.abrei.value >=182)  
        document.Form5.ausgabe.value=WertA*8.20 + WertB*3.75 + WertC*5.25 + WertD*3.00 + WertE*12.70 ;
 if (document.Form5.anrei.value >=244) 
        document.Form5.ausgabe.value=WertA*7.38 + WertB*3.37 + WertC*4.73 + WertD*3.00 + WertE*12.70 ;
 if (document.Form5.anrei.value >=305)
document.Form5.ausgabe.value=WertA*6.15 + WertB*2.82 + WertC*3.93 + WertD*3.00 + WertE*12.70 ;


if (document.Form5.zahl6.value >=1)
         document.Form5.au.value=Wertf;
if (document.Form5.zahl6.value >=7)
         document.Form5.au.value=Wertf-1 ;
if (document.Form5.zahl6.value >=14)
         document.Form5.au.value=Wertf-2 ;
if (document.Form5.zahl6.value >=21)
         document.Form5.au.value=Wertf-3 ;
if (document.Form5.zahl6.value >=28)
         document.Form5.au.value=Wertf-4 ;
if (document.Form5.zahl6.value >=35)
         document.Form5.au.value=Wertf-5 ;
if (document.Form5.zahl6.value >=42)
         document.Form5.au.value=Wertf-6 ;
if (document.Form5.zahl6.value >=49)
         document.Form5.au.value=Wertf-7 ;
if (document.Form5.zahl6.value >=56)
         document.Form5.au.value=Wertf-8 ;
if (document.Form5.zahl6.value >=63)
         document.Form5.au.value=Wertf-9 ;
if (document.Form5.zahl6.value >=70)
         document.Form5.au.value=Wertf-10 ;
if (document.Form5.zahl6.value >=77)
         document.Form5.au.value=Wertf-11 ;
if (document.Form5.zahl6.value >=84)
         document.Form5.au.value=Wertf-12 ;
if (document.Form5.zahl6.value >=91)
         document.Form5.au.value=Wertf-13 ;
if (document.Form5.zahl6.value >=98)
         document.Form5.au.value=Wertf-14 ;
if (document.Form5.zahl6.value >=104)
         document.Form5.au.value=Wertf-15 ;
if (document.Form5.zahl6.value >=111)
         document.Form5.au.value=Wertf-16 ;
if (document.Form5.zahl6.value >=118)
         document.Form5.au.value=Wertf-17 ;
if (document.Form5.zahl6.value >=125)
         document.Form5.au.value=Wertf-18 ;
if (document.Form5.zahl6.value >=132)
         document.Form5.au.value=Wertf-19 ;
if (document.Form5.zahl6.value >=140)
          document.Form5.au.value=Wertf-20 ;
if (document.Form5.zahl6.value >=147)
          document.Form5.au.value=Wertf-21 ;
if (document.Form5.zahl6.value >=154)
          document.Form5.au.value=Wertf-22 ;
if (document.Form5.zahl6.value >=161)
           document.Form5.au.value=139 ;
 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 ;

 }
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 rund(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) ;
 }
function run(x) {
  var k = (Math.round(x * 1000) / 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)+00 ;
}

function testrunden() {		
document.Form5.ausga.value = runden(parseFloat(document.Form5.ausgab.value));
document.Form5.ptag.value = runden(parseFloat(document.Form5.ausg.value));
document.Form5.barz.value=rund(parseFloat(document.Form5.ausga.value));
document.anzahlen.amount.value=rund(parseFloat(document.Form5.ausga.value));
document.iclear.betrag.value=rund(parseFloat(document.Form5.barz.value));
}

function uber() {		
document.anzahlen.amount.value=document.Form5.barz.value;
document.iclear.betrag.value=rund(parseFloat(document.Form5.barz.value));
}


