Cufon.replace('h1')('h2')('h3')('h4')('h5')('a.nav', {hover: true})('a.taalnav', {hover: true});

$(document).ready(function(){
	
	
	$('#naam, #email').focus(function(){
		if($(this).val() == 'Naam' || $(this).val() == 'Email'){
			$(this).val('');
		}
	});
	$('#naam, #email').blur(function(){
		if($(this).val() == ''){
			$(this).val(($(this).attr('id')=='naam'?'Naam':'Email'));
		}
	});
	setBackground();
});


$(window).load(function(){
	setBackground();
});

$(window).resize(function(){
	setBackground();
});

function setBackground(){
	var windowheight 	= $(window).height();
	var windowwidth 	= $(window).width();
	var documentheight 	= $(document).height();
	var contentheight	= $('#main').height();
	
	if(contentheight > windowheight){
		toHeight = contentheight;
	}else{
		toHeight = windowheight;
	}
	
	$('#backgroundimage').css({
		height: toHeight ,
		width: windowwidth
	});
	
	$('#backgroundimage').find('img').css({
		height: toHeight,
		width: 'auto',
		marginLeft: -($(this).width()-($(this).width()%2))/2
	});	
	if( $('#backgroundimage').find('img').width() < windowwidth){
		$('#backgroundimage').find('img').css({
			width: windowwidth,
			height: 'auto',
			marginLeft: -($(this).width()-($(this).width()%2))/2
		});	
	}
}
