function WertHolen()
    {
     var Wert = "";
     if(document.cookie)
     {
      Wertstart = document.cookie.indexOf("=") + 1;
      Wertende = document.cookie.indexOf(";");
      if(Wertende == -1) Wertende = document.cookie.length;
      Wert = document.cookie.substring(Wertstart,Wertende);
     }
     return Wert;
    }


function WertSetzen(Keks, Wert, Verfall)
    {
     var jetzt = new Date();
     var Auszeit = new Date(jetzt.getTime() + Verfall);
     document.cookie = Keks+"="+Wert+"; expires="+Auszeit.toGMTString()+";";
    }


function Kekse()
    {
     var Verfallszeit = 1000*60*60*24*365;
     var Anzahl = WertHolen();
     var Zaehler = 0;
     if(Anzahl != "") Zaehler = parseInt(Anzahl);
     if(document.cookie)
     {
      Zaehler = 19;
      WertSetzen("Zaehler",Zaehler,Verfallszeit);
     }
     else
     {
      Zaehler = 19;
      WertSetzen("Zaehler",Zaehler,Verfallszeit);
     }

if (Anzahl == Zaehler)   { window.location.href = "kekse/scherzkeks.html"; }

else {
if (Anzahl == "")  { window.location.href = "kekse/keks0.html"; }
if (Anzahl == 1)   { window.location.href = "kekse/keks1.html"; }
if (Anzahl == 2)   { window.location.href = "kekse/keks2.html"; }
if (Anzahl == 3)   { window.location.href = "kekse/keks3.html"; }
if (Anzahl == 4)   { window.location.href = "kekse/keks4.html"; }
if (Anzahl == 5)   { window.location.href = "kekse/keks5.html"; }
if (Anzahl == 6)   { window.location.href = "kekse/keks6.html"; }
if (Anzahl == 7)   { window.location.href = "kekse/keks7.html"; }
if (Anzahl == 8)   { window.location.href = "kekse/keks8.html"; }
if (Anzahl == 9)   { window.location.href = "kekse/keks9.html"; }
if (Anzahl == 10)   { window.location.href = "kekse/keks10.html"; }
if (Anzahl == 11)   { window.location.href = "kekse/keks11.html"; }
if (Anzahl == 12)   { window.location.href = "kekse/keks12.html"; }
if (Anzahl == 13)   { window.location.href = "kekse/keks13.html"; }
if (Anzahl == 14)   { window.location.href = "kekse/keks14.html"; }
if (Anzahl == 15)   { window.location.href = "kekse/keks15.html"; }
if (Anzahl == 16)   { window.location.href = "kekse/keks16.html"; }
if (Anzahl == 17)   { window.location.href = "kekse/keks17.html"; }
if (Anzahl == 18)   { window.location.href = "kekse/keks18.html"; }
if (Anzahl == 19)   { window.location.href = "kekse/keks19.html"; }
    }}
