
function trace(msg) {
	if (navigator.userAgent.indexOf('Safari') > -1) {
		console.log(msg);
	}
}

$(document).ready(function() {

	//
	// slide out / slide in function
	//
	
	var currentSection = $('#secretSection').text();

	if (currentSection == undefined || currentSection == '') {
		$('.navSection ul').hide();
	} else {
		$('.navSection').not('.' + currentSection).find('ul').hide();
	}
	
	
	$('.navSectionTitle').hover(function() {
		$(this).css({backgroundColor: '#ccc'});
	}, 	function() {
		trace('unhover');
		$(this).css({backgroundColor: '#fff'});
	});
	

	$('.navSectionTitle').css({cursor: 'pointer'});
		
	$('.navSectionTitle').click(function(){
		if ($(this).parent().find('ul').is(":hidden")) {
			$('.navSection ul').slideUp(200);
			$(this).parent().find('ul').slideDown(200);
		} else {
			$(this).find('ul').slideUp(200);
		}
	});
	
	//
	// lightbox
	//
	
	$('.gallery_row a:first-child').lightBox({
		fixedNavigation: true,
		imageBtnPrev:  '_system/js/jquery-lightbox/images/prev.png',
		imageBtnNext:  '_system/js/jquery-lightbox/images/next.png',
		imageBtnClose: '_system/js/jquery-lightbox/images/nf.close.png',
		txtOf: '/'
	});
		
});
