// JavaScript Document
var isFireFox = 0
if (navigator.userAgent.indexOf("Firefox")!=-1) isFireFox = 1;


//Algemene xml-aansturingsroutines
var xmlhttp;

function xml_clear(spanControl) {
  document.getElementById(spanControl).innerHTML = "";
}

function xml_write(spanControl, sTekst) {
  document.getElementById(spanControl).innerHTML = sTekst;
}

function xml_flip(spanControl) {
	var stat = document.getElementById(spanControl).style.display;
	if (stat=="none") { 
		document.getElementById(spanControl).style.display = "block"; } 
	else {
		document.getElementById(spanControl).style.display = "none";
	}
}

function xml_get(url, spanControl, js_loadfunctie, toonloading) {
	xmlhttp = false;
	if (toonloading=="1" && spanControl!="") {
		xml_write(spanControl,"<table width='100%' cellpadding='0' cellspacing='0'><tr><td class='groen'><img src='/imgv2/loading/mozilla_blu.gif' alt='bezig met laden' align='absmiddle'> Even geduld...</td></tr><table>");
	}
	// branch for native XMLHttpRequest object
	if(window.XMLHttpRequest) {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch(e) {
			xmlhttp = false;
		}
		// branch for IE/Windows ActiveX version
	} 
	else if(window.ActiveXObject) {
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				xmlhttp = false;
			}
		}
	}
	if(xmlhttp) {
		xmlhttp.onreadystatechange = function() {
 			if (xmlhttp.readyState==4) {
   				if (spanControl!="") document.getElementById(spanControl).innerHTML = xmlhttp.responseText;
				if (js_loadfunctie!="") eval(js_loadfunctie);
  			}
		}
		xmlhttp.open("GET", url, true);
		xmlhttp.send("");
	}
}

function xml_post(url, spanControl, js_loadfunctie, sendlist, encodeextraweg) {
	xmlhttp = false;
	// branch for native XMLHttpRequest object
	if(window.XMLHttpRequest) {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch(e) {
			xmlhttp = false;
		}
		// branch for IE/Windows ActiveX version
	} 
	else if(window.ActiveXObject) {
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				xmlhttp = false;
			}
		}
	}
	if(xmlhttp) {
		xmlhttp.onreadystatechange = function() {
 			if (xmlhttp.readyState==4) {
   				if (spanControl!="") document.getElementById(spanControl).innerHTML = xmlhttp.responseText;
				if (js_loadfunctie!="") eval(js_loadfunctie);
  			}
		}
		xmlhttp.open("POST", url, false);
		if (encodeextraweg!="") xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlhttp.send(sendlist);
	}
}

function trim(str)
{
   return str.replace(/^\s*|\s*$/g,"");
}