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 see below
Why Use Async=true?

Our examples use "true" in the third parameter of open().

This parameter specifies whether the request should be handled asynchronously.

True means that the script continues to run after the send() method, without waiting for a response from the server.

The onreadystatechange event complicates the code. But it is the safest way if you want to prevent the code from stopping if you don't get a response from the server.

By setting the parameter to "false", your can avoid the extra onreadystatechange code. Use this if it's not important to execute the rest of the code if the request fails.*/

xmlhttp.send(null);
    if (xmlhttp.status==200)
	{								// Shoves the returned page into the div you specified.
	document.getElementById(id).innerHTML=xmlhttp.responseText; 
    }
}

