// houd de sessie levend
window.setTimeout('keepalive()', 180000)

function keepalive() {
    xhtmlReq('keepalive.asp')
    window.setTimeout('keepalive()', 180000)
}

function geenspam(user,domain) {
	locationstring = "mailto:" + user + "@" + domain
	window.location = locationstring
}

function fixUglyIE() { 
	for (a in document.links)
	    document.links[a].onfocus = document.links[a].blur
}

if (document.all) { 
	document.onmousedown = fixUglyIE
}

var win = null

function nieuweWindow(mypage, myname, w, h, scroll) {
    var winl = (screen.width - w) / 2
    var wint = (screen.height - h) / 2
    var settings = 'height=' + h + ','
        settings += 'width=' + w + ','
        settings += 'top=' + wint + ','
        settings += 'left=' + winl + ','
        settings += 'scrollbars=' + scroll + ','
        settings += 'resizable=no'

    win = window.open(mypage, myname, settings)

    if(parseInt(navigator.appVersion) >= 4) {
        win.window.focus()
    }
}

function toggleID(obj) {
    var el = document.getElementById(obj)

    if (el.style.display != 'block')
        el.style.display = 'block'
    else
        el.style.display = ''
}

function showID(id) {
	document.getElementById(id).style.display = "block"
}

function hideID(id) {
	document.getElementById(id).style.display = "none"
}

function toggleMenu(obj) {
    var f_tmp = document.getElementsByTagName('ul')

    for (var i = 0;i < f_tmp.length;i++) {
        if (f_tmp[i].id.indexOf('sub') >= 0)
            if (f_tmp[i].id == obj)
                if (f_tmp[i].style.display == 'none' || f_tmp[i].offsetWidth == 0)
                    f_tmp[i].style.display = 'block'
                else
                    f_tmp[i].style.display = 'none'
            else
                f_tmp[i].style.display = 'none'
    }
}

function toggleOpenMenu(obj) {
	var el = document.getElementById(obj)

	if ( el.style.display != 'none' )
		el.style.display = 'none'
	else
		el.style.display = ''
}

function xhtmlReq(f_sUrl) {
	var oXMLHTTP

	if (window.XMLHttpRequest) {
		oXMLHTTP = new XMLHttpRequest()
		oXMLHTTP.open("GET", f_sUrl, false)
		try {
			oXMLHTTP.send(null)
			return oXMLHTTP.responseText
		} catch(e) {
			alert('mislukt: ' + e)
		}
	} else if (window.ActiveXObject) {
		oXMLHTTP = new ActiveXObject("Microsoft.XMLHTTP")
		if (oXMLHTTP) {
			oXMLHTTP.open("GET", f_sUrl, false)
			try  {
				oXMLHTTP.send()
				return oXMLHTTP.responseText
			} catch (e) {
				alert('mislukt: ' + e)
			}
		}
	}
}

function checkValues() {
    if (document.getElementById('inlognaam').value == '') {
        alert('Er is nog geen inlognaam ingevuld.')
        document.getElementById('inlognaam').focus()
        return false
    } else if (document.getElementById('wachtwoord').value == '') {
        alert('Er is nog geen wachtwoord ingevuld.')
        document.getElementById('wachtwoord').focus()
        return false
    } else
        return true
}

function wwopvragen() {
    f_strInlognaam = document.getElementById('inlognaam').value

    if (f_strInlognaam == '') {
        alert('Er is nog geen toegangsnaam ingevuld.')
        document.getElementById('inlognaam').focus()
    } else {
        var f_tmp = xhtmlReq('xmlWwOpvragen.asp?L=' + f_strInlognaam)

        eval(f_tmp)
    }
}
