Rapid: mehrere Javascriptcounter auf einer Seite

Beitrag lesen

Hallo Leute!

Ich möchte das folgende Script (gefunden auf http://praveenlobo.com1)
mehrmals auf einer Seite anwenden. Aber sobald ich es 2 Mal reinsetze funktionieren beide nicht mehr. Ich habe mich mit der Umbenennung der Variablen gespielt aber ich schaffe es einfach nicht.

Kann mir jemand helfen?

Vielen Dank

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>JavaScript Day Counter - Praveen Lobo</title>
<script type="text/javascript">
/**********************************************************************************************
* Day Counter script by Praveen Lobo (http://PraveenLobo.com/techblog/javascript-counter-count-days/)
* This notice MUST stay intact(in both JS file and SCRIPT tag) for legal use.
* http://praveenlobo.com/blog/disclaimer/
**********************************************************************************************/
function DayCounter(initDate, id){
    this.counterDate = new Date(initDate);
    this.container = document.getElementById(id);
    this.calculate();
}

DayCounter.prototype.calculate=function(){
    var secDiff = Math.round(((new Date()) - this.counterDate)/1000);
    var nextUpdate = (nextUpdate = (secDiff % 86400)) < 0? (nextUpdate*-1) : (86400-nextUpdate);
    var tmp = Math.abs((tmp = secDiff/86400)) < 1? 0 : tmp;
    var days = (tmp < 0 ? Math.ceil(tmp) : Math.floor(tmp));
    this.container.innerHTML =
        "<strong>" + days + "</strong> " + (Math.abs(days) == 1? "day" : "days");
    var self = this;
    setTimeout(function(){self.calculate();}, (++nextUpdate*1000));
}

window.onload=function(){ new DayCounter('November 1, 2012 00:00:00', 'counter'); }

</script>
</head>
<body>
<div id="counter">Contents of this DIV will be replaced by the timer</div>
</body>
</html>