function openvenster(url,popup_width,popup_height,scrollbars) {
	var undefined;
	if (popup_width == undefined) popup_width=800;
	if (popup_height == undefined) popup_height=640;
	if (scrollbars == undefined) scrollbars='no';
	left_pos = (screen.availWidth/2) - (popup_width / 2);
	top_pos = (screen.availHeight/2) - (popup_height / 2);
	window.open(url,'popup','height=' + popup_height + ',left=' + left_pos + ',width=' + popup_width + ',scrollbars=' + scrollbars);
}

function toonAfbeelding(img){
	openvenster("/popup.php?img=" + img, 800, 600);
}

sfHover = function() {
	var navobj = document.getElementById("nav");
	if (navobj) {
		var sfEls = navobj.getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

$(function() {
	var selector = "#form input:visible, #form textarea";
	$(selector).each(function() {
		$(this).data('_oldValue', $(this).val());
	});
	$(selector).focus(function() {
		if($(this).val() == $(this).data('_oldValue'))
			$(this).val('');
	});
	$(selector).blur(function() {
		if($(this).val() == '')
			$(this).val($(this).data('_oldValue'));
	});
	$("#form").submit(function() {
		var valid = true;
		$(selector).each(function() {
			if(valid && ($(this).val() == '' || $(this).val() == $(this).data('_oldValue'))) {
				$(this).parent().addClass('invalid');
				$(this).focus();
				valid = false;
			} else {
				$(this).parent().removeClass('invalid');
			}
		});
		return valid;
	});
	$("#nav").hover(function() {
		$("a", this).removeAttr("title");
	});
});
