var tm = null;
var cm = null;

function getPos(el,sProp)
{

	var iPos = 0;
	while (el != null)
	{
		iPos += el["offset" + sProp];
		el = el.offsetParent;
	}

	return iPos;
}

function show_sub(el,menu)
{
	var m = document.getElementById('sub_' + menu);
	if (tm) window.clearTimeout(tm);
	m.style.display = 'inline';


	//m.style.left = getPos(el,"Left");
//	m.style.top = getPos(el,"Top") + el.offsetHeight;

	if ((m != cm) && (cm)) cm.style.display = 'none';
	cm = m;
}

function hide_sub(ktore)
{
	var el = document.getElementById('sub_' + ktore);
	el.style.display = 'none';
}

function delay_hide(ktore)
{
	tm = window.setTimeout('hide_sub(' + ktore + ')',500);
}

function clear_timeout()
{
	if (tm) window.clearTimeout(tm);
}



