
/*---- GLOBAL JS FUNCTIONS ----*/


/*---- NAVIGATION: show intro blocks ----*/
function zzShowIntro(whichIntro){
	var targetEl = document.getElementById(whichIntro);
	var subNav = document.getElementById('second-level-nav');

	if((targetEl != null) && (subNav != null)){
		targetEl.style.display = ( targetEl.style.display == 'none' || targetEl.style.display == '' ? 'block' : 'none'  );
		
		if ( zzElement.hasClassName ( document.body, 'home') ) {
		// if body-class = home; do not show the second-level on mouse-out
			subNav.style.display = ( targetEl.style.display == 'block' ? 'none' : 'none'  );
		}else{
			subNav.style.display = ( targetEl.style.display == 'none' &&  subNav.style.display == 'none' ? 'block' : 'none'  );
		}
	}
}

/*---- NAVIGATION: hide navigation-elements and show breadcrumb or visa-versa. ----*/
function zzShowNavigation(){
    zzElement.flipClassName ( document.body, 'collapsed-nav' );
	
	var textNode = document.getElementById('navigationToggler').childNodes[0].childNodes[0];
	 textNode.nodeValue = (textNode.nodeValue == 'Sluit menu') ? 'Open menu' : 'Sluit menu' ;
}

/*---- Check state of navigation, if collapsed show 'Open menu'-button ----*/
function zzCheckNavigation(){
	var testEl;
	try
	{
		testEl = document.getElementById('navigationToggler').childNodes[0].childNodes[0];
	}
	catch(e){return false;}

	if(testEl == undefined){
		return false;
	}else{
		var textNode = document.getElementById('navigationToggler').childNodes[0].childNodes[0];
		textNode.nodeValue = (document.body.className.indexOf('collapsed-nav') > -1) ? 'Open menu' : 'Sluit menu' ;		
	}
		
}
