function $(id){ return document.getElementById(id);}
var x = y = 0;
function at_attach(parent, child, showtype, cursor){
	var p = $(parent);
	var c = $(child);
	
	p["parent"]     = p.id;
	c["parent"]     = p.id;
	p["child"]      = c.id;
	c["child"]      = c.id;
	
	c.style.position   = "absolute";
	c.style.visibility = "hidden";
	if (cursor != undefined) p.style.cursor = cursor;
	switch (showtype){
		case "click":
			p.onclick     = at_click;
			p.onmouseout  = at_hide;
			c.onmouseover = at_show;
			c.onmouseout  = at_hide;
		break;
		case "hover":
			p.onmouseover = at_show;
			p.onmouseout  = at_hide;
			c.onmouseover = at_show;
			c.onmouseout  = at_hide;
		break;
	}
}
function at_show()
{
	var p = $(this["parent"]);
	var c = $(this["child"]);
	show(c.id);
	clearTimeout(c["timeout"]);
}
function at_hide()
{
	var p = $(this["parent"]);
	var c = $(this["child"]);
	c["timeout"] = setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'", 700);
}
function at_click(e)
{
	var p = $(this["parent"]);
	var c = $(this["child"]);
	if (c.style.visibility != "visible"){
		var posx = posy = 0;
		if (!e) e = window.event;
		if (e.pageX || e.pageY) 	{
			posx = e.pageX;
			posy = e.pageY;
		}
		else if (e.clientX || e.clientY) 	{
			posx = e.clientX + document.body.scrollLeft
				+ document.documentElement.scrollLeft;
			posy = e.clientY + document.body.scrollTop
				+ document.documentElement.scrollTop;
		}
		x = posx;
		y = posy;
		show(c.id);
	}else c.style.visibility = "hidden";
  return false;
}
function show(ch)
{
	var c = $(ch);
	c.style.position   = "absolute";
	c.style.left       = x + 'px';
	c.style.top        = y + 'px';
	c.style.visibility = "visible";
}