var xx = 0, yy = 0;
var shownId = '';

function getCoord(e)
{
	e = e || event;
	xx = e.clientX;
	yy = e.clientY;
}

function visible(div)
{
	$(div).style.visibility = 'visible';
}

function showFlyMain(value, offsetLeft)
{
	var flydiv = $(value);
	flydiv.style.left = offsetLeft + 'px';
	flydiv.style.visibility = 'visible';
	return;
}


/*
function showFlyMain(value, pvalue, offsetLeft, offsetTop)
{
	if (shownId && (shownId != value)) { hideFly(shownId); }
	shownId = value;
	if (typeof offsetLeft == 'undefined') offsetLeft = 0;
	if (typeof offsetTop == 'undefined') offsetTop = 0;
	var timer = setTimeout('showFly("'+value+'", "'+pvalue+'", "'+offsetLeft+'", "'+offsetTop+'")', 100);
}
*/
function showFly(value, pvalue, offsetLeft, offsetTop)
{
	var flydiv = $(value);
	var flyparent = $(pvalue);
	var x = 0;
	var y = 0;

	while (flyparent.offsetParent)
	{
		x += flyparent.offsetLeft;
		y += flyparent.offsetTop;
		flyparent = flyparent.offsetParent;

	}
		flyparent = $(pvalue);
        var x1 = x - offsetLeft;
		flydiv.style.left = x1 + 'px';
        var y1 = y - offsetTop;
		flydiv.style.top = y1 + 'px';
		flydiv.style.visibility = 'visible';
	return;
}

function hideFly(value)
{
	$(value).style.visibility = 'hidden';
}

