(function ($) {

	$('document').ready(function(){
		
		$('a[rel*=lightbox]').lightBox({
			imageLoading: '/tl_files/peter_rust/img/lightbox-btn-loading.gif',
			imageBtnClose: '/tl_files/peter_rust/img/lightbox-btn-close.gif',
			imageBtnPrev: '/tl_files/peter_rust/img/lightbox-btn-prev.gif',
			imageBtnNext: '/tl_files/peter_rust/img/lightbox-btn-next.gif'
		})
		$('.layout_simpletable').children('tbody').children('.close').each(function(){
			$(this)
				.hide()
				.prev('tr')
					.children('td:first-child')
					.addClass('voices')
					.attr('title', 'Stimmen zu Peter Rust')
						.bind('click', function(){
							$('.open_voices').removeClass('open_voices')
							$(this).addClass('open_voices');
							var _this =  this;
							if($('.open').length >= 1) {
								$('.open').slideUp('slow', function(){
									$(this).removeClass('open').addClass('close')
									$(_this).parent('tr').next('tr').slideDown().removeClass('close').addClass('open')
								})
							}
							else {
								$(this).parent('tr').next('tr')
									.slideDown()
									.removeClass('close')
									.addClass('open')
							}
						})
		})

		$('.mod_navigation').find('ul.level_1 li').each(function(){
			if($(this).children('ul.level_2').length){
				var subMenu = $(this).children('ul.level_2')

				$(subMenu).css('left',$(this).position().left)
			}
		})

		
	});

})(jQuery);
