function fill(t) {
	if (t.value == 0) {
		for (i = 0; i < zones.length; i++) {
			document.getElementById(zones[i] + '_reg').innerHTML = '&nbsp;';
			document.getElementById(zones[i] + '_re_reg').innerHTML = '&nbsp;';
		}
	} else {
		SendQuery(t.value);
	}
}

var reqIC;

function Initialize() {
	try {
		reqIC = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e) {
		try {
			reqIC = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc) {
			reqIC = null;
		}
	}
	if (reqIC == null && typeof XMLHttpRequest != "undefined") {	
		reqIC = new XMLHttpRequest();
	}

}

function SendQuery(r) {
	Initialize();
	var url = "get_price_info.php?pid=" + r;
	if (reqIC != null) {
		reqIC.onreadystatechange = ProcessIC;
		reqIC.open("GET", url, true);
		reqIC.send(null);
	}
}


function ProcessIC() {
	if (reqIC.readyState == 4) {
		if(reqIC.status == 200) {
			var doc = reqIC.responseXML;
			var x = doc.getElementsByTagName('zone');
			for (i = 0; i < x.length; i++) {
				document.getElementById(x[i].childNodes[0].firstChild.data + '_reg').innerHTML = x[i].childNodes[1].firstChild.data;
				document.getElementById(x[i].childNodes[0].firstChild.data + '_re_reg').innerHTML = x[i].childNodes[2].firstChild.data;
			}
		}
	}
}
