var newsPopup =
{

	open : function( triggerNode, boxIdName )
	{

		var current = document.DE_toxA_floater;
		if ( current )
			if ( current[0] == boxIdName )
			{
				newsPopup.hide();
				return;
			}


		newsPopup.hide();


		var body = document.getElementsByTagName( 'BODY' );
		if ( !body )
			return;

		var area = document.getElementById( 'floatable-area' );
		if ( !area )
			return;

		var original = document.getElementById( boxIdName );
		if ( !original )
			return;

		var box = original.cloneNode( true );
		if ( !box )
			return;



		area.style.visibility = 'hidden';
/*
		var headlines = area.getElementsByTagName( 'H1' );

		for ( var i = 0; i < headlines.length; i++ )
			headlines[i].style.visibility = 'hidden';
*/


		var dim = newsPopup.getDim( area );


		var container = area.parentNode;
		while ( container )
		{

			if ( container.className.substr( 0, 10 ) == 'middle out' )
				break;

			container = container.parentNode;

		}

		if ( container )
		{

			var containerDim = newsPopup.getDim( container );

			dim.height = containerDim.top + containerDim.height - dim.top;

		}
		else if ( dim.height < 300 )
			dim.height = 300;


		dim.top    += 29;
		dim.height -= 29;


		box.style.position   = 'absolute';
		box.style.top        = dim.top + 'px';
		box.style.left       = dim.left + 'px';
		box.style.width      = dim.width + 'px';
		box.style.height     = dim.height + 'px';
		box.style.display    = 'block';

		box = body[0].appendChild( box );

		if ( box )
//			document.DE_toxA_floater = [ boxIdName, box, headlines ];
			document.DE_toxA_floater = [ boxIdName, box, [ area ] ];

//		triggerNode.blur();

	},

	hide : function()
	{
		if ( document.DE_toxA_floater )
		{
			document.DE_toxA_floater[1].parentNode.removeChild( document.DE_toxA_floater[1] );

			for ( var i = 0; i < document.DE_toxA_floater[2].length; i++ )
				document.DE_toxA_floater[2][i].style.visibility = 'visible';

			document.DE_toxA_floater = null;

		}
	},

	getDim : function( node )
	{

		if ( !node )
			return {
						top    : 0,
						left   : 0,
						width  : 0,
						height : 0
					};

		result = newsPopup.getDim( node.offsetParent );

		result.top  += node.offsetTop;
		result.left += node.offsetLeft;

		result.width  = node.offsetWidth;
		result.height = node.offsetHeight;

		return result;


	}

};
