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();
}

function chk_int(type, id) {
	object = document.getElementById(type + '_' + id);
	
	if(object.className == "chkint") { 
		// Hij moet geactiveerd worden
		url = "index.php?a=chk_int&type=" + type + "&id=" + id + "&actief=1";
		nieuweClass = "chkint_chk";
	} else {
		// Hij moet geDEactiveerd worden
		url = "index.php?a=chk_int&type=" + type + "&id=" + id + "&actief=nul";
		nieuweClass = "chkint";
	}
	
	xmlhttp.open("GET", url, true);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState==4) {
			var data = xmlhttp.responseText;
			
			if(data.substring(data.length - 10) == "--!!OK!!--") {
				object.className = nieuweClass;		
			}
		}
	}
	xmlhttp.send(null);
}

function loadDivPositie(div){
	var strCook = document.cookie;
	if(strCook.indexOf("!~")!=0){
		var intS = strCook.indexOf("!~");
		var intE = strCook.indexOf("~!");
		var strPos = strCook.substring(intS+2,intE);
		document.getElementById(div).scrollTop = strPos;
	}
}

function SetDivPosition(div) {
	var intY = document.getElementById(div).scrollTop;
	document.cookie = "yPos=!~" + intY + "~!";
}
