BubbleStageId = "eventBubbleStage";
BubbleHideTimer = "";


function showEventInfo(e, bubbleDiv)
	{
	if (BubbleHideTimer != "")
		{
		window.clearTimeout(BubbleHideTimer);
		execHideEventBubble();
		}
	
	bubbleID = "eventinfo" + bubbleDiv;
	document.getElementById("eventBubbleContent").innerHTML = document.getElementById(bubbleID).innerHTML;
	document.getElementById(BubbleStageId).style.display = "block";

	MsX = e.clientX;
	MsY = e.clientY;

	processBubbleStageId(MsX, MsY)
	
	BubbleHideTimer = window.setTimeout("execHideEventBubble()", 3000);
	}


function keepEventInfo()
	{
	if (BubbleHideTimer != "")
		{
		window.clearTimeout(BubbleHideTimer);
		}
	}


function hideEventInfo(bubbleDiv)
	{
	if (BubbleHideTimer != "")
		{
		window.clearTimeout(BubbleHideTimer);
		}
	BubbleHideTimer = window.setTimeout("execHideEventBubble()", 300);
	}


function execHideEventBubble()
	{
	document.getElementById("eventBubbleContent").innerHTML = "&nbsp;";
	document.getElementById(BubbleStageId).style.left = "-2000px";
	document.getElementById(BubbleStageId).style.display = "none";
	}


function processBubbleStageId(PosX, PosY)
	{
	BubbleStageIdHeight = parseInt(document.getElementById(BubbleStageId).offsetHeight, 0);
	BubbleStageIdWidth = parseInt(document.getElementById(BubbleStageId).offsetWidth, 0);

	if (window.innerHeight)
		{
		WindowInnerWidth = window.innerWidth; 
		WindowInnerHeight = window.innerHeight;
		}
	else if (document.documentElement && document.documentElement.clientHeight)
		{
		WindowInnerWidth = document.documentElement.clientWidth;
		WindowInnerHeight = document.documentElement.clientHeight;
		}
	else if (document.body)
		{
		WindowInnerWidth = document.body.clientWidth; 
		WindowInnerHeight = document.body.clientHeight;
		}

	ToolTipPosX = PosX - 70;
	ToolTipPosY = PosY - BubbleStageIdHeight - 5; 

/*
	if( (ToolTipPosY + BubbleStageIdHeight) > WindowInnerHeight )
		{
		if( (PosY - 5 - BubbleStageIdHeight) > 0 ) 
			{ ToolTipPosY = PosY - 5 - BubbleStageIdHeight; }
		}

	if( (ToolTipPosX + BubbleStageIdWidth) > WindowInnerWidth )
		{
		if ( (PosX  - BubbleStageIdWidth) > 0)
			{ ToolTipPosX = PosX  - BubbleStageIdWidth; }
		}
*/

	document.getElementById(BubbleStageId).style.top = ToolTipPosY + "px";
	document.getElementById(BubbleStageId).style.left = ToolTipPosX + "px";
	}
