$(function() {
		 
	/* Link op menu en nieuws */
	$("#menu>li, .nieuws ul>li").click(function()	{
		window.location = $("a", this).attr("href");	
	});
	
	/* Hover op nieuws */	 
	$(".nieuws ul>li").hover(
		function()	{	$(this).addClass("hover");	},
		function()	{	$(this).removeClass("hover");	}
	);
	
	
	/* --------------------------------	*/
	/* menu						 		*/
	/* --------------------------------	*/
	var menu = {};
	
	menu.laatstGeopend = null;
	menu.timeoutTime = 2000;
	menu.timeout = null;
	
	menu.init = function()
	{
		/* hover op li */
		$("#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
				{
					$("#menu>li>ul").hide();
					$("#menu>li").not(this).removeClass("hover");
					
					$(this).addClass("hover");	
					$(">ul", this).hide().slideDown(300);
					
					// selectbox in <ie7 verwijderen
					if($.browser.msie && $.browser.version < 7)	{
						$("select").css({ visibility: 'hidden' });	
					}
				}
			},
			function() 
			{ 
				// timeout zetten om na x aantal sec te sluiten
				menu.laatstGeopend = this;
				menu.timeout = setTimeout(function()
				{
					$(menu.laatstGeopend).removeClass("hover"); 
					
					// selectbox in <ie7 tonen
					if($.browser.msie && $.browser.version < 7)	{
						$("select").css({ visibility: 'visible' });	
					}
				}, menu.timeoutTime);
			}
		);
	}

	menu.init();


	/* Paginahoek */
	$("address, #paginahoek").hover(
		function() { $("#paginahoek").show(); },
		function() { $("#paginahoek").hide(); }
	);
	
	/* Formulier input */
	$("#content input, #content textarea, #content select").focus(function() {
		$(this).css("background-color", "#ffffff");
	});
	
	$("#content input, #content textarea, #content select").blur(function()	{
		$(this).css("background-color", "#d6edf8");
	});
	
	/* Formulier input button */
	$("#content input.button").focus(function()	{
		$(this).css("background-color", "#1a2b47");
	});
	
	$("#content input.button").blur(function() {
		$(this).css("background-color", "#1a2b47");
	});
});

//<![CDATA[
/* Replacement calls. Please see documentation for more information. */

if(typeof sIFR == "function"){

// This is the preferred "named argument" syntax
	sIFR.replaceElement(named({sSelector:"body.autoverhuur #pagehead h2", sFlashSrc: submap + "/fla/titel.swf", sColor:"#d9b618", sWmode:"transparent"}));
	sIFR.replaceElement(named({sSelector:"body.dago #pagehead h2", sFlashSrc: submap + "/fla/titel.swf", sColor:"#d91314", sWmode:"transparent"}));
	sIFR.replaceElement(named({sSelector:"#pagehead h2", sFlashSrc: submap + "/fla/titel.swf", sColor:"#6a99cf", sWmode:"transparent"}));
	
	sIFR.replaceElement(named({sSelector:"body.autoverhuur .blok h2", sFlashSrc: submap + "/fla/titel.swf", sColor:"#575757", sWmode:"transparent"}));
	sIFR.replaceElement(named({sSelector:".blok h2", sFlashSrc: submap + "/fla/titel.swf", sColor:"#FFFFFF", sWmode:"transparent", offsetLeft: 8}));

};

//]]>
