// when the DOM is ready
$(document).ready(function() {
	$('img').css('opacity', 0);
});


// when everything is loaded
$(window).load(function() {
	
	$('img').each(function(n) {
		var $this = $(this);
		
		setTimeout(function() {
			$this.animate({'opacity':1});
		}, n*100);
	})
	
	// slideshow setup
	if( $('.slideshow').length > 0 ) {
		$('.slideshow').cycle({
			fx: 'fade',
			pager: '.slideshow-container .navi ul',
			slideExpr: '.slide',
			pagerAnchorBuilder: function(idx, slide) {
				return '<li><a href="#">&nbsp;</a></li>';
			}
		});
	}
});