$(document).ready(function() {

	// IE7 image align bugfix
	$('img[align=right]').addClass('image-right');
	$('img[align=left]').addClass('image-left');

	// Pagina's uit submenu
	$('#main #bottom .right #submenu a').fancybox({
		zoomSpeedIn: 300,
		zoomSpeedOut: 300,
		centerOnScroll: true,
		overlayOpacity: 0.8,
		overlayColor: '#000000',
		titleShow: false,
		type: 'iframe',
		width: 640,
		height: 520,
		padding: 27,
		onStart : function(e) {
			this.href = '/frame/page.php?id=' + $(e).attr('id');
		},
		onComplete : function(e) {
			if (window.location.pathname == '/restaurant/') {
				$('#fancybox-content').append('<div id="reserveren"><div><a href="javascript:void(0)">reserveren</a></div></div>');

				$('#reserveren').fancybox({
					zoomSpeedIn: 300,
					zoomSpeedOut: 300,
					centerOnScroll: true,
					overlayOpacity: 0.8,
					overlayColor: '#000000',
					titleShow: false,
					type: 'iframe',
					href: '/frame/formulier.php?type=reserveren&id=' + $(e).attr('id'),
					width: 640,
					height: 520,
					padding: 27
				});
			}
		}
	});
	
	// Reserveren
	$('.reserveren a').fancybox({
		zoomSpeedIn: 300,
		zoomSpeedOut: 300,
		centerOnScroll: true,
		overlayOpacity: 0.8,
		overlayColor: '#000000',
		titleShow: false,
		type: 'iframe',
		width: 640,
		height: 520,
		padding: 27,
		onStart : function(e) {
			this.href = '/frame/formulier.php?type=reserveren&id=' + $(e).attr('id');
		}
	});

	// Informatie
	$('.informatie a').fancybox({
		zoomSpeedIn: 300,
		zoomSpeedOut: 300,
		centerOnScroll: true,
		overlayOpacity: 0.8,
		overlayColor: '#000000',
		titleShow: false,
		type: 'iframe',
		width: 640,
		height: 520,
		padding: 27,
		onStart : function(e) {
			this.href = '/frame/formulier.php?type=informatie&id=' + $(e).attr('id');
		}
	});
	
	// Tarieven bowling
	$('.button a').fancybox({
		zoomSpeedIn: 300,
		zoomSpeedOut: 300,
		centerOnScroll: true,
		overlayOpacity: 0.8,
		overlayColor: '#000000',
		titleShow: false,
		type: 'iframe',
		width: 640,
		height: 520,
		padding: 27,
		onStart : function(e) {
			this.href = '/frame/page.php?id=' + $(e).attr('id');
		}
	});

});
