var xmlhttp, alerted;
if (!xmlhttp && !alerted) {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		alert("You need a browser which supports an XMLHttpRequest Object.")
	}
}

function RSchange() {
	if (xmlhttp.readyState == 4) {
		HideElement('ajaxload');
		document.getElementById('results').innerHTML = xmlhttp.responseText;
	}
}

function getInventory(intPartID) {
	if (xmlhttp) {
		var d = new Date();
		var time = d.getTime();
		xmlhttp.open("GET", "../check/mfcheck.php?partid=" + intPartID + "&rand=" + time, true);
		xmlhttp.onreadystatechange = RSchange;
		xmlhttp.send(null);
	}
}

function HideElement(id) {
	document.getElementById(id).style.visibility = 'hidden';
}

var xmlhttp2, alerted2;
if (!xmlhttp2 && !alerted2) {
	try {
		xmlhttp2 = new XMLHttpRequest();
	} catch (e) {
		alert("You need a browser which supports an XMLHttpRequest Object.")
	}
}

function RSchange2() {
	if (xmlhttp2.readyState == 4) {
		document.getElementById('sheet').innerHTML = xmlhttp2.responseText;
	}
}

function getInstallSheet(intPartID) {
	if (xmlhttp2) {
		var d = new Date();
		var time = d.getTime();
		xmlhttp2.open("GET", "../check/mfsheet.php?partid=" + intPartID + "&rand=" + time, true);
		xmlhttp2.onreadystatechange = RSchange2;
		xmlhttp2.send(null);
	}
}
