function saveNewCaption(token, caption)
{
	var req = false;
	// branch for native XMLHttpRequest object
	if(window.XMLHttpRequest && !(window.ActiveXObject))
	{
		try
		{
			req = new XMLHttpRequest();
		} catch(e)
		{
			req = false;
		}
		// branch for IE/Windows ActiveX version
	} else if(window.ActiveXObject) 
	{
		try
		{
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e)
		{
			try
			{
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e)
			{
				req = false;
			}
		}
	}
	
	if(req)
	{


		req.open("GET", "http://" + window.location.host + "/WebObjects/Epics3.woa/wa/com.epics3.app.utilities.SaveUpdatedCaptionDirectAction/saveUpdatedCaption?token=" + token + "&caption=" + escape(caption) + "&time="+new Date().getTime(), false);

		try
		{
			req.send(null);
		} catch (error)
		{
		captionIDText = token + "-caption-text";
		captionIDTextInput = token + "-caption-text-input";
		captionIDForm = token + "-form";

		}		
		if (req.status == 200)
		{
			captions[token] = caption;
			document.getElementById(captionIDText).style.display = "";
			document.getElementById(captionIDTextInput).style.display = "none";
			document.getElementById(captionIDText).innerHTML = caption;
		} else
		{
			document.getElementById("Button-SaveSmall-" + token).src="http://web.epics3.com/images/Button-SaveSmall.gif";
			document.getElementById("ErrorMessage-" + token).innerHTML="<br/>Error updating caption.<br/>Please try again or<br/>logout then log back in.";
		}
	}

}





