// fce_accordeon

function initSections() {
	
	// check for fe-edit of typo3 and disable hidingg
	// if ( $(".frontEndEditIcons").length = 0 ) { 
		$('.fce_accordeon .a_content').hide(); 
		// add link
		$('.a_teaser h3').wrapInner('<a class="fce_accordeon_toggle"><\/a>');
		$('.a_teaser h4').wrapInner('<a class="fce_accordeon_toggle"><\/a>');
		$('.a_teaser h5').wrapInner('<a class="fce_accordeon_toggle"><\/a>');	
		// onclick function
		$('a.fce_accordeon_toggle').click(function(){
			$(this).parent().parent().next().slideToggle('normal');
		});
	// }
}
	



$(document).ready(function() {

	jQuery(function(){
		jQuery('ul#m1').superfish();
	});
	
	// open rss feed in new window
	$("#pagefunc .rss a").attr("target","_blank");  
	
	// open sponsors in new window
	$("#sponsoring a").attr("target","_blank");  
	$("a.i62").attr("target","_blank");  
	$("a.i63").attr("target","_blank");  
	
	// remove first tt-news image
	// remove images if only one
	$(".news-single-img a img:first").parent().next("p").remove();
	$(".news-single-img a img:first").parent().remove();
	
	var newsImageCounter = 0
	$(".news-single-img a img").each(function(){
		newsImageCounter++;
		if(newsImageCounter > 3) {
			$(this).hide();
		}
	});
	
	if(newsImageCounter == 0) {
		$(".news-single-img").prev().remove();
		$(".news-single-img").next().remove();
		$(".news-single-img").next().remove();
		$(".news-single-img").remove();
	}
	
	// bind slider
			jQuery(window).bind("load", function() {
			jQuery("div#hp_content_slider").codaSlider()
		
			var autoSlide = setInterval(function()  {  
    				$("#right-link").click();  
			}, 5000);     
	
    	// ADDED BY ALEXANDER BRAUN
			// move all news link
			//$(".news-latest-gotoarchive").parent().parent().find(".stripNavControlbar").append('<div class="stripNavAll"><a href="' + $(this).attr("href") + '">alle News...</a></div>');
			$(".news-latest-gotoarchive").parent().parent().find(".stripNavControlbar").append('<div class="stripNavAll"><a href="/index.php?id=16">alle News...</a></div>');
			
		});
		
	// fce-accoredon	
	initSections();
});

