var xmlHttp
///////////////////// ACTUAL XMLHTTP REQUEST - DO NOT TOUCH /////////////////////
////////////////////////////////////////////////////////////////////////////////

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
//////////////// SEND DATA ////////////////////////////////////////////
function loadNews(str)
{
document.getElementById('newsHolder').innerHTML = "Loading...";
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var url="newsItems.php"
url=url+"?sid="+Math.random()
xmlHttp.open("GET",url,true)
xmlHttp.onreadystatechange=activateAjax
xmlHttp.send(null)
}




///////////////////// ACTIVATES AJAX /////////////////////

function activateAjax()
{


		if (xmlHttp.readyState== 4 || xmlHttp.readyState=="complete")
		 {
		 	if (xmlHttp.status == 200)
			{

				document.getElementById('newsHolder').innerHTML= xmlHttp.responseText;
				int();
			}
			else
			{
			document.getElementById('newsHolder').innerHTML= "<b>News is undergoing maintenance...:</b> " + xmlHttp.statusText;
			}
		 }


}

////////////////////////////  SCROLL NEWS //////
///
///

// THIS SETS THE POSITION TO BEGIN WITH //
// 'mainNews' is the DIV to be animated, so change to the appropriate name//

function int(){
document.getElementById('mainNews').style.marginTop = 0 + "px";
animate();
}

// WHERE IT ALL HAPPENS //
function animate()
{
	marginValue = parseInt(document.getElementById('mainNews').style.marginTop);
	heightValue = "-" + document.getElementById('mainNews').offsetHeight;

	if(marginValue > heightValue)
	{
	document.getElementById('mainNews').style.marginTop = marginValue -1  +  "px";
	}
	else
	{
	document.getElementById('mainNews').style.marginTop = 100 + "px";
	}


		// THE TIMER //
		run = setTimeout("animate()", 25);
}

// STOP THE BOX ANIMATING ON ROLL OVER //
function kill(){
clearTimeout(run);
}


