$(document).ready( function() {
	$("#navigation li a").click( function(event) {
		if ($(this).parent().children("ul").length != 0) {
			event.preventDefault();
			$("#navigation li ul:visible").slideUp();
			if ($(this).parent().children("ul").is(":hidden")) {
				$(this).parent().children("ul").slideToggle('normal');
			}
		}
	})
	
	$(".appointment-wrapper h3").click( function() {
		$(".appointment-content-wrapper:visible").slideUp();
		if ($(this).parent().children(".appointment-content-wrapper").is(":hidden")) {
			$(this).parent().children(".appointment-content-wrapper").slideToggle('normal');
		}
	});
	
	$("#wrapper-footer #searchform input[type=text]").focus( function() {
		$(this).css('color', '#666');
		
		switch ($(this).val()) {
			case "Suchbegriff eingeben":
				$(this).val('');
				break;
		}
	});

	$("#wrapper-footer #searchform input[type=text]").blur( function() {
		$(this).css('color', '#999');
		
		switch ($(this).val()) {
			case "":
				$(this).val('Suchbegriff eingeben');
				break;
		}
	});

	$("input#newsletter-email").val('Ihre E-Mail-Adresse');
	$("input#newsletter-email").focus( function() {
		$(this).css('color', '#666');
		
		switch ($(this).val()) {
			case "Ihre E-Mail-Adresse":
				$(this).val('');
				break;
		}
	});

	$("input#newsletter-email").blur( function() {
		$(this).css('color', '#999');
		
		switch ($(this).val()) {
			case "":
				$(this).val('Ihre E-Mail-Adresse');
				break;
		}
	});


	$(".gallery a").fancybox();
	$(".gallery-caption:empty").remove();
	
});

