function showTAGS(myurl, mydiv, myquery)
{
	if ( $('showtags'+mydiv).visible() )
	{
		new Effect.BlindUp('showtags'+mydiv, {duration: 0.3});
		$('showtagspic'+mydiv).src='/images/1x1.gif';
		$('showtagspic'+mydiv).style.margin="0px";
		return true;
	} else {
		$('showtagspic'+mydiv).src='/images/plus-minus.gif';
		$('showtagspic'+mydiv).style.margin="0px 4px 0px 0px";
		var opt =	{	method: 'post',
						postBody: 'url='+myurl+'&query='+myquery,
						onComplete: function(myrequest)
						{
							new Effect.BlindDown('showtags'+mydiv, {duration: 0.3});
							$('showtagspic'+mydiv).src='/images/minus.gif';
						}
					};
		new Ajax.Updater( {success:'showtags'+mydiv}, '/include/func/ajax_showtags.php', opt);
	}
}

function showBox(myid)
{
	if ( $(myid).visible() )
	{
		new Effect.BlindUp(myid, {duration: 0.3});
		return true;
	} else {
		new Effect.BlindDown(myid, {duration: 0.3});
		return true;
	}
}

/* Bubble Tooltips http://web-graphics.com */
function enableTooltips(id)
{
 	if(!document.getElementById || !document.getElementsByTagName) return;

	var h = document.createElement("span");
	h.id = "btc";
	h.setAttribute("id","btc");
	h.style.position = "absolute";

	document.getElementsByTagName("body")[0].appendChild(h);

	if		(id==null)	var links = document.getElementsByTagName("a");
	else				var links = document.getElementById(id).getElementsByTagName("a");

	for(var i=0;i<links.length;i++)
	{
		var title	= links[i].getAttribute("mytitle");
		var desc	= links[i].getAttribute("desc");

		if(title!=null && title.length>0)
		{
			var tooltip = CreateEl("span","tooltip");

			var a = CreateEl("span","top");
			a.appendChild(document.createTextNode(title));
			tooltip.appendChild(a);

			var b = CreateEl("span","content");
			b.innerHTML = desc;
			tooltip.appendChild(b);

			links[i].tooltip		= tooltip;
			links[i].onmouseover	= showTooltip;
			links[i].onmouseout		= hideTooltip;
			links[i].onmousemove	= Locate;
		}
	}
}

function CreateEl(t,c)
{
	var x=document.createElement(t);
	x.className=c;
	x.style.display="block";
	return(x);
}

function showTooltip(e)
{
	document.getElementById("btc").appendChild(this.tooltip);
	Locate(e);
}

function hideTooltip(e)
{
	var d=document.getElementById("btc");
	if(d.childNodes.length>0) d.removeChild(d.firstChild);
}


function Locate(e)
{
	var posx=0,posy=0;
	if(e==null) e=window.event;
	if(e.pageX || e.pageY)
	{
	    posx=e.pageX; posy=e.pageY;
	}
	else if(e.clientX || e.clientY)
	{
	    if(document.documentElement.scrollTop)
		{
	        posx=e.clientX+document.documentElement.scrollLeft;
	        posy=e.clientY+document.documentElement.scrollTop;
	    }
	    else
		{
	        posx=e.clientX+document.body.scrollLeft;
	        posy=e.clientY+document.body.scrollTop;
	    }
	}
	document.getElementById("btc").style.top=(posy+10)+"px";
	document.getElementById("btc").style.left=(posx-20)+"px";
}