var dfgtip;
var tipid;
var tipshown;

function showTip(id, text, link)
{
	if (tipshown && (id==tipid)) return;
	if (!dfgtip) buildDFGTip();
	if (id==0) // shown from overlay itself
	{
		dfgtip.style.display = 'block';
		return;
	}
	dfgtip.style.position = 'absolute';
	dfgtip.innerHTML = text;
	dfgtip.style.left = (getLeftPos(link) + 70) + 'px';
	tipshown = true;
	tipid = id;
	dfgtip.style.display = 'block';
	//dfgtip.style.top = (getTopPos(link) - dfgtip.offsetHeight) + 'px';
	dfgtip.style.top = (getTopPos(link) + 30) + 'px';
}

function hideTip()
{
	if (dfgtip) dfgtip.style.display = 'none';
	tipid = 0;
	tipshown = false;
}

function buildDFGTip()
{
	dfgtip = document.createElement('DIV');
	dfgtip.id = 'dfgtip';
	dfgtip.style.display = 'none';
	dfgtip.onmouseover = function() {
		showTip(0, '', '');
	}
	dfgtip.onmouseout = function() {
		hideTip();
	}
	document.body.appendChild(dfgtip);
}
