// JavaScript Document
//alert('000');
$(document).ready(function() {
	// Uitklappend submenu 
	sfHover();
	sfsubHover();
			
	$('.definitie').hide();
	
	$('.woord').toggle(					   
		function () {
			$(this).parent().find('.definitie').slideToggle('fast');
		},
		function () {
			$(this).parent().find('.definitie').slideToggle('fast');
		}
	);
	
	var myFile = document.location.toString();
	if (myFile.match('#')) { // the URL contains an anchor
  		// click the navigation item corresponding to the anchor
  		var myAnchor = '#' + myFile.split('#')[1];
  		$(myAnchor).find('.definitie').slideToggle('fast');
  		
  		location.href = location.href;
	}
});


function sfHover() {
	if(document.getElementById("navigation")){
		var sfEls = document.getElementById("navigation").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"), "");
			}
		}
	}
}

function sfsubHover() {
	if(document.getElementById("sub-navigation")){
		var sfElsSub = document.getElementById("sub-navigation").getElementsByTagName("li");
		for (var j = 0; j < sfElsSub.length; j++) {
			sfElsSub[j].onmouseover=function() {
				this.className+=" sfsubhover";
			}
			sfElsSub[j].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfsubhover\\b"), "");
			}
		}
	}
}

function renewCaptcha() {
	$('captcha').src = '/captcha.php?r='+Math.random();
}
