$(function() {
	$('#more-images').click(function(){
		if ($('#hotels-images-hidden').is(':visible')) {
			$('#hotels-images-hidden').animate(
				{
					height: 'hide'
				},
				{
					duration: 300,
					complete: function() { $('#more-images').text(getResource(language, 'PHOTOS_MORE')); }
				}
			);
		} else {
			$('#hotels-images-hidden').animate(
				{
					height: 'show'
				},
				{
					duration: 300,
					complete: function() { $('#more-images').text(getResource(language, 'PHOTOS_LESS')); }
				}
			);
		}
	});
	
	$('a[rel="hotels-images"]').fancybox({
		'showCloseButton': false,
		'titlePosition': 'inside',
		'titleFormat': formatHotelImageTitle
	});
	
	$('a[rel^="hotel_images_"]').fancybox({
		'showCloseButton': false,
		'titlePosition': 'inside',
		'titleFormat': formatHotelImageTitle
	});
});

function formatHotelImageTitle(title, currentArray, currentIndex, currentOpts) {
	return '<div id="hotel-image-title"><span><a href="javascript:void(0)" onclick="$.fancybox.close();">X</a></span>' + (title && title.length ? '<strong>' + title + '</strong>' : '' ) + getResource(language, 'IMAGE_TITLE') + ' ' + (currentIndex + 1) + ' of ' + currentArray.length + '</div>';
}


