function show(obj)
{
	if(document.getElementById(obj))
	{
		stoptime();
		document.getElementById(obj).style.visibility="visible";
	}else
	{
		return;
	}
}

function hidetimer(obj){
	hidetime=setTimeout("hide("+obj+")",500)
}

function hide(obj){
	if(document.getElementById(obj))
	{
		document.getElementById(obj).style.visibility="hidden";
	}
}

function stoptime(){
	if (window.hidetime)
	{
		clearTimeout(hidetime)
	}
}

function isParent(parent, child) {
	// modded from Brainjar.com
	while (child.parentNode)
	{
		if ((child = child.parentNode) == parent)
		{
			return true;
		}
	}
	return false;
}

function hidecheck(e,obj){

	if (e.currentTarget!= e.relatedTarget&& !isParent(e.currentTarget, e.relatedTarget))
	{
		hide(obj)
		return;
	}
	try{
		if(!document.getElementById(obj).contains(e.toElement))
		{
			hide(obj)
			return;
		}
	} catch (e) {

	}

}
