// JavaScript Document

function spamSave( element ) {
	element = $( element == undefined ? 'body' : element );
	var arA = element.getElementsByTagName('A');
	for (var i=0;i<arA.length; i++ ) {
		if (arA[i].href.substr(0,7) == 'mailto:') {
			arA[i].href = arA[i].href.replace("--AT--","@");
			arA[i].innerHTML = arA[i].innerHTML.replace("--AT--","@");
		}
	}
}
function highlightSearch(inp) {
	inp.select();
}

function focusNewsletterForm(show) {
	$('newsletter').style.display = (show == true ? 'block' : 'none');
	if (show) $('nlEmail').select();
//	alert($('newsletter').style.display);
}
function pageJump(){
	if ( location.hash) {
		var theId = "a" + location.hash.replace('#','');
		var theDiv = document.getElementById("werkvlak");
		theDiv.style.marginTop = (findYPos(document.getElementById(theId)) - 168) + "px";
		window.scrollBy(0, -100);
	}
}
function findYPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
		return curtop;
	}
}
