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 loadAjax(str)
{
	document.getElementById('ajaxHolder').innerHTML = "Loading...";
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
	 return
}
	// var url="newsItems.html"
	var url=str;
	// 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('ajaxHolder').innerHTML= xmlHttp.responseText;
				int();
			}
			else
			{
			document.getElementById('ajaxHolder').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('mainAjax').style.marginTop = 0 + "px";
	animate();
	}

// WHERE IT ALL HAPPENS //
function animate()
{
	marginValue = parseInt(document.getElementById('mainAjax').style.marginTop);
	heightValue = "-" + document.getElementById('mainAjax').offsetHeight;

	if(marginValue > heightValue)
	{
	document.getElementById('mainAjax').style.marginTop = marginValue -1  +  "px";
	}
	else
	{
	document.getElementById('mainAjax').style.marginTop = 100 + "px";
	}
		// THE TIMER //
		run = setTimeout("animate()", 25);
}

// STOP THE BOX ANIMATING ON ROLL OVER //
function kill(){
	clearTimeout(run);
}


