
// ----- Show Aux -----

function at_show_aux(parent,child,position)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child );

  var top  = (position == "y") ? p.offsetHeight+2 : 0;
  var left = (position == "x") ? p.offsetWidth +2 : 0;

  for (; p; p = p.offsetParent)
  {
    top  += p.offsetTop;
    left += p.offsetLeft;
  }

  c.style.position   = "absolute";
  c.style.top        = top +'px';
  c.style.left       = left+'px';
  c.style.visibility = "visible";
}

// ----- Show -----

function at_show(parent,child,position)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child);

  at_show_aux(p.id, c.id, position);

  clearTimeout(c["at_timeout"]);
}

// ----- Hide -----

function at_hide(child)
{
  var c = document.getElementById(child);

  c["at_timeout"] = setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'", 333);
}

function at_attach(parent, child, showtype, position, cursor)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child);
  c.style.position   = "absolute";
  c.style.visibility = "hidden";

  if (cursor != undefined) p.style.cursor = cursor;

}
