
/* ==================================================== CIJFER PAGINA specifieke functies */
	//Creeer klik acties
	function addmouseActions(){
		//add mouse behaviour
		addMouseAction(1);
		addMouseAction(2);
		addMouseActionTabs();
		if ($('level_2grp5')) $('level_2grp5').style.marginLeft = '150px';
		if ($('level_2grp11')) $('level_2grp11').style.marginLeft = '328px';
	}
	
	function addMouseActionTabs(){
		if ($('allmaintabs')) {
			if (document.getElementById) 
				var x = document.getElementById('allmaintabs').getElementsByTagName('a');
			else if (document.all)
				var x = document.all['allmaintabs'].all.tags('a');
			else return;

			for (var i=0;i<x.length;i++)
			{
					x[i].onclick = function() {
							showHideContent(this.id);
							makeTabActive(this.id);
							$(this.id).removeAttribute('href');	//voorkomen van lelijke a-active
							return false;
						}
			}
		}
	}
	
	function makeTabActive(id2makeactive){
		if (document.getElementById)
			var x = document.getElementById('allmaintabs').getElementsByTagName('a');
		else if (document.all)
			var x = document.all['allmaintabs'].all.tags('a');
		else return;
		
		for (var i=0;i<x.length;i++) {
			x[i].className = (x[i].className).replace(/ active/, '');
		}
		if (id2makeactive!=false) {
			$(id2makeactive).className += ' active';
		}
	}
	
	

	//Alle a elementen in een level tracen en een mouse-functie aan koppelen
	function addMouseAction(level){
		var tempString;
		if (document.getElementById) 
			var x = document.getElementById('level_'+level+'_new').getElementsByTagName('a');
		else if (document.all)
			var x = document.all['level_'+level+'_new'].all.tags('a');
		else return;

		for (var i=0;i<x.length;i++)
		{
			tempString = "";
			tempString = x[i].href.toString();
			if(tempString.indexOf("showItemTop") >= 0){
				//als er showItemTop in de string zit dan subgroep 3 activeren
				x[i].onclick = function() {
						$(this.id).removeAttribute('href');	//voorkomen van lelijke a-active
						showItemMenu(this.id);
						makeActive(level, this.id);
						showSubmenu(false);
						return false;
					}
			} else if (tempString.indexOf("showItemSub") >= 0){
				//als er showItemSub in de string zit dan subgroep 3 activeren
				x[i].onclick = function() {
						$(this.id).removeAttribute('href');	//voorkomen van lelijke a-active						
						showItemMenu(this.id);
						makeActive(level, this.id);
						return false;
					}
				
			} else if (tempString.indexOf("showGroup") >= 0){
				//als er showGroup in de string zit dan subgroep 2 activeren
				x[i].onclick  = function() {
					//$(this.id).removeAttribute('href');
					showSubmenu(this.id);
					showItemMenu(false);
					makeActive(level, this.id);
					return false;
				}
				
				//verplaasten van submenu ongeveer onder het hoofdmenu item
				//$('level_2' + x[i].id).style.marginLeft = (x[i].offsetLeft - x[i].parentNode.parentNode.offsetLeft) - ($('level_2' + x[i].id).getElementsByTagName('li').length * 20) + 'px';
				
			}

			if($(this.id)){
				x[i].onmouseover = function(){$(this.id).className = "activeLink";}
				x[i].onmouseout = function(){if((activeA!=this.id)&&(activeB!=this.id))$(this.id).className = "";}
			}
		}
	}

	function showSubmenu(id2show){
		if (document.getElementById)
			var x = document.getElementById('level_2_new').getElementsByTagName('ul');
		else if (document.all)
			var x = document.all['level_2_new'].all.tags('ul');
		else return;
		for (var i=0;i<x.length;i++) {
			x[i].style.display = 'none';
		}
		makeActive(2, false)
		if (id2show!=false) {
			$('level_2'+id2show).style.display = 'block';
		}
	}

	function showItemMenu(id2show){
		if (document.getElementById)
			var x = document.getElementById('level_3_new').getElementsByTagName('ul');
		else if (document.all)
			var x = document.all['level_3_new'].all.tags('ul');
		else return;
		
		for (var i=0;i<x.length;i++) {
			x[i].style.display = 'none';
		}

		if (id2show!=false) {
			$('level_3'+id2show).style.display = 'block';
		}
	}

	function makeActive(level, id2makeactive){
		if (document.getElementById)
			var x = document.getElementById('level_'+level+'_new').getElementsByTagName('a');
		else if (document.all)
			var x = document.all['level_'+level+'_new'].all.tags('a');
		else return;
		for (var i=0;i<x.length;i++) {
			x[i].className = "";
		}
		if (id2makeactive!=false) {
			$(id2makeactive).className = 'active';
		}
	}

/* ==================================================================== Algemeen */

function showHideContent(id2show){
	for (var i=0;i<jsContent.length;i++)
	{
		$(jsContent[i]).style.display = 'none';
	}
	if (typeof(id2show) != 'object') {
		$('content' + id2show).style.display = 'block';
		}else{$(jsContent[0]).style.display = 'block';}
}