// globale Instanz von XMLHttpRequest
var xmlHttp2 = false;

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


function getRandomPicture()
{
 if (xmlHttp2) {
     xmlHttp2.open('GET', 'doit/getrandompicture.php', true);
     xmlHttp2.onreadystatechange = function () {
         if (xmlHttp2.readyState == 4) {
             document.getElementById("zufallsbild").innerHTML = xmlHttp2.responseText;
         }
     };
     xmlHttp2.send(null);
 }
}

// globale Instanz von XMLHttpRequest
var xmlHttp3 = false;

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


function getNewestPicture()
{
 if (xmlHttp3) {
     xmlHttp3.open('GET', 'doit/getnewestpicture.php', true);
     xmlHttp3.onreadystatechange = function () {
         if (xmlHttp3.readyState == 4) {
             document.getElementById("newestpicture").innerHTML = xmlHttp3.responseText;
         }
     };
     xmlHttp3.send(null);
 }
}