xmlHttp = Array();
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;
}

function stateChanged(id) 
{ 
	if (xmlHttp[id].readyState!=4)
	{ 
		document.getElementById(id).innerHTML="<img src='images/ajax-loader.gif' height='11' alt='' style='border: 0px;' />";
	}
	
	if (xmlHttp[id].readyState==4)
	{ 
		document.getElementById(id).innerHTML=xmlHttp[id].responseText;
	}
}

function getData(id,string)
{
	//alert(string);
	xmlHttp[id]=GetXmlHttpObject()
	if (xmlHttp[id]==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	} 
	xmlHttp[id].onreadystatechange=function() { stateChanged(id) };
	xmlHttp[id].open("GET","data.php?" + string + "&sid=" + Math.random(),true);
	xmlHttp[id].send(null);
	
}