function gallery_startup() {
	$('.gallery-subdir-header').click(function() {
		$(this).next().children('a').lightBox({
			imageLoading: '/data/images/lightbox-ico-loading.gif',
			imageBtnClose: '/data/images/lightbox-btn-close2.gif',
			imageBtnPrev: '/data/images/lightbox-btn-prev2.gif',
			imageBtnNext: '/data/images/lightbox-btn-next2.gif',
			containerResizeSpeed: 350,
			txtImage: 'Photo',
			txtOf: 'de'
		});
	//	$(this).next().children('a').each(function() { alert($(this).attr('href')); });
		gallery_click($(this).next().children('a').eq(0));
		return false;
	});
	//$('.gallery-dir').find('*').andSelf().css('border','none');
	$('.gallery-dir').hide();
	$('.gallery-dir:first')
		.slideDown('slow')
		.addClass('gallery-opened');
	$('.gallery-dir-header').click(function() {
		if($(this).next().hasClass('gallery-opened'))
			return false;
		$(this).next().addClass('gallery-opening');
	//	$(this).siblings('.gallery-opened').children('h3 span').hide();
		$(this).siblings('.gallery-opened').slideUp('slow',function() { //animate({height:'1'},'slow', function() {
			$(this).hide();
			//$(this).children('h3 span').show();
			$(this).css('height','auto');
			$(this).removeClass('gallery-opened');
		//	$(this).siblings('.gallery-opening').children('h3 span').hide();
			$(this).siblings('.gallery-opening').slideDown('slow',function() {
		//		$(this).children('h3 span').show();
			});
			$(this).siblings('.gallery-opening').addClass('gallery-opened')
			$(this).siblings('.gallery-opening').removeClass('gallery-opening');
		});
		return false;
	});

}

function gallery_click(item) {
	$(document).oneTime('500ms',function() {
		item.click();
	});
}


