var FormUpdater = Class.create();
FormUpdater.prototype =
{
	initialize: function(){},
	ajaxUpdate: function(ajaxResponse)
	{
		var urlEl = ajaxResponse.getElementsByTagName('url')[0];
		var newUrl = urlEl.getAttribute('PATH');
		newUrl += '?METHOD=activity_done';
		newUrl += '&activity_key='+urlEl.getAttribute('activity_key');
		newUrl += '&SID='+urlEl.getAttribute('SID');
		newUrl += '&time-id='+urlEl.getAttribute('time-id');
		newUrl += '&workflow_id='+urlEl.getAttribute('workflow_id');
		newUrl += '&'+urlEl.getAttribute('outcome-id')+'='+urlEl.getAttribute('outcome-value');
		var target = urlEl.getAttribute('target');
		switch(target)
		{
			case '_blank':
				window.open(newUrl);
				break;
			case '_parent':
				window.parent.location = newUrl;
				break;
			case '_top':
			case '_self':
			case '':
			case null:
				window.location = newUrl;
				break;
			default:
				window.location = newUrl;
				//window.open(newUrl,target);
		}
	}
};
