Есть код, но таймер не могу вывести второй раз. Как это сделать
<html>
<head>
<title></title>
</head>
<body>
<div id="1">
<script language="JavaScript">
TargetDate = "12/31/2016 5:00 AM";
BackColor = "palegreen";
ForeColor = "navy";
CountActive = true;
CountStepper = -1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
FinishMessage = "It is finally here!";
function calcage1(secs, num1, num2) {
s = ((Math.floor(secs/num1))%num2).toString();
if (LeadingZero && s.length < 2)
s = "0" + s;
return "<b>" + s + "</b>";
}
function CountBack1(secs) {
if (secs < 0) {
document.getElementById("cntdwn").innerHTML = FinishMessage;
return;
}
DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage1(secs,86400,100000));
DisplayStr = DisplayStr.replace(/%%H%%/g, calcage1(secs,3600,24));
DisplayStr = DisplayStr.replace(/%%M%%/g, calcage1(secs,60,60));
DisplayStr = DisplayStr.replace(/%%S%%/g, calcage1(secs,1,60));
document.getElementById("cntdwn").innerHTML = DisplayStr;
if (CountActive)
setTimeout("CountBack1(" + (secs+CountStepper) + ")", SetTimeOutPeriod);
}
function putspan1(backcolor, forecolor) {
document.write("<span id='cntdwn' style='background-color:" + backcolor +
"; color:" + forecolor + "'></span>");
}
CountStepper = Math.ceil(CountStepper);
if (CountStepper == 0)
CountActive = false;
var SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990;
putspan1(BackColor, ForeColor);
var dthen = new Date(TargetDate);
var dnow = new Date();
if(CountStepper>0)
ddiff = new Date(dnow-dthen);
else
ddiff = new Date(dthen-dnow);
gsecs = Math.floor(ddiff.valueOf()/1000);
</script>
</div>
<script language="JavaScript">CountBack1(gsecs); /*Выводит таймер*/</script>
Как в этом же документе вывести таймер, но с другим временем. К примеру
<script language="JavaScript">
TargetDate = "11/31/2013 5:00 AM"; /*Изменили время*/
BackColor = "palegreen";
ForeColor = "navy";
CountActive = true;
CountStepper = -1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
FinishMessage = "It is finally here!";
</script>
<script language="JavaScript">CountBack1(gsecs);/*Таймера нет, как сделать чтоб выводился*/</script>
</body>
</html>