var xmlhttp=false;
// set up xmlhttp connection
var xmlhttp;
try {
  xmlhttp = new XMLHttpRequest();
} catch (trymicrosoft) {
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (othermicrosoft) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (failed) {
      xmlhttp = false;
    }
  }
}