$(document).ready(function(){
	
	//Navigation scroll page
	$('.scrollPage').click(function() {
		var elementClicked = $(this).attr("href");
		var destination = $(elementClicked).offset().top;
		$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-20}, 500 );
		return false;
	});
	
	
	//Work hover effects	
	$(".work a").hover(function(){
		$(this).prepend($("<span class='work_hover'></span>"));
		$(this).children("img").fadeTo("fast", 0.2);

	},function(){
		$(this).find("span:first").remove();
		$(this).children("img").fadeTo("fast", 1.0);
	});
	
	// Tweets
	$(".tweet").tweet({
		username: "madsrasmussen",
		avatar_size: 24,
		count: 3,
		loading_text: "loading tweets...",
	});
			
	// Show work details with fancyBox
	$(".single_image").fancybox({
		'transitionIn'			:	'bounce',
		'transitionOut'			:	'bounce',
		'speedIn'				:	600,
		'speedOut'				:	200,
		'overlayShow'			:	true,
		'hideOnContentClick'	:	false,
		'autoDimensions'		: 	false,
		'width'         		:	'auto',
		'height'        		: 	'auto',
		'scrolling'				: 	'no',
		'padding'				: 	5,
		'autoScale'				:  	false,
		'overlayOpacity'		:	0.5,
		'overlayColor'			:	'#000000',
		'titleShow'				: 	false
	});
});
