// JavaScript Document

function bubbleSetPosition(id,x,y)
{
	if (navigator.appName == 'Microsoft Internet Explorer')
	{
		var tag = document.getElementById(id);
		tag.style.left = tag.offsetLeft + x - Math.round(tag.width/2) + 1;
		tag.style.top = tag.offsetTop + y - Math.round(tag.height/2) + 1;
	}
	else
	{
		document.getElementById(id).style.left = document.getElementById(id).offsetLeft + x + "px";
		document.getElementById(id).style.top = document.getElementById(id).offsetTop + y + "px";
	}
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft;
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop;
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

var bubbleLastImgTag = null;
var bubbleLastTxtTag = null;

function bubbleOver(guid)
{
  if(bubbleLastImgTag != null) bubbleLastImgTag.style.display = 'none';
  if(bubbleLastTxtTag != null) bubbleLastTxtTag.style.display = 'none';

  document.getElementById('bidefault').style.display = 'none';
  document.getElementById('btdefault').style.display = 'none';
  
  bubbleLastImgTag = document.getElementById('bi' + guid);
  bubbleLastTxtTag = document.getElementById('bt' + guid);
  
  bubbleLastImgTag.style.display = 'inline';
  bubbleLastTxtTag.style.display = 'inline';
}

function bubbleOut(guid)
{
  if(bubbleLastImgTag != null) bubbleLastImgTag.style.display = 'none';
  if(bubbleLastTxtTag != null) bubbleLastTxtTag.style.display = 'none';

  bubbleLastImgTag = null;
  bubbleLastTxtTag = null;

  document.getElementById('bi' + guid).style.display = 'inline';
  document.getElementById('bt' + guid).style.display = 'inline';
}