function jsBaloonShow( div_id, from_elem, offset_x, offset_y )
{
	popUp = document.getElementById(div_id);

	if (from_elem == null)
	{
		popUp.style.left = 20 + "px";
		popUp.style.top = document.documentElement.scrollTop + 20 + "px";
		popUp.style.width = getClientWidth() - 40 + "px";
		popUp.style.height = getClientHeight() - 40 + "px";
	}
	else
	{
		var pos = getElementPos(from_elem);
		popUp.style.left = pos.x + offset_x + "px";
		popUp.style.top = pos.y + offset_y + "px";
	}
	
	popUp.className = "popup_show";
}

function jsBaloonHide( div_id )
{
	popUp = document.getElementById(div_id);
	popUp.className = "popup_hide";
}

function jsBaloonShowHide( div_id, from_elem, offset_x, offset_y )
{
	popUp = document.getElementById(div_id);
	if (popUp.className == "popup_hide")
		jsBaloonShow(div_id, from_elem, offset_x, offset_y);
	else
		jsBaloonHide(div_id);
}

reload_num = 1;
function jsPopUpLoad( url, cell_id )
{
	url = url.split("%num%").join("reload_num=" + reload_num);
	reload_num++;
	if (document.getElementById("popup_status_" + cell_id))
		document.getElementById("popup_status_" + cell_id).innerHTML = '<FONT color="#FF0000"><B>Loading...</B></FONT>';
	jsUpdateCell(url + '&rnd=' + Math.random());
}
