function createHTTPObj() { 
	var req; 
	if(window.XMLHttpRequest){
		// Firefox, Safari, Opera...
		req = new XMLHttpRequest();
	} else if(window.ActiveXObject) {
		// Internet Explorer 5+
		req = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		alert('Problem creating the XMLHttpRequest object');
	}
	return req;
}

// Make the XMLHttpRequest object 
var http = createHTTPObj();

function updatePoisDesc(id) {
	//document.getElementById("desc").innerHTML = '<span style="color:red;">Loading...</span>';
	http.open('GET', '/poison_sales.php?poison='+id, true);
	http.onreadystatechange = function() {
		if (http.readyState == 4 && http.status == 200) {
			var response = http.responseText;
			if(response) {
				document.getElementById("desc").innerHTML = http.responseText;
			} else {
				document.getElementById("desc").innerHTML = 'There was an error loading the description.';
			}
		} else if (http.readyState == 4) {
			document.getElementById("desc").innerHTML = 'There was an error loading the description.';
		}
	}
	http.send(null);
}