/* CUFON
-------------------------*/
Cufon.replace('h1, h2, h3, .bulletsubtitlestyle', { fontFamily: 'Trebuchet MS' });

/* PRETTYPHOTO
-------------------------*/
$(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'fast', /* fast/slow/normal */
		padding: 40, /* padding for each side of the picture */
		opacity: 0.7, /* Value betwee 0 and 1 */
		showTitle: false, /* true/false */
		allowresize: true, /* true/false */
		counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square */
		hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
		modal: false, /* If set to true, only the close button will close the window */
		changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
		callback: function(){} /* Called when prettyPhoto is closed */
	});
});

/* TOGGLE (MEER INFORMATIE)
-------------------------*/
$(function(){

	$("div.collapse").each(function() {
		if (!$(this).next().next().hasClass("collapse")) {
			$(this).css({
				"margin-bottom": "20px"
			}).find("div.block").css({
				"margin-bottom": 0
			})
		}
	});

	$(".toggle_container").hide();
	
	$("span.trigger").click(function(){
		if ($(this).attr("active") == "true") {
			$(this).removeAttr("active");
			$(this).removeClass("active").next(".toggle_container").slideUp("slow");
		} else {
			$("span.trigger").removeClass("active").removeAttr("active");	
			$(this).attr("active", "true");
			$(".toggle_container").slideUp();
			$(this).addClass("active").next(".toggle_container").slideToggle("slow");
		}
	});
	//$("span.trigger").eq(0).click();
});

/* DOCK
-------------------------*/
$(function(){
	$('#dock').Fisheye( {
		maxWidth: 40,
		items: 'a',
		itemsText: 'span',
		container: '.dock-container',
		itemWidth: 50,
		proximity: 40,
		alignment : 'left',
		valign: 'bottom',
		halign : 'center'
	});

	// Reposition proximity on document resize
	$(document).data("height", $(document).height());
	$(document).data("init", true);

	$(document).bind("click mousemove", function() {
		if ($(this).height() != $(this).data("height")) {
			$(this).data("height", $(this).height());
			if (!$(this).data("init")) {
				$(window).triggerHandler("resize");
			} else {
				$(this).data("init", false);
			}
		}
	});

});
