﻿
function showPopupBlock(srcElement, blockId, align0, align1)
{
	var left = 0;
	var top = 0;
	for(var el = srcElement; el != null; el = el.offsetParent) 
	{
		left += el.offsetLeft;
		top += el.offsetTop;
	}
	var block = document.getElementById(blockId);
	block.style.display = "block";
	block.style.left = left + (align0 == "right" || align1 == "right" ? (srcElement.offsetWidth - block.clientWidth) : 0);
	block.style.top = top + (align0 == "bottom" || align1 == "bottom" ? srcElement.offsetHeight : 0);
}

function hidePopupBlock(srcElement, blockId)
{
	var block = document.getElementById(blockId);
	block.style.display = "none";
}


