var _VSEM_XMLHTTP_PROGID = "";
//
// находим подходящий progID
//
pickRecentProgID = function (idList){
  // found progID flag
  var bFound = false;
  for(var i=0; i < idList.length && !bFound; i++){
    try{
      var oDoc = new ActiveXObject(idList[i]);
      o2Store = idList[i];
      bFound = true;
    }catch (objException){
      // try next progID
    };
  };
  if (!bFound) {
    throw "Could not retreive a valid progID of Class: " + idList[idList.length-1]+". (original exception: "+e+")";
  };
  idList = null;
  return o2Store;
};
//
// эмуляция XMLHttpRequest для IE
//
if (!window.XMLHttpRequest) {
  XMLHttpRequest = function() {
    if(!_VSEM_XMLHTTP_PROGID){
      _VSEM_XMLHTTP_PROGID = pickRecentProgID(["Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"]);
    };
    return new ActiveXObject(_VSEM_XMLHTTP_PROGID);
  };
 };
