Drugpunker,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
div{
background-color: #00FFFF;
height: 50px;
color: #0000FF;
}
</style>
</head>
<body>
<div id="test"></div>
<div id="test1"></div>
<script>
function countdown(a_date,a_time,a_id)
{
span_id = document.getElementById(a_id);
montharray = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
auct_date = new Date(parseInt(a_date) * 1000);
auct_time = new Date(parseInt(a_time) * 1000);
var auct_year = auct_date.getYear(); if (auct_year < 1000) auct_year += 1900
var auct_month = auct_date.getMonth()
var auct_day = auct_date.getDate()
var auct_hour = auct_time.getHours()
var auct_minute = auct_time.getMinutes()
var auct_second = auct_time.getSeconds()
var futurestring = montharray[auct_month]+" "+auct_day+", "+auct_year+" "+auct_hour+":"+auct_minute+":"+auct_second
function calculate(elem)
{
var res = Date.parse(futurestring) - new Date()
res_day = Math.floor(res/(60*60*1000*24)*1)
res_hour = Math.floor((res%(60*60*1000*24))/(60*60*1000)*1)
res_min = Math.floor(((res%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
res_sec = Math.floor((((res%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if (res > 0)
{
elem.innerHTML = res_day+" д. "+"<br/>"+res_hour+":"+res_min+":"+res_sec
setTimeout( function h()
{
calculate(elem)
},1000);
}
else
{
elem.innerHTML = "Всё проехали";
}
}
calculate(span_id);
}
countdown(new Date()/1000,new Date()/1000+15,'test')
countdown(new Date()/1000,new Date()/1000+5,'test1')
</script>
</body>
</html>