
	function cleverPriceTooltip ( parentID, elementID )
	{
		this.parentElement	= document.getElementById ( parentID );
		this.element		= document.getElementById ( elementID );
		this.timeout		= null;
	}
	
	cleverPriceTooltip.prototype.show = function( element )
	{
		if ( this.timeout )
			window.clearTimeout( this.timeout );

		var cpTooltip	= this;
		this.timeout	= window.setTimeout( function() { cpTooltip.doShow ( element ); }, 500 );
	};
	
	cleverPriceTooltip.prototype.doShow = function ( element )
	{
		this.timeout = null;
		
		if ( ! this.element || ! this.parentElement )
			return false;
		
		var curLeft = curTop = 0;
		var width = element.offsetWidth;
		
		if ( element.offsetParent )
			do
			{
				curLeft	+= element.offsetLeft;
				curTop	+= element.offsetTop;
				
				element = element.offsetParent;
			}
			while ( element && ( element !== this.parentElement ) );
			
		this.element.style.display	= 'block';
		this.element.style.top		= curTop + 'px';
		this.element.style.left		= ( curLeft + width ) + 'px';
		
		return true;
	};
	
	cleverPriceTooltip.prototype.hide = function()
	{
		if ( ! this.element )
			return false;
			
		this.element.style.display = 'none';
		
		if ( this.timeout != null )
			window.clearTimeout ( this.timeout );
		
		return true;
	};
	
