/*--------------AJAX--------------*/
//Function to create the XMLHTTPRequest object
function createHTTPHandler(){ 
	httphandler = 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 { 
		httphandler = new ActiveXObject("Msxml2.XMLHTTP"); 
	} catch (e) { 
		try { 
			httphandler = new ActiveXObject("Microsoft.XMLHTTP"); 
		} catch (E) { 
			httphandler = false; 
		}
	} 
	@end @*/ 
	if (!httphandler && typeof XMLHttpRequest!='undefined') { 
		httphandler = new XMLHttpRequest(); 
	} 
	return httphandler; 
}

//requests an XML Page with the first url parameter and returns a NULL on error and the XMLHTTPObject on success
function requestXMLPage(url, func, element) {
	if(url == '') return;
	var XMLHTTPObject = createHTTPHandler()
	XMLHTTPObject.open("GET", url, true);
	XMLHTTPObject.setRequestHeader("Cache-Control", "no-cache"); 
	XMLHTTPObject.setRequestHeader("X_USERAGENT", "Laarink Ajax");
	XMLHTTPObject.onreadystatechange=function() { 
		if (XMLHTTPObject.readyState==4) { 
			if (XMLHTTPObject.status == 200)
				func(XMLHTTPObject, element);
		} 
	}
	XMLHTTPObject.send(null);
}

//get the node value
function getNodeValue(obj,tag) {
	return obj.getElementsByTagName(tag)[0].firstChild.nodeValue; 
}

/*------------------Text Label--------------------*/
function fillTextLabel(XMLHTTPObject, element) {
	var answer = XMLHTTPObject.responseXML;
	var root = answer.documentElement;
	document.getElementById(element).innerHTML = root.getElementsByTagName('score')[0].firstChild.nodeValue;
}