$(document).ready(function() {

	// Zufallsbild Startseite
	/*
	var RandomImages = ['bg-index.jpg', 'bg-willkommen.jpg', 'bg-jobs.jpg', 'bg-kontakt.jpg'];
	$('body#index').css({
	'background-image': 'url(img/' + RandomImages[Math.floor(Math.random() * RandomImages.length)] + ')'
	});
	*/

	// CSS-Styling

	$(".contentBox .projectOuterWrapper").each(function() {
		$(this).find(".projectBox:odd").css({
			"margin-right" : "0"
		});
	});
	
	
	
	// Accordion

	$('.fce-accordion-content').hide();
	//$('.fce-accordion-content:first').show();
	//$('.fce-accordion-headline:first').addClass('fce-accordion-focus');

	$('.fce-accordion-headline').bind('click', function() {

		if(!$(this).siblings('.fce-accordion-content').is(':visible')) {

			$('.fce-accordion-headline').removeClass('fce-accordion-focus');
			$('.fce-accordion-content').slideUp({
				duration : 400
			});

			$(this).siblings('.fce-accordion-content').slideDown({
				duration : 400
			});
			$(this).addClass('fce-accordion-focus');

		} else {
			$('.fce-accordion-headline').removeClass('fce-accordion-focus');
			$('.fce-accordion-content').slideUp({
				duration : 400
			});
		}

	});
	
	
	
	// Projekte

	$('.projectOuterWrapper .projectBox').hover(function() {

		$('.cover', this).stop().animate({
			top : '60px',
			opacity : '0.7'
		}, {
			queue : false,
			duration : 200
		});

		$('a', this).stop().animate({
			'padding-top' : '68px',
			opacity : '1'
		}, {
			queue : false,
			duration : 200
		});

	}, function() {
		$('.cover', this).stop().animate({
			top : '0',
			opacity : '0.5'
		}, {
			queue : false,
			duration : 300
		});

		$('a', this).stop().animate({
			'padding-top' : '90px',
			opacity : '0'
		}, {
			queue : false,
			duration : 200
		});

	});
	
});

