/* functie om hele blokken klikbaar te maken, en hover toevoegen */
$.fn.hoverClick = function()
{
	this.each(function()
	{
		$(this).hover(
			function() { $(this).addClass("hover").css("cursor", "pointer"); },
			function() { $(this).removeClass("hover").css("cursor", "pointer"); }
		);
		
		$(this).attr("title", $("a:first", this).attr("title"));
		
		$(this).click(function(){
			window.location = $("a:first", this).attr("href");
		});
	});
	
	return this;
};


$(function() {
		      
		   
	//maak nieuwsoverzicht items klikbaar
	$("#nieuwsoverzicht>li").hoverClick();
	$("#actieoverzicht>li").hoverClick();
	

		   
	///////////////////////////////
	// Formulier focus op velden //
	///////////////////////////////
	$("#content input, #content textarea").focus(function() {
		$(this).addClass("veldfocus");
	});
	$("#content input, #content textarea").blur(function() {
		$(this).removeClass("veldfocus");
	});
	
	// Menu link 
	$("#links-menu li").hover(	function(){ $(this).addClass("hover"); },
								function(){ $(this).removeClass("hover"); });
	
	/* Subsubmenu */
	var menu = {};

	menu.laatstGeopend = null;
	menu.timeoutTime = 2000;
	menu.timeout = null;
	
	menu.init = function()
	{		
		/* hover op li */
		$("#top-menu>li").hover(
			function() 
			{ 		
				// als laatstegeopend dezelfde is als de huidige, dan de timeout verwijderen
				if($(this).hasClass("hover"))
				{
					clearTimeout(menu.timeout);
				}
				// nieuwe uitschuiven
				else
				{
					$("#top-menu>li>ul").hide();
					$("#top-menu>li").not(this).removeClass("hover");
					
					$(this).addClass("hover");
					$(">ul", this).fadeIn(400);									
				}
			},
			function() 
			{ 
				// timeout zetten om na x aantal sec te sluiten
				menu.laatstGeopend = this;
				menu.timeout = setTimeout(function()
				{
					$(menu.laatstGeopend).removeClass("hover"); 
					
				}, menu.timeoutTime);
			}
		);
	}

	menu.init();
	
});



	

	
	
	
function maak_sifr()
{
	sIFR.replaceElement(named({ sSelector:"h1", sFlashSrc: submap+"fla/officina.swf", sColor:"#e7c00e", sBgColor:"#ffffff", sWmode:"transparent" }));	
}