
$(document).ready(function(){
						   
						   
jQuery.preloadImages = function(){
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}
$.preloadImages("../img/BG_what.jpg", "../img/BG_who.jpg", "../img/BG_contact.jpg");

$(".thumbs span img").fadeTo(1, 0.4); // This sets the opacity of the thumbs to fade down to 60% when the page loads

$(".thumbs span img").hover(function(){
		$(this).fadeTo(1, 1.0); // This should set the opacity to 100% on hover
		},function(){
		$(this).fadeTo(200, 0.4); // This should set the opacity back to 40% on mouseout
		})

		.click(function() {
		
		if($(this).parent().next().attr("tagName") == "DIV"){//alleen als er een div achter de thumb staat
			
		popup = $(this).parent().next().html();
		$(".popupcontent").html(popup);
		
		//$(this).stop().fadeTo(1, 0.4);
		
		/*$(this).animate({ 
        height: '1px',
		paddingTop: '35%'
		}, 150 , 
		function(){$(this).animate({ 
        height: '185px',
		paddingTop: '0%'
      	}, 150 , 
		function(){ */$(".popup").fadeIn("slow");
		/*});
		});*/
		$(".glidecontenttoggler").fadeOut("slow");//pager weg halen
		}
	}); 

$(".close img").click(function(){
		$(".popup").hide("slow");//close the popup window
		$(".glidecontenttoggler").fadeIn("slow");//pager terug

		}).hover(function(){
		$(this).attr("src", $(this).attr("src").split(".").join("MO."));
		}, function() {
		$(this).attr("src", $(this).attr("src").split("MO.").join("."));
	});


$(".swap").click(function(){//bij "who" veranderen foto on mouseover en click disabelen
		return false;
		}).hover(function(){
		psrc = $(".rightphoto img").attr("src");
		ptitle = $(".rightphoto div").html();
		tsrc = $(this).attr("href");
		ttitle = $(this).attr("title");
		$(".rightphoto img").attr("src", tsrc);
		$(".rightphoto div").html(ttitle);
		}, function() {
		$(".rightphoto img").attr("src", psrc);
		$(".rightphoto div").html(ptitle);
	});


featuredcontentglider.init({
	gliderid: "content", //ID of main glider container
	contentclass: "thumbs", //Shared CSS class name of each glider content
	togglerid: "p-select", //ID of toggler container
	remotecontent: "", //Get gliding contents from external file on server? "filename" or "" to disable
	selected: 0, //Default selected content index (0=1st)
	persiststate: false, //Remember last content shown within browser session (true/false)?
	speed: 500, //Glide animation duration (in milliseconds)
	direction: "rightleft" //set direction of glide: "updown", "downup", "leftright", or "rightleft"
	//autorotate: true, //Auto rotate contents (true/false)?
	//autorotateconfig: [3000, 2] //if auto rotate enabled, set [milliseconds_btw_rotations, cycles_before_stopping]
});





});
