<!--

var timer;
var popup;

function getTop(element)
{
	var result = element.offsetTop;
 
	while(element = element.offsetParent)
		result += element.offsetTop;
	
	return result;
}

function getBottom(element)
{
	return element.offsetHeight + getTop(element);
}
    
function getLeft(element)
{
	var result = element.offsetLeft;
  
	while(element = element.offsetParent)
		result += element.offsetLeft;
   
	return result;
}

//function ClearBubbles()
//{
//    if (window.event)
//    {
//        event.cancelBubble = true;
//        event.returnValue = false;
//    }
//    else
//    {
//        e.preventDefault();
//        e.stopPropagation();
//    }

//    return false;
//}

function HideNow()
{
    if (undefined == popup || null == popup)
		return;
		
    popup.style.visibility = 'hidden';
    popup.style.left = '0px';
    popup.style.top = '0px';
    popup = null;
}

function Hide()
{
	if (undefined == popup || null == popup)
		return;
	
	timer = window.setTimeout(function() { HideNow(); }, 250);
}

function Popup(owner, popupId)
{
	if (undefined != timer && null != timer)
		window.clearTimeout(timer);
	
	var curPopup = document.getElementById(popupId);

	if(undefined == curPopup || null == curPopup)
		return;
		
	if (undefined != popup && null != popup)
		if (popup == curPopup)
			return;
		else
		{
              popup.style.visibility = 'hidden';
              popup.style.left = '0px';
	        popup.style.top = '0px';
	    }
			
	curPopup.style.left = getLeft(owner) + 'px';
	curPopup.style.top = getBottom(owner) + 'px';

	if (null != curPopup.filters && null != curPopup.filters[0])
		curPopup.filters[0].apply();
		
	curPopup.style.visibility = 'visible';
	
	if (null != curPopup.filters && null != curPopup.filters[0])
		curPopup.filters[0].play();
		
	popup = curPopup;
}

function Show()
{
    if (undefined != timer && null != timer)
		window.clearTimeout(timer);
}

// -->