/* Nickname prüfen */
function sendNick() {
    try {
		req = window.XMLHttpRequest?new XMLHttpRequest():
        new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
    //Kein AJAX Support
    }

    req.onreadystatechange = handleNick;
    nick = document.getElementById('username1').value;
	document.getElementById('nick_ergebnis').innerHTML = loadstatus;
    req.open('get', '/ajax_reg.html?mode=nick&username1='+ nick);
    req.send(null);
}
function handleNick() {
    if ((req.readyState == 4) && (req.status == 200)) {
        document.getElementById('nick_ergebnis').innerHTML = req.responseText;
    }
}

/* Passwort prüfen */
function sendPasswort() {
    try {
		req2 = window.XMLHttpRequest?new XMLHttpRequest():
        new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
    //Kein AJAX Support
    }

    req2.onreadystatechange = handlePasswort;
	passwort = document.getElementById('passwort1').value;
	document.getElementById('passwort_ergebnis').innerHTML = loadstatus;
    req2.open('get', '/ajax_reg.html?mode=passwort&passwort1='+ passwort);
    req2.send(null);
}
function handlePasswort() {
    if ((req2.readyState == 4) && (req2.status == 200)) {
        document.getElementById('passwort_ergebnis').innerHTML = req2.responseText;
    }
}

/* Passwort-WDH prüfen */
function sendPasswort2() {
    try {
		req3 = window.XMLHttpRequest?new XMLHttpRequest():
        new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
    //Kein AJAX Support
    }

    req3.onreadystatechange = handlePasswort2;
    passwort = document.getElementById('passwort1').value;
	passwort2 = document.getElementById('passwort12').value;
	document.getElementById('passwort2_ergebnis').innerHTML = loadstatus;
    req3.open('get', '/ajax_reg.html?mode=passwort2&passwort1='+ passwort +'&passwort12='+ passwort2);
    req3.send(null);
}
function handlePasswort2() {
    if ((req3.readyState == 4) && (req3.status == 200)) {
        document.getElementById('passwort2_ergebnis').innerHTML = req3.responseText;
    }
}

/* Email prüfen */
function sendEmail() {
    try {
		req4 = window.XMLHttpRequest?new XMLHttpRequest():
        new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
    //Kein AJAX Support
    }

    req4.onreadystatechange = handleEmail;
    email = document.getElementById('email').value;
    document.getElementById('email_ergebnis').innerHTML = loadstatus;
    req4.open('get', '/ajax_reg.html?mode=email&email='+ email);
    req4.send(null);
}
function handleEmail() {
    if ((req4.readyState == 4) && (req4.status == 200)) {
        document.getElementById('email_ergebnis').innerHTML = req4.responseText;
    }
}

/* Bild löschen */
function senddelpic() {
    try {
		req = window.XMLHttpRequest?new XMLHttpRequest():
        new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
    //Kein AJAX Support
    }

    req.onreadystatechange = handledelpic;
    bild1 = document.getElementById('delpic').value;
    document.getElementById('bild_ergebnis').innerHTML = loadstatus + "<br />";
	req.open('get', '/ajax_reg.html?mode=delpics&delpic1='+ bild1);
    req.send(null);
}
function handledelpic() {
    if ((req.readyState == 4) && (req.status == 200)) {
        document.getElementById('bild_ergebnis').innerHTML = req.responseText;
    }
}

/* Unterkategorie laden */
function changeKat() {
    try {
		req = window.XMLHttpRequest?new XMLHttpRequest():
        new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
    //Kein AJAX Support
    }

    req.onreadystatechange = handlechangeKat;
    kat = document.getElementById('kat').value;
	document.getElementById('unterkatoptions').innerHTML = loadstatus+"<img src=\"/images/tpl/leer.gif\" height=\"20\" width=\"1\" alt=\"\" /><br />";
	req.open('get', '/ajax_reg.html?mode=changekat&kat='+ kat);
    req.send(null);
}
function handlechangeKat() {
    if ((req.readyState == 4) && (req.status == 200)) {
        document.getElementById('unterkatoptions').innerHTML = req.responseText;
    }
}
/* Unterkategorie laden */
function changeKat1() {
    try {
		req = window.XMLHttpRequest?new XMLHttpRequest():
        new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
    //Kein AJAX Support
    }

    req.onreadystatechange = handlechangeKat1;
    kat = document.getElementById('kat').value;
	unterkat1 = document.getElementById('unterkat1').value;
	document.getElementById('unterkatoptions').innerHTML = loadstatus+"<img src=\"/images/tpl/leer.gif\" height=\"20\" width=\"1\" alt=\"\" /><br />";
	req.open('get', '/ajax_reg.html?mode=changekat&unterkat1='+unterkat1+'&kat='+ kat);
    req.send(null);
}
function handlechangeKat1() {
    if ((req.readyState == 4) && (req.status == 200)) {
        document.getElementById('unterkatoptions').innerHTML = req.responseText;
    }
}
