function displaySystemOptions(sector, location) {
	var xmlhttp;
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="http://crimson-veil.com/includes/ajax/misc.php";
	url=url+"?sectorName="+sector+"&loc="+location;
	xmlhttp.open("GET",url,true);
	xmlhttp.onreadystatechange=function() {
		if(xmlhttp.readyState==4 && xmlhttp.status == 200) {
			if(location == 1) {
				document.getElementById("systemOptions1").innerHTML=xmlhttp.responseText;
				document.getElementById("planetOptions1").innerHTML="";
			} else {
				document.getElementById("systemOptions2").innerHTML=xmlhttp.responseText;
				document.getElementById("planetOptions2").innerHTML="";
			}
		} else {
			if(location == 1) {
				document.getElementById("systemOptions1").innerHTML='<img src="http://crimson-veil.com/images/site/loading_bar.gif" alt="Loading..." />';
			} else {
				document.getElementById("systemOptions2").innerHTML='<img src="http://crimson-veil.com/images/site/loading_bar.gif" alt="Loading..." />';
			}
		}
	}
	xmlhttp.send(null);
}
function displayPlanetOptions(system, location) {
	var xmlhttp;
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="http://crimson-veil.com/includes/ajax/misc.php";
	url=url+"?systemName="+system+"&loc="+location;
	xmlhttp.open("GET",url,true);
	xmlhttp.onreadystatechange=function() {
		if(xmlhttp.readyState==4 && xmlhttp.status == 200) {
			if(location == 1) {
				document.getElementById("planetOptions1").innerHTML=xmlhttp.responseText;
			} else {
				document.getElementById("planetOptions2").innerHTML=xmlhttp.responseText;
			}
		} else {
			if(location == 1) {
				document.getElementById("planetOptions1").innerHTML='<img src="http://crimson-veil.com/images/site/loading_bar.gif" alt="Loading..." />';
			} else {
				document.getElementById("planetOptions2").innerHTML='<img src="http://crimson-veil.com/images/site/loading_bar.gif" alt="Loading..." />';
			}
		}
	}
	xmlhttp.send(null);
}
function addEmp(form) {
	var xmlhttp;
	xmlhttp=GetXmlHttpObject();
	if(xmlhttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="http://crimson-veil.com/includes/ajax/misc.php";
	url=url+"?empID="+parseInt(form.empName.value);
	xmlhttp.open("GET",url,true);
	xmlhttp.onreadystatechange=function() {
		if(xmlhttp.readyState==4 && xmlhttp.status == 200) {
			document.getElementById("assignedEmps").innerHTML=xmlhttp.responseText;
		} else {
			document.getElementById("assignedEmps").innerHTML='<img src="http://crimson-veil.com/images/site/loading_bar.gif" alt="Loading..." />';
		}
	}
	xmlhttp.send(null);
}
function removeEmp(empID) {
	var xmlhttp;
	xmlhttp=GetXmlHttpObject();
	if(xmlhttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="http://crimson-veil.com/includes/ajax/misc.php";
	url=url+"?removeEmpID="+parseInt(empID);
	xmlhttp.open("GET",url,true);
	xmlhttp.onreadystatechange=function() {
		if(xmlhttp.readyState==4 && xmlhttp.status == 200) {
			document.getElementById("assignedEmps").innerHTML=xmlhttp.responseText;
		} else {
			document.getElementById("assignedEmps").innerHTML='<img src="http://crimson-veil.com/images/site/loading_bar.gif" alt="Loading..." />';
		}
	}
	xmlhttp.send(null);
}
function entityClasses(entityType) {
	var xmlhttp;
	xmlhttp=GetXmlHttpObject();
	if(xmlhttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="http://crimson-veil.com/includes/ajax/misc.php";
	url=url+"?entity="+parseInt(entityType);
	xmlhttp.open("GET",url,true);
	xmlhttp.onreadystatechange=function() {
		if(xmlhttp.readyState==4 && xmlhttp.status == 200) {
			document.getElementById("entityClass").innerHTML=xmlhttp.responseText;
		} else {
			document.getElementById("entityClass").innerHTML='<img src="http://crimson-veil.com/images/site/loading_bar.gif" alt="Loading..." />';
		}
	}
	xmlhttp.send(null);
}
function entityInfo(entityType) {
	var xmlhttp;
	xmlhttp=GetXmlHttpObject();
	if(xmlhttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url="http://crimson-veil.com/includes/ajax/misc.php";
	url=url+"?entityType="+parseInt(entityType);
	xmlhttp.open("GET",url,true);
	xmlhttp.onreadystatechange=function() {
		if(xmlhttp.readyState==4 && xmlhttp.status == 200) {
			document.getElementById("entityInformation").innerHTML=xmlhttp.responseText;
		} else {
			document.getElementById("entityInformation").innerHTML='<p><img src="http://crimson-veil.com/images/site/loading_bar.gif" alt="Loading..." /></p>';
		}
	}
	xmlhttp.send(null);
}
