$(function() {

	//picture fader for the 'home' and 'vervolg' pages
	var s1Images = $('#s1 img');
	s1Images.each(function(i) {
		if (i == 0) {
			return;
		}
		$(this)
			.data('src', $(this).attr('src'))
			.attr('src', '/img/blank.gif');
	});
	
	var s1counter = 1;
	$('#s1').cycle({ 
		fx:    'fade', 
		after: function() {
			var next = s1Images[s1counter++];
			if (next && !next.initialized) {
				$(next).attr('src', $(next).data('src'));
				next.initialized = true;
			}
		},
		speed:  2500,
		timeout: 5000 
	});
	 
	//opacity for the green bg box on the 'home'
	$('#main_content #content_bg').fadeTo(1, 0.80);
	 
	//picture scroller for the 'vervolg' pages
	$('#s2').cycle({ 
		fx:     'scrollHorz', 
		speed:  'slow', 
		timeout: 0, 
		next:   '#content div#photo_box_scroll .next', 
		prev:   '#content div#photo_box_scroll .prev' 
	});
	 
	$('#photo_box_scroll .zoom').hover(function() {
		var el=$(this);
		$(this).hide(100).delay(5000,function() {
			el.show(250);
		});
	});
	 
	
	$('#aannemers a').lightBox();
	$('#s2 a').lightBox();
});
