function setFooterSaveAreaHeight() {
    
    //Nur wenn Elemente .Content (Folgeseiten) vorhanden
    if($('.content')) {
    
        //Berechnen der neuen Höhe für die FooterSaveArea
        newFooterSaveAreaHeight = $('.footerchain').height()+10;
        //Setzen der neuen Höhe
        $('.footersavearea').css("height",newFooterSaveAreaHeight);
    }
    
}

function bind4animate(bindElement,aniElement) {
    $(bindElement).bind('mouseenter mouseleave', function() {
        $(aniElement).animate({
            height: ['toggle','swing']
        }, 500, 'easeOutBounce');
    });
}

function resizeColorImageArea() {
    var sColorWrapHeight = 0;
        
    $('.color-img img').each(function() {
        if(sColorWrapHeight<$(this).height()) {
            sColorWrapHeight = $(this).height();
        }
    });
        
    $('.color-img').css({height: sColorWrapHeight+"px"});
}

function resizeCrossImageArea() {
    var sCrossWrapHeight = 0;
    $('.cross-product-wrapper img').each(function() {
    
        calcHeight = $(this).height()+$(this).next('span').height()+25;
        
        if(sCrossWrapHeight<calcHeight) {
            sCrossWrapHeight = calcHeight;
        }
    });
    
    $('.cross-product-wrapper').css({height: sCrossWrapHeight+"px"});
}




$(window).ready(function() {
    //Navigation drop down    
    $('.topnavigation').mouseenter(function() {
        $('.subnavigation').css({display:"none"});
        navPointIn = $(this).children('.subnavigation');
        //navPointIn.slideDown('slow');
        navPointIn.toggle();
        return 0;
    });
    
    $('.topnavigation').mouseleave(function() {
        navPointOut = $(this).find('.subnavigation');
        //navPointOut.hide();
        navPointOut.toggle();
        return 0;
    });


    //Screensaver drop down
    $('.col-item').mouseenter(function() {
        overlayBoxIn = $(this).children('.col-overlay');
        overlayBoxIn.css("bottom","-88px");
        overlayBoxIn.css("display","block");
        overlayBoxIn.animate({bottom:'0px'},{queue:false,duration:600});
        return 0;
    });
    
    $('.col-item').mouseleave(function() {
        overlayBoxOut = $(this).find('.col-overlay');
        overlayBoxOut.css("display","none");
        return 0;
    });
    
    //Screensaver drop down
    $('.col-item').mouseenter(function() {
        overlayBoxIn = $(this).children('.col-overlay-background');
        overlayBoxIn.animate({bottom:'0px'},{queue:false,duration:300});
        return 0;
    });
    
    $('.col-item').mouseleave(function() {
        overlayBoxOut = $(this).find('.col-overlay-background');
        overlayBoxOut.animate({bottom:'-88px'},{queue:false,duration:300});
        return 0;
    });

    //Value des Suchfelds setzen bei Focus und Blur
    $('#query').bind({
            focus: function() {
                $(this).val('');
            },
            blur: function() {
                $(this).val($(this).attr('value2'));
            }
        }
    );

});
