jQuery(document).ready(function($) {

function endless(item) {
  $(item).animate({"border-left-color": "#FF9900"}, 2000, "swing", function(){
    $(item).animate({"border-left-color": "##E20C00"}, 2000, "swing");
    endless(item);
  });
}

endless($(".alert"));

// Farbe beim hover jeweils auf den des jeweiligen Menüpunktes blenden
  $('#mainmenu li').hover(function() {
    var farbe = $(this).css('border-left-color');
    $('#farbe').stop().animate({ 'backgroundColor': farbe }, 1500);
  }, function() {
    var farbe = $('.active').css('border-left-color');
    $('#farbe').stop().animate({ 'backgroundColor': farbe }, 1500);
  });

// Bilderanimation
$('#Titelbild').cycle({
    timeout:       5000,  // milliseconds between slide transitions (0 to disable auto advance)
    speed:         1000,  // speed of the transition (any valid fx speed value)
    delay:         0000,     // additional delay (in ms) for first transition (hint: can be negative)
});

// FAQ Accordion

	$(function() {
		$( "#faq_accordion" ).accordion({
    			active: false,
			autoHeight: false,
                        animated: 'easeInOutQuart',
                        animated: 'easeOutExpo',
                        collapsible: true
		});
	});


// fancybox

  $("a.fancybox-image").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'	:	300, 
		'speedOut'	:	200, 
                'titlePosition' :	'inside'
  });

// Superfish für das obere Menü

  $("ul.sf-menu").superfish({
	    animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
            speed:       'fast',                          // faster animation speed 
            autoArrows:  false                           // disable generation of arrow mark-up 
  });

  $("p").addClass("hyphenate");

  Hyphenator.addExceptions('de','Pä-da-go-ge, Pä-da-go-gin, Pä-da-go-gik, pä-da-go-gisch');


  Hyphenator.run();

});

