window.onload = function() {
	repairEmail();
	if (document.body.className == 'index') {
//		window.resizeTo(1024, 738);
	}
}

window.onunload = function() {
	document.getElementById('content').focus();
}

function repairEmail(container) {
	// replace all occurences of <span class="emailaddress">...</span> with a clickable e-mail address
	// trying to give bots gathering e-mail addresses to spam a hard time
	var remail = 'elk';
	remail += 'om';
	remail += String.fromCharCode(16*4);
	remail += 'bureaukonings';
	remail += 'kunst';
	remail += '.n';
	remail = 'w' + remail + 'l';
	if (container == null) {
		container = document;
	}
	var divemails = container.getElementsByTagName('span');
	for (i = divemails.length - 1; i >= 0; i--) {
		var divemail = divemails[i];
		if (divemail.className == 'emailaddress') {
			divemail.innerHTML = '<a href="mailto:' + escape('Bureau Konings Kunst <' + remail + '>') + '?subject=' + escape('Reactie website') + '">' + remail + '</a>';
		}
	}
}

