(function($) {
	function repositionBackground() {
		var new_x;
		if ($('body').width() < 1050) {
			new_x = '-256px'; /* 1566 - 1050 / 2 */
		} else {
			new_x = '50%';
		}
		if ($.browser.msie) {
			$('#wrapper').css('background-position-x', new_x);
		} else {
			var background_positions = $('#wrapper').css('backgroundPosition').split(' ');
			background_positions[0] = new_x;
			$('#wrapper').css('backgroundPosition', background_positions.join(' '));
		}
	}
	
	$(document).ready(function() {
		if (swfobject.hasFlashPlayerVersion('9.0.124')) {
			swfobject.embedSWF('/fileadmin/templates/html/flash/swfloader.swf?20100218', 'page', '100%', '100%', '9.0.124', null, {
				fvSwfUrl: '/fileadmin/templates/html/flash/site.swf',
				fvCountdownDate: '2009/11/10 16:00:00',
				fvContentServiceUrl: '/?type=11',
				fvAdditionalContentServiceUrl: '/?type=12',
				fvHighlightsServiceUrl: '/index.xml',
				fvMailingServiceUrl: '/nieuwsbrief/index.xml',
				fvHomepageServiceUrl: '/tekst/index.xml'	
			}, {}, {});
		} else {
			$('#timer').fadeIn(1000);
			
			/* Reposition background on resize */
			$.browser.msie ? '' : repositionBackground();
			$(window).bind('resize', repositionBackground);
			
			/* Right images/thumbnails behaviors */
			$('#right ol.images li:gt(0)').hide();
			$('#right ol.thumbnails li').each(function(index) {
				$('a', this).bind('click', function(evt) {
					$('#right ol.images li').hide();
					$('#right ol.images li:eq('+index+')').show();
					evt.preventDefault();
				});
			});
		}
	});
})(jQuery);
