// Verwijder stippellijnen 
function setBlur() {
	entries = document.getElementsByTagName('a')

	for (var i = 0;i < entries.length;i++) {
		entries[i].onfocus = function() {
		    this.blur()
		}
	}
}

// Geen statusbar message
function hidestatus() {
    window.status = ''
    return true
}

if (document.layers)
    document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover = hidestatus
document.onmouseout = hidestatus

// Menu + submenu
navHover = function() {
	var lis = document.getElementById("navmenu").getElementsByTagName("LI")

	for (var i = 0;i < lis.length;i++) {
		lis[i].onmouseover = function() {
			this.className += " iehover"
		}

		lis[i].onmouseout = function() {
			this.className = this.className.replace(new RegExp(" iehover\\b"), "")
		}
	}
}

if (window.attachEvent)
    window.attachEvent("onload", navHover)

// Nieuwe windows
try {
	document.addEventListener('click', handleClick, false)
} catch(e) {
	if(document.attachEvent) {
		document.attachEvent('onclick', handleClick)
	} else {
		document.onclick = handleClick
	}
}

function handleClick(e) {
	var event = e || window.event

	if(event.ctrlKey || event.shiftKey || event.altKey)
	    return true

	if(event.which && event.which != 1)
	    return true

	var target = event.target || event.srcElement

	while(target && !/^a$/i.test(target.nodeName)) {
		target = target.parentNode
	}

	if(!target || !target.getAttribute('rel'))
	    return true

	var rel = target.getAttribute('rel')
	var href = target.getAttribute('href')

	switch(rel) {
		case 'pgrond':
			 window.open(href, '', 'width=628,height=460')
			 break
		case 'extern':
			 window.open(href)
			 break
		  default:
			 return true
	}

	try {
	    event.preventDefault()
	} catch(e) {
	}

	return false
}

// Verander lettergrootte
function setActiveStyleSheet(title) {
    var i, a, main

    for(i = 0; (a = document.getElementsByTagName("link")[i]);i++) {
        if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
            a.disabled = true

            if(a.getAttribute("title") == title)
                a.disabled = false
        }
    }
}

function getActiveStyleSheet() {
    var i, a

    for(i = 0; (a = document.getElementsByTagName("link")[i]);i++) {
        if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled)
            return a.getAttribute("title")
    }

    return null
}

function getPreferredStyleSheet() {
    var i, a

    for(i = 0; (a = document.getElementsByTagName("link")[i]);i++) {
        if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title"))
            return a.getAttribute("title")
    }

    return null
}

// Bekijk resolutie
function getWindowWidth() {
	var windowWidth = 0

	if (typeof(window.innerWidth) == 'number') {
		windowWidth = window.innerWidth
	} else {
		if (document.documentElement && document.documentElement.clientWidth) {
			windowWidth = document.documentElement.clientWidth
		} else {
			if (document.body && document.body.clientWidth) {
				windowWidth = document.body.clientWidth
			}
		}
	}

	return windowWidth
}

function init () {
	var windowWidth = getWindowWidth()
	var activeStyleSheet = getActiveStyleSheet()

	if (windowWidth < 950) {
		setActiveStyleSheet('acht')
	}
}

function showDiv(id) {
	document.getElementById(id).style.display = "block"
}

// Verberg een div
function hideDiv(id) {
	document.getElementById(id).style.display = "none"
}