$(document).ready(function(){ 
        $("ul.sf-menu").supersubs({ 
            minWidth:    12,
            maxWidth:   35,
            extraWidth:  3     
        	}).superfish({ 
            animation: {height:'show'},   // slide-down effect without fade-in 
            delay:     800               // 1.2 second delay on mouseout 
        	});  

 
 $("a.fancybox").fancybox({
	'titlePosition'	:	'over',
	'hideOnContentClick': true,
	'transitionIn'	:	'elastic',
	'transitionOut'	:	'elastic',
	'speedIn'		:	600, 
	'speedOut'		:	200, 
	'overlayColor'	: "#FFF",
	'onComplete'	:	function() {
		$("#fancybox-wrap").hover(function() {
			$("#fancybox-title").show();
		}, function() {
			$("#fancybox-title").hide();
		});
	}
});
        


}); 

// menu animieren
$(document).ready(function () {  
    var name = "#menu";  
    var menuYloc = null;  
    var inhaltheight=$("#inhalt").css("height");
    var menuheight=$("#menu").css("height");
    var menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))  
	var maxheight=parseInt(inhaltheight)-parseInt(menuheight);

       $(window).scroll(function () {  
           var offset = menuYloc+$(document).scrollTop();  
           if (offset>=menuYloc) offset=$(document).scrollTop();
           if (offset<menuYloc) offset=menuYloc;
           if (offset>maxheight) offset=maxheight+menuYloc-5;

           //$(name).animate({top:[offset+"px", 'easeOutBounce']},{duration:700,queue:false});
           $(name).animate({top:[offset+"px", 'easeOutBack']},{duration:700,queue:false});  
  
   	});  
});

// inhalt scrollen
$(document).ready(function() {
	$('a[href*=#]').bind("click", function(event) {
		event.preventDefault();
		var ziel = $(this).attr("href");
		ziel = 'a[name*='+ziel.substring(1)+']';

        if ($.browser.opera) {
            var target = 'html';
        }else{
            var target = 'html,body';
        }
		$(target).animate({
		
			scrollTop: $(ziel).offset().top
		}, 2000 , function (){location.hash = ziel;});
});
return false;
});
