
$("html").addClass("js");

$(function() {
	function getImages() {
		return $("ul.gallery a").map(function() {
			return { href: this.href, title : this.title || $(this).text() };
			}).get();
	}
	
	function formatTitle(title, currentArray, currentIndex, currentOpts) {
		return "Afbeelding " + (currentIndex + 1) + " van " + currentArray.length + (title ? ": " + title : "");
	}
	
	var images = getImages();
	
	if (images.length) {
		$(".rounded img").click(function() {
			images = getImages();
			$.fancybox(images, {autoScale: true, type: 'image', titlePosition: 'inside', titleFormat: formatTitle});
		}).closest(".rounded").css("cursor", "pointer");
	}
});

