function updateThisReply(replyID) {
	var ajax = getXMLHttpRequestObject();
	if(ajax) {
		ajax.open('POST', 'http://www.10to1.com/updateReply.php');
		ajax.onreadystatechange = function() {
			handleUpdateReply(ajax,replyID);
		}
		var thisReply ='thisReply'+replyID;
		var reply = document.getElementById(thisReply).value;
		var values = 'replyID='+ encodeURIComponent(replyID) +'&thisReply='+ encodeURIComponent(reply);
		ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		ajax.send(values);
		return false;
	}
}
function handleUpdateReply(ajax,replyID) {
	if(ajax.readyState == 4) {
		if((ajax.status == 200) || (ajax.status == 304)) {
			if(ajax.responseText=='Your Reply Has Been Updated')
			{			
				/* End of update DB, now grab reply */
				ajax.open('GET','http://www.10to1.com/getReply.php?replyID='+ replyID +"&" + Math.random());
				ajax.onreadystatechange=function()
				{
					finishUpdateReply(ajax,replyID);
				}
				ajax.send(null);
				/* End of Grab Reply */
			}
			else
			{
				var resultsSpot='updateReplyResults'+replyID;
				var results = document.getElementById(resultsSpot);
				results.innerHTML=ajax.responseText;
			}
		}
	}
}
function finishUpdateReply(ajax,replyID)
{
	if(ajax.readyState==4)
	{
		if((ajax.status==200)||(ajax.status==304))
		{
			var innerReplySection='innerReplySection'+replyID;
			var updateReplySection='updateReplySection'+replyID;
			var replySpot='replySpace'+replyID;
			var results=document.getElementById(replySpot);
			results.innerHTML=ajax.responseText;
			/* Switch out of edit reply */
			showHide(innerReplySection,updateReplySection);
		}
	}
}
