function processTimer(){
if (limit > 0) {
setTimeout("processTimer()",1000);
limit--;
} else {
timer_hour = '00'
timer_min = '00'
timer_sec = '00'
/*document.testCheck.submit();*/
}
var timer_hour = parseInt(limit/3600);
var temp_min = limit - timer_hour*3600;
var timer_min = parseInt(temp_min/60);
var timer_sec = temp_min - timer_min*60;
if (timer_hour < 10) timer_hour = '0'+timer_hour;
if (timer_min < 10) timer_min = '0'+timer_min;
if (timer_sec < 10) timer_sec = '0'+timer_sec;
// вывод времени
document.getElementById('hour_timer').innerHTML=timer_hour;
document.getElementById('minute_timer').innerHTML=timer_min;
document.getElementById('second_timer').innerHTML=timer_sec;
}
Limit получает значение "снаружи", при генерации страницы..
т.е.
<script type='text/javascript'>Var limit = (предположим) 500;</script>
<script type='text/javascript' src='путь до файла с методом'></script>