var xmlhttp;
function ajax(id,url)
{
xmlhttp=null;
  if (window.XMLHttpRequest)
  {// code for Firefox, Opera, IE7, etc.
  xmlhttp=new XMLHttpRequest();
  }
  else if (window.ActiveXObject)
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }

xmlhttp.open("GET",url,false); // the false is very important it tells it to wait for the requested page to finish loading before going any further.
xmlhttp.send(null);
    if (xmlhttp.status==200)
	{	
	document.getElementById(id).innerHTML=xmlhttp.responseText;
    }
}