// JavaScript Document

function formatTitle(title, currentArray, currentIndex, currentOpts) {
	var str = '<div id="fb-title">' + title + '</div><div id="fb-buttons"><a href="javascript:;" onclick="$.fancybox.close();" id="fb-close">close</a>';
	if(currentIndex+1 != currentArray.length) {
		str += '<a href="javascript:;" onclick="$.fancybox.next();" id="fb-next">next</a>'; 
	}
	if(currentIndex > 0) {
		str += '<a href="javascript:;" onclick="$.fancybox.prev();" id="fb-prev">prev</a>';
	}
	str += '<div class="clear"></div></div>';
	return str;
}

$(document).ready(function() {
	$("#imgGallery a").fancybox({
		'titlePosition'		: 'inside',
		'overlayOpacity' 	: .8,
		'titleFormat'		: formatTitle,
		'showCloseButton'	: false,
		'showNavArrows'		: false,
		'autoDimensions'	: false,
		'width'         	: 820,
		'height'        	: 'auto',
	});
});
