	// Global variables
	xMousePos = 0; // Horizontal position of the mouse on the screen
	yMousePos = 0; // Vertical position of the mouse on the screen
	xMousePosMax = 0; // Width of the page
	yMousePosMax = 0; // Height of the page

	function captureMousePosition(e)
	{
		if (document.layers)
		{
			xMousePos = e.pageX;
			yMousePos = e.pageY;
			xMousePosMax = window.innerWidth+window.pageXOffset;
			yMousePosMax = window.innerHeight+window.pageYOffset;
		}
		else if (document.all)
		{
			xMousePos = window.event.x+document.body.scrollLeft;
			yMousePos = window.event.y+document.body.scrollTop;
			xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
			yMousePosMax = document.body.clientHeight+document.body.scrollTop;
		}
		else if (document.getElementById)
		{
			xMousePos = e.pageX;
			yMousePos = e.pageY;
			xMousePosMax = window.innerWidth+window.pageXOffset;
			yMousePosMax = window.innerHeight+window.pageYOffset;
		}
	}

	if (document.layers)
	{
		// Netscape
		document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = captureMousePosition;
	}
	else if (document.all)
	{
		// Internet Explorer
		document.onmousemove = captureMousePosition;
	}
	else if (document.getElementById)
	{
		// Netcsape 6
		document.onmousemove = captureMousePosition;
	}

	function pausecomp(Amount)
	{
		d = new Date() //today's date
		while (1)
		{
			mill=new Date() // Date Now
			diff = mill-d //difference in milliseconds
			if( diff > Amount ) {break;}
		}
	}

	function getAbsoluteLeft(o)
	{
		oLeft = o.offsetLeft
		while(o.offsetParent!=null)
		{
			oParent = o.offsetParent
			oLeft += oParent.offsetLeft
			o = oParent
		}
		return oLeft
	}

	function getAbsoluteTop(o)
	{
		oTop = o.offsetTop
		while(o.offsetParent!=null)
		{
			oParent = o.offsetParent
			oTop += oParent.offsetTop
			o = oParent
		}
		return oTop
	}

	function showMessageBox(html)
	{
		document.getElementById('MessageBoxP').innerHTML = html
		document.getElementById('MessageBox').style.visibility = 'visible';
		document.getElementById('MessageBox').style.left =  parseInt((GetBrowserWidth() / 2) - (document.getElementById('MessageBox').style.width / 2));
		//moveMessageBox();
	}

	function moveMessageBox()
	{
		if (document.getElementById('MessageBox').style.visibility == 'visible')
		{
			var msg = document.getElementById('MessageBox')
			msg.style.left = xMousePos
			msg.style.top = yMousePos + 15

			while((parseInt(msg.style.left.replace('px','')) + parseInt(msg.offsetWidth)) > xMousePosMax)
			{
				msg.style.left = parseInt(msg.style.left) - 1;
			}
			while((parseInt(msg.style.top.replace('px','')) + parseInt(msg.offsetHeight)) > yMousePosMax)
			{
				msg.style.top = parseInt(msg.style.top) - 1;
			}

			window.setTimeout('moveMessageBox()', 10);
		}
	}

	function GetBrowserWidth()
	{
		if(typeof(window.innerWidth) == 'number')
		{
			//Non-IE
			return window.innerWidth;
		}
		else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
		{
			//IE 6+ in 'standards compliant mode'
			return document.documentElement.clientWidth;
		}
		else if(document.body && (document.body.clientWidth || document.body.clientHeight))
		{
			//IE 4 compatible
			return document.body.clientWidth;
		}
	}

	function GetBrowserHeight()
	{
		if(typeof( window.innerWidth ) == 'number')
		{
			//Non-IE
			return window.innerHeight;
		}
		else if( document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
		{
			//IE 6+ in 'standards compliant mode'
			return document.documentElement.clientHeight;
		}
		else if(document.body && (document.body.clientWidth || document.body.clientHeight))
		{
			//IE 4 compatible
			return document.body.clientHeight;
		}
	}
	
	function ietruebody()
	{
		return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	}


	function showSpanCentre(id)
	{
		var O;
		O = document.getElementById(id)
		O.style.visibility = 'visible';
		O.style.left =  parseInt((GetBrowserWidth() - 300) / 2);

		//window.setTimeout('centreSpan(' + id + ')', 10);
		//closeSpan(id);
		//alertText(id);
		window.setTimeout('closeSpan(document.getElementById(\'' + id + '\'))', 5000);		
	}

	function showSpanAtMouse(id)
	{
		var O;
		O = document.getElementById(id)
		O.style.visibility = 'visible';
		O.style.left =  parseInt(xMousePos);
		O.style.top =  parseInt(yMousePos);
	}
	
	function showSpanAtLeft(id)
	{
		var O;
		var t;
		
		t = (window.pageYOffset)? pageYOffset : ietruebody().scrollTop;

		O = document.getElementById(id)
		O.style.visibility = 'visible';
		O.style.left =  10;
		O.style.top =  parseInt(t) + 10;
	}

	function centreSpan(id)
	{
		var O;
		O = document.getElementById(id)
		if(O.style.visibility == 'visible')
		{
			O.style.left =  parseInt((GetBrowserWidth() - 300) / 2);
			window.setTimeout('centreSpan()', 10);
		}
	}
	
	function closeSpan(O)
	{
		//var O;
		//O = document.getElementById(id);
		O.style.visibility = 'hidden';
	}
	
	function alertText(text)
	{
		alert('3' + text);
	}

	function showBox()
	{
		showOCMessage();
	}