4 // Provides a counter that keeps track how much
5 // time user have left to check in started quiz.
7 function countdown_clock() {
9 quizTimerValue = quizTimerValue - 1;
11 if(quizTimerValue == 0) {
12 clearTimeout(timeout_id);
13 document.forms[0].timeup.value = 1;
14 document.forms[0].submit();
18 var hours = Math.floor( now / 3600 );
20 now = now - (hours * 3600);
21 var minutes = Math.floor(now / 60);
23 now = now - (minutes * 60);
28 t += ((minutes < 10) ? ":0" : ":") + minutes;
29 t += ((seconds < 10) ? ":0" : ":") + seconds;
30 window.status = t.toString();
32 if(hours == 0 && minutes == 0 && seconds <= 15) {
33 //go from fff0f0 to ffe0e0 to ffd0d0...ff2020, ff1010, ff0000 in 15 steps
34 var hexascii = "0123456789ABCDEF";
35 var col = 'ff' + hexascii.charAt(seconds) + '0' + hexascii.charAt(seconds) + 0;
38 document.forms['clock'].time.value = t.toString();
39 timeout_id = setTimeout("countdown_clock()", 1000);
42 function movecounter() {
46 if (window.innerHeight) {
47 pos = window.pageYOffset
48 } else if (document.documentElement && document.documentElement.scrollTop) {
49 pos = document.documentElement.scrollTop
50 } else if (document.body) {
51 pos = document.body.scrollTop
63 temp = setTimeout('movecounter()',100);
66 function getObjectById (name) {
68 if (document.getElementById) {
69 this.obj = document.getElementById(name);
70 this.style = document.getElementById(name).style;
71 } else if (document.all) {
72 this.obj = document.all[name];
73 this.style = document.all[name].style;
74 } else if (document.layers) {
75 this.obj = document.layers[name];
76 this.style = document.layers[name];