$(document).ready(function(){
	checkLinks();
	oldGigs();
	
	$('li.info').click(function(){
		$('#content').animate({'left': -1039}, 800);
	});
	
	$('li.neues').click(function(){
		$('#content').animate({'left': 0}, 800);
	});
	
	$('li.album').click(function(){
		$('#content').animate({'left': -2078}, 800);
	});
	
	$('li.photos').click(function(){
		$('#content').animate({'left': -3118}, 800);
	});
	
	$('li.live').click(function(){
		$('#content').animate({'left': -4157}, 800);
	});
	
	$('h1').click(function(){
		$('#content').animate({'left': 1039}, 800);
	});
	
	$('span.imprint').click(function(){
		$('#content').animate({'left': -5193}, 800);
	});
	
	$('#show-all-gigs').click(showGigs);
	
	$(function() {
		$('.lightbox').lightBox();
	});
	
	function checkLinks()
	{
		if(window.location.hash == "#album")
		{
			$('#content').animate({'left': -2078}, 800);
		}
		
		if(window.location.hash == "#live")
		{
			$('#content').animate({'left': -4157}, 800);
		}
		
		if(window.location.hash == "#neues")
		{
			$('#content').animate({'left': 0}, 800);
		}
		
		if(window.location.hash == "#photos")
		{
			$('#content').animate({'left': -3118}, 800);
		}
		
		if(window.location.hash == "#info")
		{
			$('#content').animate({'left': -1039}, 800);
		}
	}
	
	$(function(){
		$('a.new-window').click(function(){
			window.open(this.href);
			return false;
		});
	});	
	
	$('.all-news').click(function()
	{
		
		if($(this).hasClass('active'))
		{
			$('.neues .hidden').slideUp();
			$(this).removeClass('active');
		}
		
		else
		{
			$('.neues .hidden').slideDown();
			$(this).addClass('active');
		}
	});
	
	function oldGigs()
	{
		var number = $('.live ol li').length;
		
		$('.live ol li').each(function()
		{
			$(this).prepend(number + ': ');
			number--;
		});
	}
	
	function showGigs()
	{
		if(!$('.live ol').hasClass('show-all-gigs'))
		{
			$('.live ol li').each(function()
			{
				if(!$(this).hasClass('show'))
				{
					$(this).slideDown();
				}
			});
			
			$('#show-all-gigs').slideUp();
		}
	}
});