var popUpTimer;
var currentBubble = "";

function showClassPopUp(imgAnchor, whichLayer){
	clearTimeout(popUpTimer);
	
	var theImage = document.getElementById(imgAnchor);
	var theLayer = document.getElementById(whichLayer);
	theLayer.style.left = findPosX(theImage) + "px";
	theLayer.style.top = (findPosY(theImage) - 33) + "px";
	
	if(currentBubble!=""){
		hideClassPopUp(currentBubble);
	}
	currentBubble = whichLayer;
	
	document.getElementById(whichLayer).style.display = "block";

}


function hideClassPopUpHandler(whichLayer){
	popUpTimer = setTimeout('hideClassPopUp(\'' + whichLayer + '\')', 1000);
}

function disablePopUpTimer(){
	clearTimeout(popUpTimer);
}

function hideClassPopUp(whichLayer){
	var theLayer = document.getElementById(whichLayer);
	document.getElementById(whichLayer).style.display = "none";
}

function findPosX(obj)
  {
	var curleft = 0;
	if(obj.offsetParent)
		while(1) 
		{
		  curleft += obj.offsetLeft;
		  if(!obj.offsetParent)
			break;
		  obj = obj.offsetParent;
		}
	else if(obj.x)
		curleft += obj.x;
	return curleft;
  }

  function findPosY(obj)
  {
	var curtop = 0;
	if(obj.offsetParent)
		while(1)
		{
		  curtop += obj.offsetTop;
		  if(!obj.offsetParent)
			break;
		  obj = obj.offsetParent;
		}
	else if(obj.y)
		curtop += obj.y;
	return curtop;
  }	