function ShowInfoPopup(obj, contenttype, parameter, id)
{
	var windowX = (document.compatMode == 'CSS1Compat' && !window.opera) ? document.documentElement.clientWidth : document.body.clientWidth;
	var windowY = (document.compatMode =='CSS1Compat' && !window.opera) ? document.documentElement.clientHeight : document.body.clientHeight;
	var left = obj.offsetLeft;
	var top = obj.offsetTop;
	var parent = obj.offsetParent;
	var width = obj.offsetWidth;
	var height = obj.offsetHeight;
	while(parent && parent.tagName != "BODY")
	{
		 left += parent.offsetLeft;
		 top += parent.offsetTop;
		 parent = parent.offsetParent;
	}
	CachObjects['info_popup'].style.display = "block";
	var byleft = ((left + width - CachObjects['info_popup'].offsetWidth + 12) < 0) ? 20 : (left + width - CachObjects['info_popup'].offsetWidth + 12);
	CachObjects['info_popup'].style.left = byleft + "px";
	CachObjects['info_popup'].style.top = (top - 15) + "px";
	ajax_GetContentForPopup(contenttype, parameter, id);
}

function HideInfoPopup()
{
	CachObjects['info_popup'].style.display = "none";
}

// получаем аяксом результат
requests['ajax_GetContentForPopup'] = "";
function ajax_GetContentForPopup(contenttype, parameter, id)
{
	CachObjects['info_container'].innerHTML = '<img src="/images_plastika/wait_b.gif" width="32" height="32" border="0">';
	if (contenttype && (parameter || id))
	{
		if (requests['ajax_GetContentForPopup'])
		{
			requests['ajax_GetContentForPopup'].abort;
		}
		var send = Array();
		send['contenttype'] = contenttype;
		send['parameter'] = parameter;
		send['id'] = id;
		requests['ajax_GetContentForPopup'] = new JsHttpRequest();
		requests['ajax_GetContentForPopup'].onreadystatechange = function()
		{
			CachObjects['info_container'].innerHTML = "";
			if (requests['ajax_GetContentForPopup'].readyState == 4)
			{
				if (requests['ajax_GetContentForPopup'].responseText)
				{
					CachObjects['info_container'].innerHTML += requests['ajax_GetContentForPopup'].responseText;
				}
				CachObjects['info_container'].innerHTML += requests['ajax_GetContentForPopup'].responseJS.answer;
				if (dev_show == 1)
				{
//					CachObjects['ajax_stat'].innerHTML += "<br>ajax_GetContentForPopup\n" + requests['ajax_GetContentForPopup'].responseJS.statistic;
				}
			}
		}
		requests['ajax_GetContentForPopup'].open(null, '/data/templates/serverside/ajax.infopopup.php', true);
		requests['ajax_GetContentForPopup'].send( { query: send } );
	}
}
