function httpReqNew() {
  var req;
  if(window.XMLHttpRequest) {
    req=new XMLHttpRequest();
  }
  else if(window.ActiveXObject) {
    req=new ActiveXObject('Msxml2.XMLHTTP');
    if(!req)
      req=new ActiveXObject('Microsoft.XMLHTTP');
  }
  if(!req) {
    //TODO: show this only once based on cookies or something
    alert('Your browser does not dynamic document requests.\n Some functions will not work correctly');
  }
  return req;
}

function httpReqGet(req,url,handle) {
  if(!req) return;
  try {
    req.onreadystatechange=function() { handle(req) }
    req.open('GET',url,true);
    req.send(null);
  }
  catch(e) {
    alert('The application cannot contact the server.\n Please try again in a few seconds\n Error details: '+e.message);
  }
}
