/* -------------------------------------------------------------------------------------------------
	Interlinie switcher (staat buiten de documen.ready!)
------------------------------------------------------------------------------------------------- */
function interlinie_switcher(dit) {
	$("#block"+dit).toggleClass("big_interlinie");
	$("#block"+dit).toggleClass("hoverunderline");
	$("#block"+dit+"_link").toggleClass("gesloten");
	$("#block"+dit+"_link").css("text-decoration","none");
}

function interlinie_open(dit) {
	$("#block"+dit).addClass("big_interlinie");
	$("#block"+dit).removeClass("hoverunderline");
	$("#block"+dit+"_link").addClass("gesloten");
}


$(document).ready(function(){
						   
						   
	$(".hoverunderline").hover(function(){
		if(jQuery.className.has(this, "hoverunderline"))
			$(this).css("text-decoration","underline");
	},function(){
		$(this).css("text-decoration","none");
	});
						   
/* -------------------------------------------------------------------------------------------------
	Body bg animations
------------------------------------------------------------------------------------------------- */
	
	if($("body").attr("class") == "bg_animated") {
		$("a#vlaamse_overheid").mouseover(function(){
			$("body").attr("class","bg_geel");
		});
		$("a#vlaamse_overheid").mouseout(function(){
			$("body").attr("class","bg_animated");
		});
		
		$("a#kunsten_en_erfgoed").mouseover(function(){
			$("body").attr("class","bg_dark");
		});
		$("a#kunsten_en_erfgoed").mouseout(function(){
			$("body").attr("class","bg_animated");
		});
	};
	
	if($("body").attr("class") == "bg_white") {
		$("a#vlaamse_overheid").mouseover(function(){
			$("body").attr("class","bg_geel");
		});
		$("a#vlaamse_overheid").mouseout(function(){
			$("body").attr("class","bg_white");
		});
		
		$("a#kunsten_en_erfgoed").mouseover(function(){
			$("body").attr("class","bg_dark");
		});
		$("a#kunsten_en_erfgoed").mouseout(function(){
			$("body").attr("class","bg_white");
		});
	};
	


/* -------------------------------------------------------------------------------------------------
	Sidenav openklap
------------------------------------------------------------------------------------------------- */
/*
	$("#side_nav ul").hide();
	
	$("#side_nav li").toggle(function(){
		$(this).children("ul").show();
	},function(){
		$(this).children("ul").hide();
	});*/
	
/* -------------------------------------------------------------------------------------------------
	Sitemap openklap
------------------------------------------------------------------------------------------------- */

	$("#sitemap ul ul").hide();
	
	$("#sitemap ul li").toggle(function(){
		$(this).children("ul").show();
	},function(){
		$(this).children("ul").hide();
	});

/* -------------------------------------------------------------------------------------------------
	Restyling (dec. 2010):
------------------------------------------------------------------------------------------------- */
	
	// subnav
	var browser = {
		Version: function() {
			var version = 999;
			if (navigator.appVersion.indexOf("MSIE") != -1)
				version = parseFloat(navigator.appVersion.split("MSIE")[1]);
			return version;
		}
	}
	if (!(browser.Version() < 9)) { /* not for IE 6/7: */
		jQuery('div.subnav').each(function(i) {
			if(!(jQuery(this).parent().hasClass('first'))) { /* and not for the first item: */
				var ul = jQuery(this).addClass('centered').find('ul');
				var table = jQuery('<table><tbody><tr><td class="left"></td><td class="center"></td><td class="right"></td></tr></tbody></table>');
				table.insertBefore(ul);
				table.find('td.center').append(ul);
			}
		});  
	}
	jQuery("ul#level1 li").mouseenter(function(){
		jQuery(this).addClass("focused");
	}).mouseleave(function(){
		jQuery(this).removeClass("focused");
	});
});



