// Auf geladenes Dokument warten
$(document).ready(function(){
	
	/* Plugins */
	$.getScript('/js/easing.js');
	
	/* ######################	Main Navigation		###################### */	
	// Cache Navigation
	var navigation	= $('ul#navigation li a');
	
	// BG Fade
	
	navigation.css('background-position', '-314px 0px');
	navigation.each(function(i){
		$(this).hover(
			function () {
				$(this).css('background-position', '-314px 0');
				$(this).stop().animate({
					backgroundPosition: '-157px 0px'
				}, 500 );
			},
			function () {
				$(this).stop().animate({
					backgroundPosition: '-1px 0px'
				},{
					duration: 500,
					complete: function(){
						$(this).css('background-position', '-314px 0');
					}
				});
			}
		);
	});
	
	/* ######################	Impressum		###################### */
	/*
	var active = 0;
	$('.imprint').click(function(){
		if(active == 0) {
			$.ajax({
				url: '/imprint.php',
				success: function(html){
			    	$('#content').append(html);
			    	active = 1;
			    	$('#imprint').animate({
			    		bottom: '180px'
			    	}, 1500, 'easeOutBounce');
			    }
			});
		}
		return false;

	});
	
	$('#imprint .close').live('click', function() {
		if(active == 1) {
			$('#imprint').animate({
				bottom: '-360px'
			}, 500, 'linear', function(){
				$('#imprint').remove();
				active = 0;
			});
			
		}
		return false;
		//$('#imprint').remove();
	});
	*/
	$('.imprint').fancybox({
		titleShow: false,
		overlayOpacity: 0.7,
		overlayColor: '#fff',
		hideOnContentClick: false,
		onStart: function(){
			$("#fancybox-wrap").addClass('imprint');
		},
		onClosed: function() {
			$("#fancybox-wrap").removeClass('imprint');
		}
		
	});
	
	/* ######################	Sonstiges		###################### */
	$("a[href='#']").click(function(){
		return false;
	});
});