var xmlHttp = createXmlHttpRequestObject();
function createXmlHttpRequestObject()
{
	var xmlHttp;
	
		try
		{
			xmlHttp = new XMLHttpRequest();
		}
		catch (e)
		{
			xmlHttp = false;	
		}

	if (!xmlHttp)
	alert("Ошибка создания объекта XMLHttpRequest. Видимо вы используете старую версию браузера");
	else
	return xmlHttp;
}

function process2(id)
{
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
	{
		var name_k = encodeURIComponent(document.getElementById("name_k").value);
		var text_k = encodeURIComponent(document.getElementById("text_k").value);
		xmlHttp.open("GET", "quickstart2.php?cache='+(new Date().getTime())&name_k=" + name_k + "&text_k=" + text_k + "&id=" + id, true);
		xmlHttp.onreadystatechange = handleServerResponse;
		xmlHttp.send(null);
		document.getElementById("text_k").value = '';
	}
	else
	{
		setTimeout('process2()', 1000);
	}
}

function handleServerResponse()
{
	if (xmlHttp.readyState == 4)
	{
		if (xmlHttp.status == 200)
		{
			xmlResponse = xmlHttp.responseText;
			document.getElementById("place_comment").innerHTML = '<i>' + xmlResponse + '</i>';
		}
		else
		{
			alert("Возникла ошибка");
		}
	}
}