
function ajaxRequest(str, url, functionId){
	var xhr;
	if(window.ActiveXObject){xhr = new ActiveXObject("Microsoft.XMLHTTP");} //IE
	else{xhr = new XMLHttpRequest();} //Mozilla
	
	var serverUrl = url;
	xhr.open("POST", serverUrl, true);
	xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xhr.onreadystatechange = stateChange;
	xhr.send(str);
	
		function stateChange(){ 
			if (xhr.readyState==4){
				var oResponse = xhr.responseText;
				functionId(oResponse);
			}
		}

}
