// globale Instanz von XMLHttpRequest
var xmlHttp = false;

// XMLHttpRequest-Instanz erstellen
// ... für Internet Explorer
try {
    xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
    try {
        xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
    } catch(e) {
        xmlHttp  = false;
    }
}
// ... für Mozilla, Opera und Safari
if (!xmlHttp  && typeof XMLHttpRequest != 'undefined') {
    xmlHttp = new XMLHttpRequest();
}

// aktuelle Daten laden
//loadData();

function loadData()
{
 if (xmlHttp) {
     xmlHttp.open('GET', 'doit/getdata.php', true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("blabox_content").innerHTML = xmlHttp.responseText;
         }
     };
     xmlHttp.send(null);
 }
}

function saveData()
{
if (xmlHttp) {
    xmlHttp.open('POST', 'doit/setdata.php');
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHttp.send('bb_name='+document.form_blabox.bb_name.value+'&bb_nachricht='+document.form_blabox.bb_nachricht.value);
}

// Message-Eingabefelder leeren und Focus setzen
document.form_blabox.txtmessage.value = '';
document.form_blabox.txtmessage.focus();
}