Tooltip = function( el, image ) {
	try
	{
		this.tooltip = document.getElementById( 'tooltip' );
		if( !this.tooltip ) return;

		this.offX = 0;
		this.offY = -10;
		
		el.tooltip = this;
		el.onmousemove = mousemoveHandler;
		
		if( image )
		{
			this.tooltip.getElementsByTagName( 'img' )[0].src = image;
		}
		toggleFormElements( 'hidden' );
		this.tooltip.style.display = 'block';
		this.tooltipWidth = this.tooltip.clientWidth;
		this.tooltipHeight = this.tooltip.clientHeight;
		
		el.onmouseout = mouseoutHandler;
		
		return this;
	}
	catch( e )
	{
		return;
	}
}

function mousemoveHandler( e )
{
	/*
	if ( !e ) var e = window.event;
	this.tooltip.tooltip.style.left = ( parseInt( mouseX( e ) ) + this.tooltip.offX - parseInt( this.tooltip.tooltipWidth / 2 ) ) + 'px';
	this.tooltip.tooltip.style.top = ( parseInt( mouseY ( e ) ) + this.tooltip.offY - this.tooltip.tooltipHeight ) + 'px';
	*/
}

function mouseoutHandler( e )
{
	clearTimeout( this.timer );
	toggleFormElements( 'visible' );
	this.onmousemove = null;
	this.tooltip.tooltip.style.display = 'none';
	//this.tooltip.tooltip.style.left = this.tooltip.tooltip.style.top = '-9999px';
	this.tooltip = null;
	this.onmouseout = null;
}

function mouseX( e )
{
	if ( !e ) var e = window.event;
	if ( e.pageX )
	{
		return e.pageX;
	}
	else if ( e.clientX )
	{
		return e.clientX + ( document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft );
	}
	else
	{
		return 0;
	}
}

function mouseY( e )
{
	if ( !e ) var e = window.event;
	if ( e.pageY )
	{
		return e.pageY;
	}
	else if ( e.clientY )
	{
		return e.clientY + ( document.documentElement.scrollTop ?  document.documentElement.scrollTop : document.body.scrollTop );
	}
	else
	{
		return 0;
	}
}

function toggleFormElements( property )
{
	try
	{
		var selects = document.getElementsByTagName( 'select' );
		for( var i = 0; i < selects.length; i++ )
		{
			selects[ i ].style.visibility = property;
		}
	}
	catch( e )
	{
		return;
	}
}