if (window.XMLHttpRequest) {
  http = new XMLHttpRequest();
} else if (window.ActiveXObject) { // Internet Explorer
  try {
	http = new ActiveXObject('Msxml2.XMLHTTP');
  } catch (e) {
    try {
	  http = new ActiveXObject('Microsoft.XMLHTTP');
    } catch (e) {}
  }
}

function jabber(id) {
    http.open('POST', basepath + 'ajax.php', true);
    http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    http.onreadystatechange = getAjax;
    http.send('jabber=&id=' + id);
}

function getAjax() {
    if(http.readyState != 4) return;
    var text = http.responseText.split("\n"), id = text[0];
    if(document.getElementById('jabber-' + id) == null) {
        var box = document.createElement('div');
        box.innerHTML = text[1];
        box.id = 'jabber-' + id;
        document.getElementById('guestbook-' + id).appendChild(box);
    }
}

