/*	create a variable to hold the request object	*/
var request = null;
/*	attemp creating a basic XMLHttpRequest object 	*/
try {
  request = new XMLHttpRequest();
} 
/*	if the above failed, try the microsoft specific techniques */
catch (trymicrosoft) {
  try {
    request = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (othermicrosoft) {
    try {
      request = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (failed) {
      request = null;
    }
  }
}
/*	if everything above failed the browser is likley too old to handle AJAX	*/
if (request == null)
  alert("Error creating request object!");
  /*	if successful, any script which includes this will have access 
		to an XMLHttpRequest object named
		'request'
  */

