var xmlHttp
//
function showrotnews() // function to display clients info
{ 
xmlHttp=GetXmlHttpObject() // opening the xmlHttpObject
var url="rotatingnews.php" //this code sends the query string to clients.php
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true) // method of sending data. in this case 'GET'
xmlHttp.send(null) // function sending data
}
//
function stateChanged() // function setting the processing state
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") // if process is completed
 { 
 document.getElementById("mainstory").innerHTML=xmlHttp.responseText // do this
 } 
 if (xmlHttp.readyState==1) // if process is still progressing
 { 
  document.getElementById("showform").innerHTML="";
} 
}
function GetXmlHttpObject() // function checking if browser supports xmlHttpRequest
{
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;
}
