function showContent(link, contentDiv, loadingDiv, contType)
{
	var cont = document.getElementById(contentDiv);
	var loading = document.getElementById(loadingDiv);

	cont.innerHTML = loading.innerHTML;

	var http = createRequestObject();
	if( http )
	{
		http.open('post', link);
		http.onreadystatechange = function ()
		{
			if(http.readyState == 4)
			{
				if(contType == "erase")
				{
					if(cont.innerHTML == "")
						cont.innerHTML = http.responseText;
					else
						cont.innerHTML = "";
				}
				else if(contType == "not-erase")
					cont.innerHTML = http.responseText;
				else if(contType == "add")
					cont.innerHTML = http.responseText+cont.innerHTML;
			}
		}
		http.send(null);
	}
	else
	{
		document.location = link;
	}
}

// создание ajax объекта  
function createRequestObject()
{
	try { return new XMLHttpRequest() }
	catch(e)
	{
		try { return new ActiveXObject('Msxml2.XMLHTTP') }
		catch(e)
		{
			try { return new ActiveXObject('Microsoft.XMLHTTP') }
			catch(e) { return null; }
		}
	}
}
