// browsercheck
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw = new checkBrowser();

var lastimg = "";
function imgover(source, name) {
	lastimg = document[name].src;
	document[name].src = source;
}

function imgout(name) {
	if (lastimg != "") {
		document[name].src = lastimg;
	}
}
function buttonchange(){
if (document.form1.grobauswahl1.value+document.form1.grobauswahl2.value+document.form1.frage.value+document.form1.kurzantwort.value+document.form1.detailantwort.value==('' || 0)){document.form1.search.value="Alle anzeigen";}
else {document.form1.search.value="    Suchen    ";}
return true;
}

function setFocus()
{
    document.implogin.imapuser.focus();
}

function submit_login()
{
    if (document.implogin.imapuser.value == "") {
        alert('Bitte Benutzernamen und Passwort eingeben');
        document.implogin.imapuser.focus();
        return false;
    } else if (document.implogin.pass.value == "") {
        alert('Bitte Benutzernamen und Passwort eingeben');
        document.implogin.pass.focus();
        return false;
    } else {
        return true;
    }
}
function enter_key_trap(e)
{
    var keyPressed;

    if (document.layers) {
        keyPressed = String.fromCharCode(e.which);
    } else if (document.all) {
        keyPressed = String.fromCharCode(window.event.keyCode);
    } else if (document.getElementById) {
        keyPressed = String.fromCharCode(e.keyCode);
    }

    if ((keyPressed == "\r" || keyPressed == "\n") && (submit_login())) {
        document.implogin.submit();
    }
}
function selectLang()
{
    // We need to reload the login page here, but only if the user hasn't
    // already entered a username and password.
    if (document.implogin.imapuser.value == '' &&
        document.implogin.pass.value == '') {
        var lang_page = 'http://webapps.manet.de/horde/imp/login.php?new_lang=' + document.implogin.new_lang[document.implogin.new_lang.selectedIndex].value;
        self.location = lang_page;
    }
}