// Tooltips
var ToolTip = {
	tt_display : null,
	tt_text : null,

	init : function(obj)
	{
		var __this = this;
		if (!obj) return;

		// Loop over all objects
		for (var i=0; i<obj.childNodes.length; i++)
		{
			var child = obj.childNodes[i];

			// Check for tooltip
			if (child.getAttribute && child.getAttribute("tooltip"))
			{
				child.onmouseover = function(ev) { __this.showToolTip(this, ev); };
				child.onmouseout = function(ev) { __this.hideToolTip(ev); };
			}
			else
			{
				this.init(child);
			}
		}
	},

	showToolTip : function(obj)
	{
		this.__create_display();

		// Set text
		var text = obj.getAttribute("tooltip");
		this.tt_display.innerHTML = text;

		// Set position
		var pos = getObjectPosition(obj);
		this.tt_display.style.left = Math.round(pos.x + obj.offsetWidth) + "px";
		this.tt_display.style.top = (pos.y + obj.offsetHeight) + "px";

		// Show
		this.tt_display.style.display = "block";
	},

	hideToolTip : function()
	{
		this.tt_display.style.display = "none";
	},


	__create_display : function()
	{
		if (!this.tt_display)
		{
			this.tt_display = document.createElement("DIV");
			this.tt_display.className = "tt_display";
			document.body.appendChild(this.tt_display);
		}
	}
}
loader.register("ToolTip.init(document.body); ");