	
		/*************** No Spam ***************/
		$("a.escape").each(function () {
			var el = $(this);
			var p = el.text().split('∂');
			if (el.attr('rel') != '') el.attr('href', 'mailto:' + p[0] + '@' + el.attr('rel'));
			else el.attr('href', 'mailto:' + p[0] + '@' + p[1]);
			el.html(p[0] + '@' + p[1]);
		});
		
		$('input[type=submit], input[type=reset]').css('opacity', .85)
	
	$(function(){
			
		/*************** Smooth Scroll ***************/
		$('a[href*=#]').click(function () {
			if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
					var a = $(this.hash);
					a = a.length && a || $('[name=' + this.hash.slice(1) + ']');
					if (a.length) {
							var b = a.offset().top;
							$('html,body').animate({
									scrollTop: b
							}, 500);
							return false
					}
			}
		});
			
		/*************** Submit Hover Fade ***************/		
		$('input[type=submit], input[type=reset]').hover(function () {
			$(this).stop().fadeTo("slow", 1);
				}, function () {
			$(this).stop().fadeTo("slow", .85);
		});		
		
		/*************** Form Validation ***************/
		var container = $('#fehlermeldung');
		// validate the form when it is submitted
		var validator = $("#kontaktformular").validate({
			invalidHandler: function(form, validator) {
				var errors = validator.numberOfInvalids();
				errors: {$("#fehlermeldung").fadeIn("slow");}
				},
			errorContainer: container,
			errorLabelContainer: $("ul", container),
			errorElement: 'li',
			success: function(label) {
			// set &nbsp; as text for IE
			label.html("&radic;")
			},
			rules: {Anrede: "required", Telefon: {minlength: 3},  Telefax: {minlength: 3},  Nachricht: {minlength: 7}}
		});
		
		/*************** Link Printing in Print ***************/
		
    //Check to see if browser supports onbeforeprint (IE6, IE7 and IE8)
    if (window.onbeforeprint !== undefined) {
    //Since the browser is IE, add event to append link text before print
    window.onbeforeprint = ShowLinks;
            
    //Remove the link text since the document has gone to the printer
    window.onafterprint = HideLinks;
        }
        else {
            //The browser is not IE so attach a print style to append the link's text when printed
            $('head').append('<style type="text/css" media="print">a[href*="http://www."]:after { content: " (" attr(href) ")"; }</style>');
        }

    function ShowLinks() {
        $('a[href*="http://www."]').each(function() {
            //Store the link's original text in the jQuery data store               
            $(this).data("linkText", $(this).text());

            //Append the link to the current text
            $(this).append(" (" + $(this).attr("href") + ")");                
        });
    }

    function HideLinks() {
        $('a[href*="http://www."]').each(function() {
            //Restore the links text to the original value by pulling it out of the jQuery data store
            $(this).text($(this).data("linkText"));
        });
    }         
		
	});
	
	
	
	/*************** DropDown Navi ***************/	
	(function($){

		//cache nav
		var nav = $("nav");

		//add indicators and hovers to submenu parents
		nav.find("li").each(function() {
			if ($(this).find("ul").length > 0) {


				//show subnav on hover
				$(this).mouseenter(function() {
					$(this).find("ul").stop(true, true).slideDown();
				});

				//hide submenus on exit
				$(this).mouseleave(function() {
					$(this).find("ul").stop(true, true).slideUp();
				});
			}
		});
	})(jQuery);
	
	
	
		/*************** Accordion ***************/	
// Teaserboxen


$(document).ready(function() {
			$('a#teaser-button').click(function () {
            var el = $(this);
            //a.eureklasse mit der Klasse eures Hauptlinks ersetzen
			if ($("#boxes").is(":hidden")) {		//.subnavi mit der Klasse eurer Navi ersetzen die ausfahren soll
				$("#boxes").slideDown(1000);		//Die roten Zahlen bilden die Geschwindigkeit in ms
				el.text("Infoboxen ausblenden");
				el.removeClass("closed");
			} else {
				$("#boxes").slideUp(2000);
				el.text("Infoboxen einblenden");
				el.addClass("closed");
			}
			
			});
			
			if ($("#boxes").is(":hidden")) {
				$('a#teaser-button').text("Infoboxen einblenden").addClass("closed");;
			}
			
			//Bei mehreren Navigationen die ausfahren sollen einfach den oberen Code erneut einfügen und die Klassen anpassen
		});


//Content

jQuery(document).ready(function(){
	$('h4.toggler').click(function() {
		$(this).next().toggle('slow');
		return false;
	}).next().hide();
});

