$(function() {
	$('a.gallery-item-thumbnail').fancybox({
		titlePosition: 'inside'
	});
	
		// Change the header area images to hide img tags and replace with divs, so we get nice rounded corner images
	if (!($.browser.msie && $.browser.version <= 8)) {
		$(".picturebox img, .gallery-item img").each(function() {
			var $img = $(this),
				w = $img.attr('width'),
				h = $img.attr('height'),
				src = $img.attr('src'),
				alt = $img.attr('alt');
			$(this).hide().after('<div class="img"></div>') ;
			$(this).next('div.img').css({
				width: w,
				height: h,
				backgroundImage: 'url(' + src + ')'
			}).attr('title', alt) ;
		});
	}
}) ;
