$(document).ready(function() {	
		
	$("a.openfoto").fancybox({
		'padding'			:	1, 
		'transitionIn'		:	'elastic',
		'transitionOut'		:	'elastic',
		'speedIn'			:	300, 
		'speedOut'			:	300, 
		'titleShow'			:	false, 
		'overlayOpacity'	:	0.0, 
		'hideOnContentClick':	true, 
		'overlayShow'		:	true
	});
	$("a.openfotometitel").fancybox({
		'padding'			:	1, 
		'transitionIn'		:	'elastic',
		'transitionOut'		:	'elastic',
		'speedIn'			:	300, 
		'speedOut'			:	300, 
		'titleShow'			:	true, 
		'overlayOpacity'	:	0.0, 
		'hideOnContentClick':	true, 
		'overlayShow'		:	true
	});
	
	$("a.popupframe").fancybox({
		'padding'			:	0,
		'transitionIn'		:	'elastic',
		'transitionOut'		:	'elastic',
		'speedIn'			:	300, 
		'speedOut'			:	300,
		'width'         	: 	640,
		'frameWidth'       	: 	640,
		'height'        	:   'auto',
		'titleShow'			:	false, 
		'overlayOpacity'	:	0.0, 
		'hideOnContentClick':	false, 
		'overlayShow'		:	true,
		'overlayOpacity'    :  0.8, 
		'overlayColor'      : '#FFFFFF' 
	});
	
	//Netjes open en dicht schuiven
	$(".msg_head").click(function()
    {
		$(this).next("div.msg_body").slideToggle(300).siblings("div.msg_body").slideUp("slow");
    });

	
	
	// initialise plugins
	$('ul.sf-menu').superfish({ 
       delay:       1000,                            // one second delay on mouseout 
       animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
       speed:       'fast',                          // faster animation speed 
       autoArrows:  false,                           // disable generation of arrow mark-up 
       dropShadows: true                            // disable drop shadows 
    }); 


	$('.iframe-delta-0').attr({
	  allowtransparency: 'true'
	});
	
	//Netjes open en dicht schuiven
	$(".home_image").click(function()
    {
		$(this).next("div.home_tekst").slideToggle(300).siblings("div.home_tekst").slideUp("slow");
    });
		
		
	
   	//Thema pagina
	$(".thema_head").click(function()
    {
		$(this).next("div.thema_body").slideToggle(300).siblings("div.thema_body").slideUp("slow");
		//$(this).next("div.thema_datum").addClass("selected").siblings("div.thema_datum").removeClass("selected");
		//ankerSelected
		$(".ankerSelected").removeClass("selected");
		$(this).find(".ankerSelected").addClass("selected");
		
		$(".datumSelected").removeClass("selectedDatum");
		$(this).find(".datumSelected").addClass("selectedDatum");
	
    });
    
   // Rollover Thema pagina
   $(".thema_titel").hover(
      function () {
        $(this).addClass("rollover");
      }, 
      function () {
        $(this).removeClass("rollover");
      }
    );
    
  

	
 });
 
// Youtube afbeelding binnen halen
function getScreen( url, size )
{
  if(url === null){ return ""; }

  size = (size === null) ? "big" : size;
  var vid;
  var results;

  results = url.match("[\\?&]v=([^&#]*)");

  vid = ( results === null ) ? url : results[1];

  if(size == "small"){
    return "http://img.youtube.com/vi/"+vid+"/2.jpg";
  }else {
    return "http://img.youtube.com/vi/"+vid+"/0.jpg";
  }
  
  
}

