// JavaScript Document
function processReqChange() {
	// only if req shows "loaded"
	if (xmlhttp.readyState == 4) {
		// only if "OK"
		if (xmlhttp.status == 200) {
			container.innerHTML = xmlhttp.responseText;
		} else {
			alert("There was a problem retrieving the XML data:\n" + xmlhttp.statusText);
		}
	}
}

function ajaxrating(url, containerid, poststring){
	container =	document.getElementById(containerid);
	xmlhttp = false;
	// branch for native XMLHttpRequest object
	if(window.XMLHttpRequest) {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch(e) {
			xmlhttp = false;
		}
	// branch for IE/Windows ActiveX version
	} else if(window.ActiveXObject) {
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				xmlhttp = false;
			}
		}
	}
	if(xmlhttp) {
		if (poststring != "") {
			msgpost = "POST";
		} else {
			msgpost = "GET";	
		}
		xmlhttp.onreadystatechange = processReqChange;
		xmlhttp.open(msgpost, url, true);
		if (poststring != "") {
			xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		}
		xmlhttp.send(poststring);
	}
}