<html>
<head>
<title>timer</title>
<script language ="vbscript">
public total_seconds
public elapsed_seconds
public timer_id
total_seconds = 10
elapsed_seconds =0
sub window_onload
show_time
v = window.settimeout ("time_over",total_seconds*1000)
timer_id = window.setinterval("show_time",1000)
end sub
sub time_over
window.left_time.innertext = "done"
v=window.clearinterval(timer_id)
window.questions.disabled = true
end sub
sub show_time
window.elapsed_time.innertext = timeserial(0,0,elapsed_seconds)
window.left_time.innertext = timeserial(0,0,total_seconds - elapsed_seconds)
elapsed_seconds = elapsed_seconds + 1
end sub
</script>
</head>
<body>
<table>
<tr>
<td>elapsed:</td>
<td><p id="elapsed_time"></p></td>
</tr>
<tr>
<td>left:</td>
<td><p id="left_time"></p></td>
</tr>
</table>
<p></p>
<p></p>
<p></p>
<div align="center">
<table id="questions" border="2">
<tr>
<td></td>
<td>question</td>
<td colspan="2">a</td>
<td colspan="2">b</td>
<td colspan="2">c</td>
<td colspan="2">d</td>
</tr>
<tr>
<td>1:</td>
<td>which color ?</td>
<td><input type=radio name="q1" value="1"></td><td>green</td>
<td><input type=radio name="q1" value="2"></td><td>blue</td>
<td><input type=radio name="q1" value="3"></td><td>red</td>
<td><input type=radio name="q1" value="4"></td><td>orange</td>
</tr>
</table>
</div>
</body>
</html>