var url = "/js/GetData.php?string="; // The server-side script
var urlb = "&prodnr="; // The server-side script
var http = getHTTPObject(); // We create the HTTP Object

function requestInfo(prodNr) {
	// Call the delay function
	search_delay(this, prodNr);
}
function search_delay(element, prodNr) {
	// Create a function to get the search results
	var func = function() { doit(prodNr); };
	// Check to see if there is already a timeout and if so...
	// ...cancel it and create a new one
	if ( element.zid ) {
		clearTimeout(element.zid);
	}
	element.zid = setTimeout(func,500);
}
function doit(prodNr) {
	var sId = document.getElementById(prodNr).value;
	http.open("GET", url + escape(sId) + urlb + escape(prodNr), true);
	http.onreadystatechange = handleHttpResponse;
	http.send(null);
}
function handleHttpResponse() {
	if (http.readyState == 4) {
		if(http.status == 200) {
			window.location.reload()
		}
	}
}
function getHTTPObject() {
	var xmlhttp;
	if(window.XMLHttpRequest){
		xmlhttp = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		if (!xmlhttp) {
			xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	}
	return xmlhttp;
}