
function DoCallback(URL,CGI)
{
	// branch for native XMLHttpRequest object
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
		req.onreadystatechange = processReqChange;
		req.open('POST', URL, true);
		req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		req.send(CGI);
	// branch for IE/Windows ActiveX version
	} else if (window.ActiveXObject) {
		req = new ActiveXObject('Microsoft.XMLHTTP')
		if (req) {
			req.onreadystatechange = processReqChange;
			req.open('POST', URL, true);
			req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			req.send(CGI);
		}
	}
}

function processReqChange() {
	// only if req shows 'loaded'
	if (req.readyState == 4) {
		// only if 'OK'
		if (req.status == 200) {
			eval(actionFunction);
			//alert(req.responseXML.getElementsByTagName("fname")[0].childNodes[0].nodeValue);
		} else {
			//alert('There was a problem retrieving the XML data:\n' + req.responseText);
		}
	}
}
