function formatTitle(title, currentArray, currentIndex, currentOpts) {
	/* address = 'http://' + $_SERVER['SERVER_NAME'] + $_SERVER['PHP_SELF'] + '../../scripts/fancybox/closelabel.gif'; */
	address = document.URL + '/../scripts/fancybox/closelabel.gif';
    return '<div id="screenshot-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img alt="Close" src="' + address + '" /></a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + 'Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</div>';
}


$(document).ready(function() {

	/* This is basic - uses default settings */
	
	$("a.preview__").attr('rel', 'gallery').fancybox();
	
	/* Using custom settings */
	
	$("a#inline").fancybox({
		'hideOnContentClick': true
	});

	$("a.preview").attr('rel', 'gallery').fancybox({
		'showCloseButton'	: false,
		'titlePosition' 	: 'inside',
		'titleFormat'		: formatTitle,
		'cyclic'			: true,
		'overlayOpacity'	: 0.6,
		//'overlayColor'		:'#fcfcfc'
		'overlayColor'		:'#333'
	});
});