function getEl (id) {
	return document.getElementById(id);
}

function getEl (id) {
	return document.getElementById(id);
}

function getAbsX(elt) 
{ 
	return (elt.x) ? elt.x : getAbsPos(elt,"Left"); 
}

function getAbsY(elt) 
{ 
	return (elt.y) ? elt.y : getAbsPos(elt,"Top"); 
}

function getAbsPos(elt,which) 
{
    iPos = 0;
    while (elt != null) 
    {
        iPos += elt["offset" + which];
        elt = elt.offsetParent;
    }
    return iPos;
}

function showInfo(elm,text){
  var infobox = getEl('infobox');
  if(text!=''){
    infobox.innerHTML=text;
    infobox.style.display='block';
    //infobox.style.left=getAbsX(elm) - infobox.offsetWidth + "px";
    infobox.style.left=getAbsX(elm) + "px";
    var max_bottom = document.body.clientHeight+document.body.scrollTop;
    var posy = getAbsY(elm) - infobox.offsetHeight;
    if(max_bottom<(posy+infobox.offsetHeight-13))
      infobox.style.top=getAbsY(elm) - infobox.offsetHeight - 13 + "px";
    else
      infobox.style.top=posy + "px";
  }
}

function hideInfo(){
  var infobox = getEl('infobox');
  infobox.style.display='none';
}

