function Tooltip()
{
	this.load();
}
Tooltip.prototype.load = function()
{
	aSpan = document.getElementsByTagName( 'SPAN' );
	for( var i = 0; i < aSpan.length; i++ )
	{
		if( aSpan[ i ].className.match( 'tooltip' ) )
			this.engage( aSpan[ i ] );
	}
}
Tooltip.prototype.engage = function( oElement )
{
	oElement._parent = this;
	oElement.onmouseover = function()
	{
		if( this.getAttribute( 'tooltip' ) != null )
		{
			var pos = this._parent.findPos( this );
			var tooltip = document.getElementById( 'tooltip' + this.getAttribute( 'tooltip' ) );
			tooltip.style.top = pos[ 1 ] + 'px';
			tooltip.style.left = (pos[ 0 ] - 180) + 'px';
		}
	}
	oElement.onmouseout = function()
	{
		this.style.zIndex = 0;
		if( this.getAttribute( 'tooltip' ) != null )
		{
			var tooltip = document.getElementById( 'tooltip' + this.getAttribute( 'tooltip' ) );
			tooltip.style.left = '-1000px';
			tooltip.style.top = '-1000px';
		}
	}
}
Tooltip.prototype.findPos = function( obj )
{
	var curleft = curtop = 0;
	if( obj.offsetParent )
	{
		do
		{
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
		while( obj = obj.offsetParent );
		
		return [curleft, curtop];
	}
}
