var popup_timer;
var timeout = 200;

function e_stoptimer() {
  clearTimeout(popup_timer);
}

function e_popup( posobj, objname, text ) {
  e_stoptimer();
  obj = document.getElementById(objname);
  with( obj.style ) {
    visibility = "visible";
  }
  obj.style.left = findPosX(posobj) + "px";
  obj.style.top = findPosY(posobj) + objHeight(posobj) +"px";

  obj.innerHTML = text;
}

function e_clearpopup( obj ) {
  obj.style.visibility = "hidden";
}

function e_unpopup( objname ) {
  obj = document.getElementById(objname);
  popup_timer = setTimeout('e_clearpopup(obj);',timeout);  
}

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;
}

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 objWidth(objectID) {
  var obj = document.getElementById(objectID);
  if(obj.offsetWidth) 
    return obj.offsetWidth;
  if (obj.clip) 
    return obj.clip.width;
   return 0;
}

function objHeight(obj) {
  if(obj.offsetHeight) 
    return obj.offsetHeight;
  if (obj.clip) 
    return obj.clip.height;
  return 0;
}

function objLeft(objectID) {
  var obj = document.getElementById(objectID);  
  if(objs.left) 
    return objs.left;
  if(objs.pixelLeft) 
    return objs.pixelLeft;
  if(obj.offsetLeft) 
    return obj.offsetLeft;
  return 0;
}

function objTop(objectID) {  
  var obj = xDOM(objectID,0);
  var objs = xDOM(objectID,1);
  if(objs.top) 
   return objs.top;
  if(objs.pixelTop) 
    return objs.pixelTop;
  if(obj.offsetTop) 
    return obj.offsetTop;
  return 0;
}

function objRight(objectID) {  
  return  objLeft(objectID)+objWidth(objectID);
}

function objBottom(objectID) {  
  return  objTop(objectID)+objHeight(objectID);
}