
    function countdown() {

    var now = new Date();
    var year = now.getYear();
    if (year < 1900) {
    	year += 1900;
    }
    var end = new Date("December 31, " + year + " 23:00:00 GMT");    
    var d = new Date();

      secondcount = (end.getTime() - d.getTime());
               
      if(secondcount > 0) {

        stelle0= Math.floor(secondcount/100000000000);
        secondcount= secondcount-stelle0*100000000000;        
        stelle1= Math.floor(secondcount/10000000000);
        secondcount= secondcount-stelle1*10000000000;
        stelle2= Math.floor(secondcount/1000000000);
        secondcount= secondcount-stelle2*1000000000;
        stelle3= Math.floor(secondcount/100000000);
        secondcount= secondcount-stelle3*100000000;
        stelle4= Math.floor(secondcount/10000000);
        secondcount= secondcount-stelle4*10000000;
        stelle5= Math.floor(secondcount/1000000);
        secondcount= secondcount-stelle5*1000000;
        stelle6= Math.floor(secondcount/100000);
        secondcount= secondcount-stelle6*100000;
        stelle7= Math.floor(secondcount/10000);
        secondcount= secondcount-stelle7*10000;        
        stelle8= Math.floor(secondcount/1000);
        secondcount= secondcount-stelle8*1000;       


        ziffern = Array(10);
        for(var i = 0; i < 10; i++) {
        ziffern[i] = new Image;
        ziffern[i].src = 'image_number/dig' + i + '.gif';
        }
        document.kosten0.src = ziffern[stelle0].src;

        document.kosten1.src = ziffern[stelle1].src;
        document.kosten2.src = ziffern[stelle2].src;        
        document.kosten3.src = ziffern[stelle3].src;        
        document.kosten4.src = ziffern[stelle4].src;        
        document.kosten5.src = ziffern[stelle5].src;        
        document.kosten6.src = ziffern[stelle6].src;        
        document.kosten7.src = ziffern[stelle7].src;        
        document.kosten8.src = ziffern[stelle8].src;                  
        
        setTimeout("countdown()", 1000);
      }
    }

