// stop BackgroundImageCache voor IE				
try	{ document.execCommand("BackgroundImageCache", false, true); } catch(e) { }

/**
 * variabelen met jQuery met een $ beginnen!!!
 */
$(function()
{
	/* submenu effectje en timeout */
	Menu.apply("#menu > li");
	
	/* Hover click */
	$("#nieuwsoverzicht li").hoverClick();
	
	/* Menu effectje */
	$("#menu > li:not(.actief)").each(function()
	{
		$("> a", this).append('<span class="hoverspan"></span>');
		
		$(this).hover(
		function()
		{
			var $a = $("> a > span", this);
			$a.data("bgleft", $a.css("background-position").split(" ")[0]).toString();
			$a.stop().animate({ height: 62, marginTop: 0, backgroundPosition: ($a.data("bgleft") +" 0") }, 400, "easeOutQuad"); 
		},
		function()
		{
			var $a = $("> a > span", this);
			$a.stop().animate({ height: 0, marginTop: 31, backgroundPosition: ($a.data("bgleft") +" -31px") }, 400, "easeOutQuad");	
		});
	});
	
	/* Formulier focus op velden */
	$(":input").not("input[type=button], input[type=submit], input[type=radio], input[type=checkbox]")
		.focus(function() 	{ $(this).addClass("veldfocus"); })
		.blur(function() 	{ $(this).removeClass("veldfocus"); });
		
    /* Carousel logo's */
	$("#logos .logos").jCarouselLite({
		visible		: 6,
		auto		: 500,
		speed		: 2000,
		easing		: 'easeOutQuad'
	});
	
	/* Animeer background externe links */
	$('#extern a')
		.css( {backgroundPosition: "0 -37px"} )
		.mouseover(function(){
			$(this).stop().animate(
				{backgroundPosition:"(0 0)"}, 500, 'easeOutQuad')
			})
		.mouseout(function(){
			$(this).stop().animate(
				{backgroundPosition:"(0 -37px)"}, 500, 'easeOutQuad')
			})
		
	/* Contact formulier, labeltekst in formulier zetten */
	var labeltekst = '';
	
	$(".formulier li").each(function()
	{
		// Als het listitem een label bevat dan uitvoeren
		if( $("label", this).length > 0 )
		{
			labeltekst = $("label", this).text();
			$(".label", this).hide();
			
			$("input[type=text], textarea", this).attr("title", labeltekst);
		}
	});
	
	// default value bij formulieren
	$("input:text[title], textarea[title]").each(function() { 
		$(this).defaultvalue( $(this).attr("title") );
	});
	
	// Check formulier
	
});

Cufon.replace('#menu > li:not(.actief) > a');
Cufon.replace('#topmenu a', {
	hover: true
});
Cufon.replace('h1, h2', {
	fontFamily: 'DIN-Regular'
});
Cufon.replace('#extern a', {
	hover: true,
	fontFamily: 'DIN-Regular'
});