function addListItem(objForm){
	// create an xmlHttpObject
	xmlHttp = GetXmlHttpObject();
	
	// check to make sure it was created properly
	if(xmlHttp == null){
		document.getElementById("addItemDetails").innerHTML = "Your browser does not support AJAX";
		return;
	}
	
	document.getElementById("addItemDetails").innerHTML = "Adding";
	
	// create the query
	var strURL = "statusadmin.php?action=AddList";
	strURL += "&listName=" + objForm.listName.value;
	strURL += "&listTitle=" + objForm.listTitle.value;
	strURL += "&listDisplayColumns=" + objForm.listDisplayColumns.value;
	strURL += "&listDes=" + objForm.listDes.value;
	strURL += "&parentID=" + objForm.parentID.value;
	
	// update the xmlHttp object to display the information
	xmlHttp.onreadystatechange = addItemUpdateStateChange;
	xmlHttp.open("GET",strURL,true);
	xmlHttp.send(null);
	
	return false;
}

function addItemUpdateStateChange(){
	// check to see if the state is 4
	if(xmlHttp.readyState == 4){
		// update the body with the returned text
		document.getElementById("addItemDetails").innerHTML = "Added" + xmlHttp.responseText;
	}
}

function editItemUpdate(objForm){
	// create an xmlHttpObject
	xmlHttp = GetXmlHttpObject();
	
	// check to make sure it was created properly
	if(xmlHttp == null){
		document.getElementById("editItemDetails").innerHTML = "Your browser does not support AJAX";
		return;
	}
	
	document.getElementById("editItemDetails").innerHTML = "Updating";
	
	// create the query
	var strURL = "statusadmin.php?action=Update";
	strURL += "&listID=" + objForm.listID.value;
	strURL += "&listName=" + objForm.listName.value;
	strURL += "&listTitle=" + objForm.listTitle.value;
	strURL += "&listDisplayColumns=" + objForm.listDisplayColumns.value;
	strURL += "&listDes=" + objForm.listDes.value;
	strURL += "&listParent=" + objForm.parentID.value;
	
	// update the xmlHttp object to display the information
	xmlHttp.onreadystatechange = editItemUpdateStateChange;
	xmlHttp.open("GET",strURL,true);
	xmlHttp.send(null);
	
	return false;
}

function editItemUpdateStateChange(){
	// check to see if the state is 4
	if(xmlHttp.readyState == 4){
		// update the body with the returned text
		document.getElementById("editItemDetails").innerHTML = "Updated";
	}
}

function listSelectOption(strValue){
	// create an xmlHttpObject
	xmlHttp = GetXmlHttpObject();
	
	// check to make sure it was created properly
	if(xmlHttp == null){
		document.getElementById("statusadmin").innerHTML = "Your browser does not support AJAX";
		return;
	}
	
	document.getElementById("listselectarea").innerHTML = "Loading";
	
	// create the query
	var strURL = "statusadmin.php?action=editlist&value="+strValue;
	
	// update the xmlHttp object to display the information
	xmlHttp.onreadystatechange = listSelectOptionStateChange;
	xmlHttp.open("GET",strURL,true);
	xmlHttp.send(null);
}

function listSelectOptionStateChange(){
	// check to see if the state is 4
	if(xmlHttp.readyState == 4){
		// update the body with the returned text
		document.getElementById("listselectarea").innerHTML = xmlHttp.responseText;
	}
}

function statusSelectOption(strValue){
	// create an xmlHttpObject
	xmlHttp = GetXmlHttpObject();
	
	// check to make sure it was created properly
	if(xmlHttp == null){
		document.getElementById("statusadmin").innerHTML = "Your browser does not support AJAX";
		return;
	}
	
	// create the query
	var strURL = "statusadmin.php?action="+strValue;
	
	// update the xmlHttp object to display the information
	xmlHttp.onreadystatechange = statusSelectOptionStateChange;
	xmlHttp.open("GET",strURL,true);
	xmlHttp.send(null);
}

function statusSelectOptionStateChange(){
	// check to see if the state is 4
	if(xmlHttp.readyState == 4){
		// update the body with the returned text
		document.getElementById("statusadmin").innerHTML = xmlHttp.responseText;
	}
}

function updateDisplayColumns(){
	var strDisplay = " ";
	// get the form
	var objForm = document.getElementById("adminListEditForm");
	
	if(objForm.reactionType.checked){
		strDisplay += "reactionType,";
	}
	
	if(objForm.reactionResponsible.checked){
		strDisplay += "reactionResponsible,";
	}
	
	if(objForm.reactionStatus.checked){
		strDisplay += "reactionStatus,";
	}
	
	if(objForm.reactionDateAdded.checked){
		strDisplay += "reactionDateAdded,";
	}
	
	strDisplay = strDisplay.substr(0,strDisplay.length-1);
	
	objForm.listDisplayColumns.value = strDisplay;
}

function updateListOrder(strAction, intID){
		// create an xmlHttpObject
	xmlHttp = GetXmlHttpObject();
	
	// check to make sure it was created properly
	if(xmlHttp == null){
		document.getElementById("statusadmin").innerHTML = "Your browser does not support AJAX";
		return true;
	}
	
	document.getElementById("statusadmin").innerHTML = "Updating...";
	
	// create the query
	var strURL = "statusadmin.php?action="+strAction+"&id="+intID;
	
	// update the xmlHttp object to display the information
	xmlHttp.onreadystatechange = updateListOrderStateChange;
	xmlHttp.open("GET",strURL,true);
	xmlHttp.send(null);
	
	return false;
}

function updateListOrderStateChange(){
	// check to see if the state is 4
	if(xmlHttp.readyState == 4){
		// update the body with the returned text
		document.getElementById("statusadmin").innerHTML = xmlHttp.responseText;
	}
}
