

$(function() {
		
	if(config.pagina_type == 'frontpage' )
	{
		$("#productoverzicht ul li, #teaser li, #content .afbeelding").hoverClick();
		$("#productoverzicht ul li img, #teaser li img, #content .afbeelding .overlay").css("cursor", "pointer");
	}
	else
	{
		$("#productoverzicht ul li, , #content .afbeelding").hoverClick();
		$("#productoverzicht ul li img, #content .afbeelding .overlay").css("cursor", "pointer");	
		
		$('#teaser ul').cycle({
			fx:     'fade',
			speed:  3000,
			timeout: 3000,
			speedIn:800,
			cleartype:  false ,
			cleartypeNoBg: true
		});	 			
	}	

     Cufon("#content h1");
	 
 
		
	/* Submenu */
	var menu = {};

	menu.laatstGeopend = null;
	menu.timeoutTime = 2000;
	menu.timeout = null;
	
	menu.init = function()
	{		
		/* hover op li */
		$("ul#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
				{
					$("ul#menu>li>ul").hide();
					$("ul#menu>li").not(this).removeClass("hover");
					
					$(this).addClass("hover");
					$(">ul", this).hide().slideDown(300);									
				}
			},
			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();
    
    
});


