
/*****************************************************************************************
 *
 */
 function showInfo( self, txt)
{
	var info= document.getElementById( "INFO");
	if( info){
		document.body.removeChild( info);
	}else
	if( txt.length){
		var div= document.createElement( "DIV");
		div.setAttribute( "id", "INFO");
		div.setAttribute( "class", "INFO");
		div.innerHTML= txt;
		
		var close= document.createElement("img");
		close.setAttribute("src", "img/close.gif");
		close.setAttribute("style", "position:absolute; top:-9px; right:-13px;");
		close.setAttribute("onclick", "showInfo( null, '');");
		div.appendChild( close);

		var p= getPosition( self);
		document.body.appendChild( div);
		
		var l= (self.x-div.offsetWidth/2);
		if( l < 25)
			l= 25;
		var t= (self.y+self.height);
		if( t < 50)
			t= 50;
		div.setAttribute( "style", "left:"+l+"px;top:"+t+"px;");
		//div.setAttribute( "style", "left:"+(p.x-div.offsetWidth)+"px;top:"+p.y+"px;");
	}
}

/*****************************************************************************************
*
*/
function ItemPos( x, y)
{
	this.x= 0;
	this.y= 0;

	if( !isNaN(x))
		this.x= x;

	if( !isNaN(y))
		this.y= y;
}

/*****************************************************************************************
*
*/
function getPosition( node)
{
	var pos= new ItemPos( 0, 0);

	if( node){
		pos= new ItemPos( node.offsetLeft, node.offsetTop);
		if( node.parentNode){
			if( node.nodeName.toUpperCase() != "TABLE"){
					var p= getPosition( node.parentNode);
					pos.x+= p.x;
					pos.y+= p.y;
			}
		}
	}
	return pos;
}
