/*
current page highlight for top menu: #nav
default page (eg index.php) needs to be specified
requires js/jquery.url.packed.js (as well as jquery library)
*/
	$(function(){
		$page = jQuery.url.attr("file");
		if(!$page) {
			$page = 'index.php';
		}
		$('#nav li a').each(function(){
			var $href = $(this).attr('href');
			if ( ($href == $page) || ($href == '') ) {
				$(this).addClass('selected');
			} else {
				$(this).removeClass('selected');
			}
		});
	});

/*
fancyzoom for image gallery
*/
$(document).ready(function() {	
			$("a.img-zoom").fancybox({
				'zoomSpeedIn'		:	500,
				'zoomSpeedOut'		:	500,
				'overlayOpacity'	:	0.7,
				'overlayShow'		:	true,
				'hideOnContentClick':   true,
				'titlePosition' 	:   'over',
				'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>'; }

			});
		});
