$(document).ready(function () {
	$('div.Elternteil ul li a').hover(function() {  
		if ($(this).is(':animated')) {
			$(this).addClass("active").stop().animate({width: "400px"}, {duration: 1000, easing: "jswing", complete: function() {$(this).children().children('.text_ref').fadeIn({duration: 900, easing: "jswing", complete: "callback"});} });	   
		} else {
			$(this).addClass("active").stop().animate({width: "400px"}, {duration: 1000, easing: "jswing", complete: function() {$(this).children().children('.text_ref').fadeIn({duration: 900, easing: "jswing", complete: "callback"});} });
		}
	}, function () {
		if( $(this).hasClass("energie") || $(this).hasClass("waldorf") ) {
			$(this).children().children('.text_ref').hide({duration: 900, easing: "jswing", complete: "callback"});
			$(this).removeClass("active").stop();
		} else {
			if ($(this).is(':animated')) {
				$(this).children().children('.text_ref').hide({duration: 900, easing: "jswing", complete: "callback"});
				$(this).removeClass("active").stop().animate({width: "50px"}, {duration: 1000, easing: "jswing", complete: "callback"});
			} else {
				$(this).children().children('.text_ref').hide({duration: 900, easing: "jswing", complete: "callback"});
				$(this).removeClass("active").stop(':animated').animate({width: "50px"}, {duration: 1000, easing: "jswing", complete: "callback"});
			}
		}
	});
	
	//Galerie 	
	GB_ANIMATION = true;
	
	$("a.greybox").live('click',function(e){
		e.preventDefault();
				var GB_frame_TOP = $(this).offset();
		var scrollTop = $(window).scrollTop();
		var t = this.title || $(this).text() || this.href;
		GB_show(t,this.href,520,700, scrollTop);
		return false;
	});
});
