// ajax-lib uja070402 - läd php-reply als text/plain in auswerten(txt) ab -POST-Variante
// getestet und ok mit FF2.0.0.3 und Konqueror 3.5.6
// --------------------------------------------------------------------------------------------------------------
function create_httprequest() // returns a browser-independend httpRequest Object
{ var req = null;
  try { req = new ActiveXObject("MSXML2.XMLHTTP"); }                        // IE-Äh
  catch (err_MSXML2)
  { try { req = new ActiveXObject("Microsoft.XMLHTTP"); }                   // Ie-Äh neu
    catch (err_Microsoft)
    { if (typeof XMLHttpRequest != "undefined") req = new XMLHttpRequest; // Mozzarella und Co
//      req.overrideMimeType('text/xml'); // falls mal XML gesendet werden soll - für text/plain auskommentieren
    }
  }
  return req;
}

function ajax(req,proggi,qstring) 
{ req.open("POST",proggi,true); // Request zusammenstellen - Anfrage senden
  // Wichtig: Header NACH open, sonst spinnt Mozilla FF2
  req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  req.setRequestHeader("Content-length", qstring.length);
  req.setRequestHeader("Connection", "close");

  req.onreadystatechange=function()
  { if (req.readyState==4)
    { if (req.status==200) auswerten(req.responseText);
      else alert('Fehler:'+req.status);
    }
  }
  req.send(qstring);  // Post-Daten schicken
}
