jQuery(function($) {

// Nice Hover Fading ********************************************************************
jQuery(document).ready(function(){
    jQuery.easing.def = "easeInOutSine";

     jQuery('.data-table tr, .data-table tr.alt').bind('mouseenter',function(){

      jQuery(this).stop().animate({
            backgroundColor: "#07161b" }, 1)

    }).bind('mouseleave',function(){

        jQuery(this).stop().animate({
            backgroundColor: "#003854" }, 250)
    });

  });


jQuery(document).ready(function(){
    jQuery.easing.def = "easeInOutSine";

     jQuery('.data-table tr.alt').bind('mouseenter',function(){

      jQuery(this).stop().animate({
            backgroundColor: "#07161b" }, 1)

    }).bind('mouseleave',function(){

        jQuery(this).stop().animate({
            backgroundColor: "#005078" }, 250)
    });

  });


//Preloader
jQuery(window).load(
    function() {
        jQuery('.tab-holder').hide();
        jQuery('.tab-holder').fadeIn('slow');   // Home Page
        });

// Menu ********************************************************************
         function initMenu() {
           $('#menu ul').hide();
           $('.current_page_item').children().show();
           $('.current_page_item').parents().show();

           $('#menu li .arrow').click(
             function() {
                 $(this).next().slideToggle('normal');
               }
             );
           }
         $(document).ready(function() {initMenu();
         });


//navigation ***************************************************************
        var _navLinks = $('ul.main-nav a');
        var _slideDuration = 100;
        _navLinks.hover(function(){
                $(this).animate({marginTop:0},{queue:false, duration:_slideDuration});
        }, function(){
                if (!$(this).parent().is('.active'))
                        $(this).animate({marginTop:12},{queue:false, duration:_slideDuration});
        });

// tabs ********************************************************************
        if (typeof $().tabs == 'function') {
                $('div.tab-holder').tabs({ cache: true });
        }
// bottom-line ********************************************************************
        $('.meta-info').hide();
         $('.open-meta-info').click(function() {
           var toggleLi = $(this);
           var container = toggleLi.parent().parent();
           $('.meta-info', container).slideToggle("70", function() {
             toggleLi.toggleClass("toggled");
           });
           return false;
         });
// Sliding Boxes ********************************************************************
            $(document).ready(function(){
                 //To switch directions up/down and left/right just place a "-" in front of the top/left attribute
                 //Caption Sliding (Partially Hidden to Visible)
                 $('.boxgrid.caption').hover(function(){
                         $(".cover", this).stop().animate({top:'80px'},{queue:false,duration:160});
                 }, function() {
                         $(".cover", this).stop().animate({top:'125px'},{queue:false,duration:160});
                 });

         });
         // Box Klickbar machen ********************************************************************
         $(".boxgrid img").click(function(){
         window.location=$(".boxcaption").find("a").attr("href");
         return false;

         });
// Filterable Content ABCDEFG... ********************************************************************
         $(document).ready(function() {
                 $('ul#filter a').click(function() {
                         $(this).css('outline','none');
                         $('ul#filter .current').removeClass('current');
                         $(this).parent().addClass('current');

                         var filterVal = $(this).text().toLowerCase().replace(' ','-');

                         if(filterVal == 'alle') {
                                 $('ul#cataloge li.hidden').fadeIn('slow').removeClass('hidden');
                         } else {
                                 $('ul#cataloge li').each(function() {
                                         if(!$(this).hasClass(filterVal)) {
                                                 $(this).fadeOut('normal').addClass('hidden');
                                         } else {
                                                 $(this).fadeIn('slow').removeClass('hidden');
                                         }
                                 });
                         }

                         return false;
                 });
         });
});