/* ISeeYou.be            */
/* Versie 10 - JavaScript */

var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  xmlhttp = new XMLHttpRequest();
}
var timer = 11000; //iedere 10 seconden refreshen
function update() {
	xmlhttp.open("GET", dir + "paginas/shbx_lezen.php?random="+Math.round(9000*Math.random()),true);//method, target, async (set always true!)
	
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
			document.getElementById('shbx_berichten').innerHTML = xmlhttp.responseText;
		}
	}
	
	xmlhttp.send(null);
	timer = 11000;
	counter();
}

function counter() {
	if(timer == 0) {
		update();
	} else {
		timer = timer - 1000;
		setTimeout("counter()", 1000);
	}
}
