$(document).ready(function() {
		
		$("input,textarea").focusin(function() {
			  $(this).parent().animate({
					opacity: 1.00
				  }, 300);
			});
		$("input,textarea").focusout(function() {
				if($(this).val() == 0 && !$(this).parent().hasClass("required")) {					
			  		$(this).parent().animate({
						opacity: 0.50
				  	}, 300);
				}
		});
			
/*		$("#tabLinks").tabs("#tabItems > li", {
			effect: "fade",
			speed: 400,
			tabs: "li"
			}, function(){
				
					$(".text").fadeOut("slow");
			});*/
		
		$("#tabItems").scrollable({ 			
				circular: 		true,
				speed: 			1000,
				mousewheel: 	false,
				easing: 		"easeOutExpo"			
		}).navigator({
				navi: 			"#tabLinks",		
				naviItem: 		"li",		
				activeClass: 	"current"	
	
		})
		
		if(!$("#tabLinks li").hasClass("current")) {
			
			$("#tabLinks li:first-child").addClass("current");
			
		}

		
		$("#media").tabs("#media li", {
			effect: "fade",
			fadeInSpeed: 1500,
			fadeOutSpeed: 1500,
			rotate: true,
			tabs: "li"
			}).slideshow({
			autoplay: true,
			interval: 3000,
			autopause: false			
		});
			
			
		$(".tab .image").mouseenter(function() {
			$(".gallery", this).slideDown("fast");
		});
		$(".tab .image").mouseleave(function() {
			$(".gallery", this).slideUp("fast");
		});;

			
		Shadowbox.init({
			overlayOpacity: 0.9
		});
		
		
		$.tools.dateinput.localize("de", {
		   months: 			"Januar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember",
		   shortMonths: 	"Jan,Feb,Mär,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez",
		   days:         	"Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag",
		   shortDays:    	"Son,Mon,Die,Mit,Don,Fre,Sam"
		});
		
		$(":date").dateinput({
			
			format: 	"dd.mm.yyyy, dddd",
			firstDay:	1,
			lang:		"de",
			min:		0,
			trigger:	true

		});

		$(":date:first").data("dateinput").change(function() {		
			$(":date:last").data("dateinput").setMin(this.getValue(), true);
		});
			

});


