$(function() {
		   
	/* Formulier */
	$(".formmodule input, .formmodule textarea").focus(function(){	$(this).addClass("focus");	});
	$(".formmodule input, .formmodule textarea").blur(function(){	$(this).removeClass("focus");	});
	
	$(".formmodule input.button").hover(
		function()	{	$(this).addClass("hover");		},
		function()	{	$(this).removeClass("hover");	}
	);
	
	/* submenu effectje en timeout */
	Menu.apply("#menu > ul > li");
    	
	/* Zoekfunctie || Wij werken voor */
	$("#zoekformulier, .wij_werken_voor ul li").hover(
		function()	{	$(this).addClass("hover");		},
		function()	{	$(this).removeClass("hover");	}
	);
	
	$("#zoekformulier>fieldset>input")
		.focus(function()	{
			$(this.parentNode.parentNode).addClass("hover2");
		})
		.blur(function()	{
			$(this.parentNode.parentNode).removeClass("hover2");
		});
	
	/* Cycle projecten in uitvoering */
	$('.projecten_in_uitvoering ul').cycle({
        fx		: 'scrollHorz',
        speed	: 'slow',
        timeout	: 7000,
        pager	: '#nav',
		pause	: 1
    });
    
    /* Cycle enkele referenties */
    $('ul.enkele_referenties').cycle({
    	fx		: 'scrollHorz',
    	speed	: 'slow',
    	timeout	: 5000,
    	pager	: '#nav',
    	pause	: 1
    });
	
	// default value bij formulieren
	$("input:text[title], textarea[title]").each(function() { 
		$(this).defaultvalue( $(this).attr("title") );
	});
	
	// Vlakken bij websites overzicht pagina gelijke hoogte geven
	(function($)
	{
	  $.fn.maxHeight = function() {
	
		var max = 0;
	
		this.each(function() {
		  max = Math.max( max, $(this).height() );
		});
	
		return max;
	  };
	})( jQuery );
	$('#dienstenoverzicht li').height($('li').maxHeight() + 'px');
	
});


Cufon.replace('.projecten_in_uitvoering h3, \
			  .maincontent .intro_pagina_kop p, \
			  .maincontent h2, \
			  #footer .balk h3, \
			  .wij_werken_voor h3, \
			  .three_buckets h3, \
			  #twitter h3, \
			  .uitgelicht h3');

/*sIFR.replaceElement(named({ sSelector:".projecten_in_uitvoering h3", sFlashSrc: submap+"/fla/dinregular.swf", sColor:"#000000", sBgColor:"#FFFFFF", sWmode:"transparent" }));
sIFR.replaceElement(named({ sSelector:".home .maincontent h2", sFlashSrc: submap+"/fla/dinregular.swf", sColor:"#000000", sBgColor:"#FFFFFF", sWmode:"transparent" }));
sIFR.replaceElement(named({ sSelector:".maincontent .intro_pagina_kop p", sFlashSrc: submap+"/fla/dinregular.swf", sColor:"#e57b07", sBgColor:"#FFFFFF", sWmode:"transparent" }));
sIFR.replaceElement(named({ sSelector:".maincontent h2", sFlashSrc: submap+"/fla/dinregular.swf", sColor:"#FFFFFF", sBgColor:"#333333", sWmode:"transparent" }));
sIFR.replaceElement(named({ sSelector:"#footer .balk h3", sFlashSrc: submap+"/fla/dinregular.swf", sColor:"#FFFFFF", sBgColor:"#333333", sWmode:"transparent" }));
sIFR.replaceElement(named({ sSelector:".wij_werken_voor h3", sFlashSrc: submap+"/fla/dinregular.swf", sColor:"#FFFFFF", sBgColor:"#333333", sWmode:"transparent" }));
sIFR.replaceElement(named({ sSelector:".three_buckets h3", sFlashSrc: submap+"/fla/dinregular.swf", sColor:"#FFFFFF", sBgColor:"#333333", sWmode:"transparent" }));
sIFR.replaceElement(named({ sSelector:"#twitter h3", sFlashSrc: submap+"/fla/dinregular.swf", sColor:"#FFFFFF", sBgColor:"#333333", sWmode:"transparent" }));
sIFR.replaceElement(named({ sSelector:".uitgelicht h3", sFlashSrc: submap+"/fla/dinregular.swf", sColor:"#FFFFFF", sBgColor:"#333333", sWmode:"transparent" }));*/

function header_film( pagina )
{
	var s1 = new SWFObject(submap +"/fla/header_film.swf", "single", "704", "250", "8");
	s1.addParam("allowfullscreen","false");
	s1.addParam("menu","false");
	s1.addParam("wmode","transparent");	
	s1.addVariable("bestand", submap +"/fla/header_film/"+ pagina);			
	s1.write($(".header_film")[0]);	
}

/** 
 * jquery.defaultvalue 
 * @param	string	defaultvalue
*/
$.fn.defaultvalue = function( defVal )
{
	return this.each(function()
	{
		var $input = $(this);
		if($input.val() == "" || $input.val() == defVal)
		{
			$input.addClass("defaultvalue").val(defVal);
		}
		
		$input
			.focus(function() {
				if($input.val() == defVal) 
					$input.val("").removeClass("defaultvalue");
			})
			.blur(function(){
				if($input.val() == "") 
					$input.addClass("defaultvalue").val(defVal);
			});
	});
};



