$(document).ready(function(){
// Inline-Label in Formularfeldern
	$(".inline_labels .wrap").each(function(){
		var field = $(this).find("input");
		var label = $(this).find("label");
		
		if (field.val() != "") label.addClass("hastext");
		
		field.focus(function(){
			if (field.val() == "") label.addClass("focus");
		});

		field.keypress(function(){
			label.addClass("hastext");
		});
		
		field.blur(function(){
			if (field.val() == "") label.removeClass("focus").removeClass("hastext");
		});
	});
// aktiver Metanavi-Punkt
	$("#meta_navi a").each(function(){
		if (this.href == document.location.href) {
			$(this).addClass("act");
		}
	});
// aktiver Hauptnavi-Punkt
	$("#navi>ul>li>a").each(function(){
		if (document.location.href.indexOf(this.href)>-1) {
			var img = $(this).find("img")[0];
			img.src = img.src.replace("navi_","navi_act_");
		}
	});
// aktiver Subnavi-Punkt
	$("#subnavi a").each(function(){
		if (document.location.href.indexOf(this.href)>-1) {
			$(this).parent().addClass("open");
			$(this).addClass("open");
		}
		if (this.href == document.location.href) {
			$(this).addClass("act");
		}
	});
	$("#subnavi .open>ul").show();
// Flyout Hauptnavi
	$("#navi ul li").hover(
		function(){
			$(this).find("ul").show();
		},
		function(){
			$(this).find("ul").hide();
		}
	);
// Styles
	$("#aside dt").next().css("border","0");
	$(".intro").each(function(){
		if ($(this).find("p").text() == "") {
			$(this).html("<br/>").removeClass("intro");
		}
	});
});

