// Funktion die den Titel der Fancybox der Optik von Lightbox anpasst
function formatTitle(title, currentArray, currentIndex, currentOpts) {
	return '<div id="map-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img style="border:none;" src="/images/closelabel.gif" /></a></span></div>';
}


function appendFancybox() {
	$('.mapLink').fancybox({
		'showCloseButton'	: false,
		'titlePosition' 	: 'inside',
		'titleFormat'		: formatTitle,
		'width'				: '525px',
		'height'			: '515px',
		'type'				: 'ajax',
		'centerOnScroll'	: true,
	});

	$('.cartLink').click(function() {
		var phone = $(this).attr('phone');
		if($(this).attr('href') == '') {
			showInfo(phone);
			return false;
		}
	});

	$('.scheduleLink').click(function() {
		var phone = $(this).attr('phone');
		if($(this).attr('href') == '') {
			showInfo(phone);
			return false;
		}
	});
}

function showInfo(phone) {
	$.fancybox(
		'<div><br/><br/>Leider besitzt dieses Kino keine eigene Website.<br/><br/>Kartenbestellungen k&ouml;nnen Sie unter der Telefonnummer<br/><br/><center><b>' + phone + '</center></b><br/>aufgeben.<br/><br/><br/><br/></div>',
		{
			'showCloseButton'	: false,
			'titlePosition' 	: 'inside',
			'titleFormat'		: formatTitle,
			'centerOnScroll'	: true,
		}
	);
}

$(document).ready(function() {
	appendFancybox();
});

