/**
*	Prepare form
**/
$(document).ready(function() 
{
	
	$('.section_list').each(function() { $(this).hide() });
	
	$('.section_title').click(
		function() {
			if ($(this).attr('class').indexOf('open') > 0)
			{
				$(this).removeClass('open');
				$(this).siblings(".section_list").hide();						  				
			}
			else
			{
				$(this).addClass('open');
				$(this).siblings(".section_list").show();						  
			}
		}
	);
	
	$( '#social' ).scrollFollow();
	
	var $elem = $('#content');
	$('#nav_down').click(
		function (e) {
			$('html, body').animate({scrollTop: $elem.height()}, 800);
		}
	);


	$('.content img').each(function() {
        var a = $('<a/>').attr({
									'class': 'lightbox-container',
									'alt': $(this).attr('alt'),
									'title': 'Klik om een vergroting te bekijken.',
									'href': ''+$(this).attr('src').replace('650_','')+''
								}); 
        $(this).wrap(a); 
	});

	
	if ($('a.lightbox-container').get(0))
	{
		Shadowbox.init({
			handleOversize:     "drag",
			handleUnsupported:  "remove",
			autoplayMovies:     false,
			modal: true
		});
	}
	
	if ($('[rel^=lightbox]').get(0))
	{
		Shadowbox.init({
			handleOversize:     "drag",
			handleUnsupported:  "remove",
			autoplayMovies:     false,
			modal: true
		});
	}	
	
	doCufon();
	  
});	

function doCufon()
{

	Cufon.replace('h1',{ textShadow: '0px -1px #1B445C' });
	Cufon.replace('h2',{ textShadow: '0px 2px #fff' });
	Cufon.replace('h3',{ textShadow: '0px 1px #49AFD2' });
	Cufon.replace('h4, h5',{ textShadow: '0px 1px #fff' });
	Cufon.replace('div.date span',{ textShadow: '0px -1px #1B445C' });
	Cufon.replace('div.taal span',{ textShadow: '0px -1px #1B445C' });	  
	Cufon.replace('div.label span',{ textShadow: '0px -1px #1B445C' });	  	
	Cufon.replace('h6',{ textShadow: '0px -1px #1B445C' });
	Cufon.replace('p.p_big',{ textShadow: '0px 1px #fff' });
	//Cufon.now();	
}


