$(document).ready(function(){
	/* -- Fade in thumbnail images -- */
	$('.images img').each(function() {
		// Hide the image
		$(this).hide().stop();

		// Create the image resource
		var $t  = $(this);
		var img = new Image();
		img.onload = function() {
			$t.fadeIn();
		}

		// Load the image
		img.src = $(this).attr('src');
	});

	initFancybox($('.fancybox'));

});

/**
 * Init fancybox on a jQuery element
 *
 * @author Ben Brughmans
 * @return void
 */
function initFancybox($el) {
	$el.fancybox({
		padding:0,
		titlePosition: 'over',
		overlayOpacity: 0.8,
		overlayColor: '#151613'
	});
}