
function getAnfrage(){

    var anfrage = null;
    try {
      anfrage = new XMLHttpRequest();
    } catch (versuchmicrosoft) {
      try {
        anfrage = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (anderesmicrosoft) {
        try {
          anfrage = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (fehlschlag) {
          anfrage = null;
        }
      }
    }

    if (anfrage == null)
      alert("Fehler beim Erzeugen des Anfrage-Objekts!");

    return anfrage;
}




function startRequest(url,phpfunktion,param,action,format){
  var headerFormat = "";
  if(format == null) {
      headerFormat = "";
  }
  if(format == "xml"){
      headerFormat = "&ajaxheader=xml";
  }
  globalUrl = url;
  var anfrage = getAnfrage();
  anfrage.open("GET", unescape(url) + headerFormat +  "&ajaxfunktion=" + phpfunktion + "&ajaxparam=" + escape(param) , true);
  anfrage.onreadystatechange = function() { action(anfrage,url); };
  anfrage.send(null);
}
