// ******************************************************
//  Copyright 2006 by
//
//          arquakon.de - Matthias Marquardt
//
//  Version 0.4
// ******************************************************

var xmlHttp = false;

try {
    xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
    try {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch(e) {
        xmlHttp = false;
    }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
    xmlHttp = new XMLHttpRequest();
}

function AJXSSite(Seite, DivID) {
    var inhalt = "";
    if (xmlHttp) {
        xmlHttp.open('GET', Seite, true);
        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 4) {
                if (xmlHttp.status == 200) {
                    var content = xmlHttp.responseXML.getElementsByTagName("Content").item(0);
                    if (xmlHttp.responseXml) {
                        inhalt = content.firstChild.nodeValue;
                    } else if (xmlHttp.responseText) {
                        inhalt = content.textContent;
                    }
                    alert ('Ausgabe AJAX...');
                    var ref = document.getElementById(DivID);
                    ref.innerHTML += inhalt;
                } else {
                    alert('Es ist ein Problem aufgetreten.');
                }
            }
        };
        xmlHttp.send(null);
    }
}
