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 = 'nf';
	remail += 'o';
	remail += String.fromCharCode(8*8);
	remail += 'annetscholte';
	remail += 'n.';
	remail += 'n';
	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('Annet Scholten <i' + remail + 'l>') + '?subject=' + escape('Reactie website') + '">i' + remail + 'l</a>';
		}
	}
}
