$(document).ready(function(){
	if( $("#navi").children().hasClass("active") == false)
	{
		$("#navi").children().animate({"background-color":"#0f1e46"},500);
		$("#navi").children().children().animate({"color":"#fff"},500);
	}
		
	$("#navi").children().hover(
		function(){
			if( $(this).hasClass("active") == false)
			{
				$(this).animate({"background-color":"#fff"},500);
				$(this).children().animate({"color":"#000"},500);
			}
		},
		function(){
			if( $(this).hasClass("active") == false)
			{
				$(this).animate({"background-color":"#0f1e46"},500);
				$(this).children().animate({"color":"#fff"},500);
			}
		}
	);
	
	$("#navi").children().click(function(){
		if( $(this).hasClass("active") == false)
		{
			$(".active").children().animate({"color":"#fff"},500);
			$(".active").animate({"background-color":"#0f1e46"},500).removeClass("active");
			$(this).addClass("active");
		}
	});
	
	$("a[rel=referenzen]").fancybox({
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
		return '<span id="fancybox-title-over">Referenz ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
    	}
	});
	
	$("a[rel=qr]").fancybox({
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
		return '';
		}
	});
});
