<!--
var xmlHttp;

function GetXmlHttpObject()
{
	var xmlHttp=null;
	
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
		
	} catch (e) {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		
		} catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	
	return xmlHttp;
}

function ajaxCall(url, dest, func)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Your browser does not support AJAX!");
		return;
	} 

	xmlHttp.onreadystatechange = function()
	{
		if (xmlHttp.readyState == 4)
		{
			//return xmlHttp.responseText;
			var execute = new func(xmlHttp.responseText, dest);
		}
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function UpdateCombo(content, cboName)
{
	if (content != '') {
		aOptions = content.split('||');
		aIds = aOptions[0].split('|');
		if (aOptions.length > 1) {
			aTxts = aOptions[1].split('|');
		} else {
			aTxts = aOptions[0].split('|');
		}
		
		cbo = document.forms.formulier[cboName];
		
		if (cbo) {
			cbo.options.length = 0;
			for(i=0;i<aIds.length;i+=1)
			{
				sTxt = replaceAll(unescape(aTxts[i]), '+',' ');
				cbo.options[i] = new Option(sTxt,aIds[i]);
			}
		}
	}
}

function replaceAll(sTxt, sSearch, sReplace) {
	str = sTxt
	for (_i = 0; _i < sTxt.length; _i++) {
		_currChar = sTxt.substring(_i,_i+sSearch.length);
		if (_currChar == sSearch) { str = str.replace(sSearch, sReplace); }
	}
	return str;
}
//-->
