* Minor TOS change
[specialops2.git] / js / index.js
bloba11fbcce189bd07e8a47e132f90643adebec05cc
1 /* © Special Ops 2006
2  * See the included COPYING file for licencing terms.
3  * $Id$
4  */
6 var boardlist;
7 var blCycle = 0;
9 function blUpdate() {
10         if ( boardlist.readyState == 4 && boardlist.status == 200 ) {
11                 var update = boardlist.responseXML.getElementById('boardlist');
12                 var boards = document.getElementById('boardlist');
13                 document.getElementById('so2-index').replaceChild(update, boards);
14         }
17 // Get boardlist every so often
18 timers.things.push(
19         function() {
20                 if ( blCycle % 20 == 0 ) { // 20x15sec
21                         boardlist = new XMLHttpRequest();
22                         boardlist.onreadystatechange = blUpdate;
23                         boardlist.open('GET', 'index?xml', true);
24                         boardlist.send(null);
25                 }
26                 blCycle++;
27         }