var xmlHttp = false;

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();
}

loadData();

setInterval("loadData()",5000);

function loadData() {
 if (xmlHttp) {
     xmlHttp.open('GET', 'ajax/chat/get.php', true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("asb_content").innerHTML = xmlHttp.responseText;
         }
     };
     xmlHttp.send(null);
 }
}

function saveData()
{
if (xmlHttp) {
    xmlHttp.open('POST', 'ajax/chat/send.php');
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHttp.send('&message='+document.frmshoutbox.txtmessage.value);
}

// Message-Eingabefelder leeren und Focus setzen
document.frmshoutbox.txtmessage.value = '';
document.frmshoutbox.txtmessage.focus();
}


function SetSmiley(emo) {
document.frmshoutbox.txtmessage.value+=''+emo;
document.frmshoutbox.txtmessage.focus();
}

function archivwindow() {
	var smw = window.open("ajax/chat/archiv.php", "Smilies", "width=300,height=400,location=no,toolbar=no,status=no,scrollbars=yes");
}