var pwyAjaxRequest = new AjaxRequest();

function PWY_Callback() {
  if(this.pwyAjaxRequest && this.pwyAjaxRequest.xmlHttpRequest.readyState == 4) {
    if(this.pwyAjaxRequest.xmlHttpRequest.status == 200 && this.pwyAjaxRequest.xmlHttpRequest.responseXML) {
      var erg = this.pwyAjaxRequest.xmlHttpRequest.responseText;
      document.getElementById('pwy_erg').innerHTML = erg;
    }
  }
}

function PWY_init(act, id) {
  var zusatz = '';

  if(act && id) {
    zusatz = act + '=' + id;
  }

  this.pwyAjaxRequest.openPost(
    'index.php?page=PWYahoo',
    zusatz,
    function () {
      PWY_Callback();
    }
  );
}