$(document).ready( function()
{
	$('.nieuws-item a[title="item"]').click( function() 
	{
		$('.nieuws-content .nieuws-foto #imageviewer').hide();
		$('.nieuws-content').slideUp('normal');
		
		if( $(this).parent().find('.nieuws-content').is(":hidden"))
		{
			$(this).parent().find('.nieuws-content').slideDown("normal");
			$(this).parent().find('.nieuws-foto #imageviewer').show();
		}
	});
});


$(document).ready( function()
{
   $('.agenda-item a[title="item"]').click( function() 
	{
		$('.agenda-content .agenda-foto #imageviewer').hide();
		$('.agenda-content').slideUp('normal');
		
		if( $(this).parent().find('.agenda-content').is(":hidden"))
		{
			$(this).parent().find('.agenda-content').slideDown("normal");
			$(this).parent().find('.agenda-foto #imageviewer').show();
		}
	});
});

// Formulier loader
$(document).ready( function()
{
	$('a[title="inschrijfformulier"]').click( function()
	{
		// The href
		var href = $(this).attr('href');
		
		// Only create the form wrap if it doesn't exists
//		if( typeof $('.inschrijfformwrap').val() == 'undefined' )
//		{
//			$('body').prepend('<div class="inschrijfformwrap"><iframe width="400" height="475" frameborder="0" src="'+href+'"></iframe></div>');
//		}

		$('.inschrijfformwrap iframe').attr( 'src', href );
		$('.inschrijfformwrap').show();
		
		return false;
	});
});

function closer()
{
	$('.inschrijfformwrap').hide();
}
