$(document).ready(function() {
	
	// Bundeslaender Karte 
	if ($('div.blKarte map').length > 0) {

		var absImgPath = '../../../../Inhalt/Bilder/Metanavigation/weg_zu_uns/';
		var swapImg = $('div.blKarte img');
		$('div.blKarte map area').each(function(){
			
			$(this).mouseover(function(){
				var ref = $(this).attr('id').replace("map","").toLowerCase();
				var src = absImgPath+"weKarte-karte-"+ref+".gif";
				swapImg.attr('src',src); 
			});
			
			$(this).mouseout(function(){
				var src = absImgPath+"weKarte-karte.gif";
				swapImg.attr('src',src); 
			});
		});
	}


	// initialize scrollable 
	$("div.scrollable").scrollable({ 
		size: 1 
	}); 
	
	$("#topteaser.home .topteaserContent .tabBox .tabNavigation").show();
	
	$("ul.tabNavigation").tabs("div.panes > div", {
		// enable "cross-fading" effect 
        effect: 'fade',			
		fadeInSpeed:700,	
        // start from the beginning after the last tab 
        rotate: true
	}).slideshow({
		autoplay: true,
		autopause:true,
		interval:7000
	});
	
	 var nav = new DickerFisch('#mainNavigation ul', {
		NavTimeout: 100
	});

// DropDown Navigation

	if($("ul.dropdownBox li")) {
		$("ul.dropdownBox li").hover(function() {
			$(this).css("position","relative");
			elem = $(this).find("span");
			$(elem).css("position","absolute");
			$(elem).fadeIn("fast");
			$(this).children("a").attr("class","active");	
                       $(this).prev().prev().css("background-image","none");
		}, function(){	
			$($(this).find("span")).css("display","none");
			$($(this).find("span")).css("position","static");	
			$(this).css("position","static");
			$($(this).find("span")).hide("fast");
			$($(this).find("a")).attr("class","inactive");
			$($(this).find("span")).attr("class","item");
                        $(this).prev().prev().css("background-image","url(../../styles/Bilder/bg_dropdown_li.gif)");
		})
	}

// Separator des letzten Navi-Elements entfernen (statt Klasse ".last")

    $("#navigation .nav li:last").css("background-image","none");   



//Mehr Link im Top Teaser erzeugen

if($(".topteaserContent").is("div")) {
	$(".tabText").each(function() {
		$(this).append("<a href='" + $(this).children("h2").children("a").attr("href") + "' class='more'> </a>")
	})
}
	
});


