$(document).ready( function() {
	$('.slideContainer').nivoSlider({
		effect: 'fade', // Specify sets like: 'fold,fade,sliceDown'
	        slices: 15, // For slice animations
	        animSpeed: 700, // Slide transition speed
	        pauseTime: 5000, // How long each slide will show
	        directionNav: false, // Next & Prev navigation
	        directionNavHide: false, // Only show on hover
	        controlNav: false, // 1,2,3... navigation
	        keyboardNav: true, // Use left & right arrows
	        pauseOnHover: true, // Stop animation while hovering
	        manualAdvance: false // Force manual transitions
	});
	
	$('.tweetContainer').tweet5('.tweetContainer', {
		username: 'mickharren',
		numberOfTweets: 10, // 20=max
		showUsername: 'false',
		showUserAvatar: 'false',
		showTweetTime: 'true',
		showReplyButton: 'true',
		showRetweetButton: 'true',
		showLocation: 'true',
		replyButtonText: 'reply',
		retweetButtonText: 'retweet',
		iconColor: 'white', //black or white
		refreshTime: 60, // time in seconds, minimum is 60
		altPath: '/'
	});
	
	$("a[rel=fotogroep]").fancybox();
	
	$("a.ytLink").fancybox({
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	600, 
		'speedOut'		:	200,
		'width'			: 	640,
		'height'			: 	360,
		'type'			: 	'iframe'
	});
	
	$('.videoImg').each(function(){
		$(this).load(function() {
			var height = $(this).height();
			var restant = (parseFloat($(this).height()) - 86) / -2;
			$(this).css("margin-top",restant);
		});
	});
	
	$('.right .foto').each(function(){
		$(this).load(function() {
			var width = $(this).width();
			if(width < 176){
				$(this).css("width",176);
			} else {
				var restant = (parseFloat($(this).width()) - 176) / -2;
				$(this).css("margin-left",restant);
			}
		});
	});
});

