function createXMLHttpRequest( cbFunc )
{
	var XMLhttpObject = null;

	try
	{
		XMLhttpObject = new XMLHttpRequest();
	}
	catch( e )
	{
		try
		{
			XMLhttpObject = new ActiveXObject( "Msxml2.XMLHTTP" );
		}
		catch( e )
		{
			try
			{
				XMLhttpObject = new ActiveXObject( "Microsoft.XMLHTTP" );
			}
			catch( e )
			{
				return null;
			}
		}
	}

	if( XMLhttpObject )
	{
		XMLhttpObject.onreadystatechange = cbFunc;
	}

	return XMLhttpObject;
}

head = '<table class="border" cellspacing="1"><tr class="body"><td nowrap><tt>';
foot = '</tt></td></tr></table>';
x = 0;
y = 0;

function displayData()
{
	var txt = null;

	if( ( httpObj.readyState == 4 ) && ( httpObj.status == 200 ) )
	{
		txt = httpObj.responseText;

		if( txt.length <= 10 )
		{
			return;
		}

		id = document.getElementById( 'slope' );
		id.innerHTML = head + txt + foot;
		id.style.left = x;
		id.style.top = y;
		id.style.visibility = "visible";
	}
}

function popup( i, ev )
{
	if( document.all )
	{
		var body = ( document.compatMode == 'CSS1Compat' ) ? document.documentElement : document.body;
		x = body.scrollLeft + event.clientX;
		y = body.scrollTop + event.clientY;
	}
	else if( document.getElementById )
	{
		x = ev.pageX;
		y = ev.pageY;
	}
	else
	{
		return;
	}

	x = x + 10;
	y = y - 5;

	httpObj = createXMLHttpRequest( displayData );
	if( httpObj )
	{
		httpObj.open( "GET", "../slope.php?id=" + i, true );
		httpObj.send( null );
	}
}

function hidepop()
{
	id = document.getElementById( 'slope' );
	id.style.visibility = "hidden";
}

