
$(function () {
	
	// hide elements
	$('.more-info').hide();
	$('.description').hide();
	
	// define animation states
	var elementHide = {
		height: 'hide',
		opacity: 'hide'
	};
	var elementShow = {
		height: 'show',
		opacity: 'shoe'
	};
	
	
	// define and add links to toggle tournament info
	var textShow = 'Willst Du mehr &uuml;ber dieses Spiel / Tunier erfahren?';
	var textHide = 'Informationen &uuml;ber dieses Spiel / Tunier ausblenden.';
	$('span.more-info').before('<a href="#" class="toggle-info">' + textShow + '</a>');


	// navigation (jump to)
	$('a#jump-content').click(function() {
		$.scrollTo('#content', 1000);
		return false;
	});
	$('a#cta').click(function() {
		$.scrollTo('#bericht', 1000, {offset: -20});
		return false;
	});


	// toggle additional info and link content
	$("a.toggle-info").click().toggle(function(){
		$(this).empty().append(textHide);
		$(this).next().animate(elementShow, 200);
	}, function() {
		$(this).empty().append(textShow);
		$(this).next().animate(elementHide, 200);
	});
	
	// toggle descriptions in timetable
	$(".title a").click().toggle(function(){
		$(this).toggleClass('toggle');
		$(this).parent().next().animate(elementShow, 200);
	}, function() {
		$(this).toggleClass('toggle');
		$(this).parent().next().animate(elementHide, 200);
	});
	
	$('#gallery a').lightBox();

});
