
function initDesign()
{
	$.each( $('#c_refs li a'), function()
	{
		$(this).data( 'title', $(this).html() ).fancybox({
			'titlePosition'  : 'inside' 
        });
	});


	$('#c_refs li').bind("mouseenter", function()
	{		
		$(this).find('h4').animate({
			opacity: 0.8,
			bottom: 0
		}, 300);

		if( !$(this).find('img').hasClass('over') )
		{
			$(this).find('img').clone().appendTo(this).addClass('over');
		}		

		$(this).find('img.over').animate({
			opacity: 0
		}, 0).animate({
			opacity: 1
		}, 300);

	}).bind("mouseleave", function()
	{
		$(this).find('h4').animate({
			opacity: 0.8,
			bottom: -42
		}, 300);

		$(this).find('img.over').animate({
			opacity: 0
		}, 300);
	});

}

function initProduktion()
{
	$.each( $('#c_refs li a'), function()
	{
		$(this).data( 'title', $(this).html() ).fancybox({
			'titlePosition'  : 'inside'
		});
	});


	$('#c_refs li').bind("mouseenter", function()
	{		
		$(this).find('h4').animate({
			opacity: 0.8,
			bottom: 0
		}, 300);

		if( !$(this).find('img').hasClass('over') )
		{
			$(this).find('img').clone().appendTo(this).addClass('over');
		}		

		$(this).find('img.over').animate({
			opacity: 0
		}, 0).animate({
			opacity: 1
		}, 300);

	}).bind("mouseleave", function()
	{
		$(this).find('h4').animate({
			opacity: 0.8,
			bottom: -42
		}, 300);

		$(this).find('img.over').animate({
			opacity: 0
		}, 300);
	});

}

function initFAQ() {
    $("#faq").accordion({ autoHeight: false });
}

function initDigital() {
    $("#digital_faq").accordion({ autoHeight: false });
}

function initAktionen()
{
	$.each( $('#aktionen a'), function()
	{
		$(this).data( 'title', $(this).html() ).fancybox({
			'titlePosition'  : 'inside'
		});
	});
}

$(document).ready(function() {
	if( $("body").hasClass('design') ) {
		initDesign();
	} else if ( $("body").hasClass('faq') ) {
	   initFAQ();
    } else if ( $("body").hasClass('produktion') ) {
	   initProduktion();
	} else if ( $("body").hasClass('aktionen') ) {
	   initAktionen();
	} else if ( $("body").hasClass('distribution') ) {
	   initDigital();
	}
});

