function createRequestObject()
{
	if (window.XMLHttpRequest)	return new XMLHttpRequest();
	else if (window.ActiveXObject)	return new ActiveXObject("Microsoft.XMLHTTP");
}

function addNote (aid)
{
	var http = createRequestObject();
	http.open('get', 'index.php?m=note&s=add&aid='+aid, true);

	var id = 'note_'+aid;

	document.getElementById (id).innerHTML = "Proszę czekać, dodawanie do notesu";

	http.onreadystatechange = function ()
	{
		if (http.readyState == 4)
		{
			document.getElementById (id).innerHTML = http.responseText;
		}
	}

	http.send(null);
}
