function getBreakingNews( fileName ) 
{

	fileName = fileName+".txt";
	xmlhttp=null;
	url = "breakingNews.php?fileName="+fileName;
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest()
	}
	// code for IE
	else if (window.ActiveXObject)
	  {
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	  }

	if (xmlhttp != null)
	  {
	  xmlhttp.onreadystatechange=onResponse4;
	  xmlhttp.open("GET",url,true);
	  xmlhttp.send(null);
	  }
	else
	  {
	  alert("Your browser does not support XMLHTTP.")
	  }
}

function checkReadyState4(obj)
{
  if(obj.readyState == 4)
  {
    if(obj.status == 200)
    {
      return true;
    }
    else
    {
      document.getElementById("breakingNews").innerHTML="Some problem to show the news.";
    }
  }
  else{
	document.getElementById("breakingNews").innerHTML="Loading...";
  }
}


function onResponse4() 
{
	 if(checkReadyState4(xmlhttp)){
		 var data = xmlhttp.responseText;
		 if(data.length > 0){
			// alert(data);
			document.getElementById('br').innerHTML = "<br /><br />";
			document.getElementById('breakingNews').innerHTML = xmlhttp.responseText;
		 }else{
			document.getElementById('breakingNews').innerHTML = "&nbsp;";
		 }
	 }	
} 

