function setBlur() {
	entries = document.getElementsByTagName('a')

	for (var i=0; i < entries.length; i++) {
		entries[i].onfocus = function() {this.blur()}
	}
}

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 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 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 init () {
	var windowWidth = getWindowWidth();
	var activeStyleSheet = getActiveStyleSheet();
	if (windowWidth < 990) {
		setActiveStyleSheet('acht')
	}
/*		if (windowWidth > 990) {
		setActiveStyleSheet('default')
	}*/
}

// Geen statusbar message
function hidestatus(){
window.status=''
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus

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 'bigTel':
			window.open(href, '', 'width=445,height=315');
			break;
		case 'route':
			window.open(href, '', 'width=560,height=365');
			break;
		case 'tour':
			window.open(href, '', 'width=761,height=600');
			break;
		case 'extern':
			window.open(href);
			break;
		case 'lightbox':
			break;
		default:
			return true;
	}
	
	try {
		event.preventDefault();
	} catch(e){}

   return false;
}

function geenspam(user,domain){
		locationstring = "mailto:" + user + "@" + domain;
		window.location = locationstring;
	}

// Toon een verborgen div
function showDiv(id) {
	document.getElementById(id).style.display = "block";
	}

// Verberg een div
function hideDiv(id) {
	document.getElementById(id).style.display = "none";
	}

// Toggle Div
function toggleDiv(obj) {
  var el = document.getElementById(obj);
  if ( el.style.display != 'block' ) {
    el.style.display = 'block';
  }
  else {
    el.style.display = '';
  }
}

// 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);
