var scrollboxContentHeight = 0;

function scrollbox()
{
    var scrollboxHeight = $(window).height() - $('.scrollbox').offset().top + $(window).scrollTop();

    if (scrollboxHeight > $(window).height())
    {
        scrollboxHeight = $(window).height();
    }

    if (scrollboxHeight < 300)
    {
        scrollboxHeight = 300;
    }

    if (scrollboxHeight > scrollboxContentHeight)
    {
        scrollboxHeight = scrollboxContentHeight 
    }

    $('.scrollbox').height(
        scrollboxHeight
    );
}

$(document).ready(function() {
    //Scrollbox Klasse
    if ($('.scrollbox').length)
    {
        scrollboxContentHeight = $('.scrollbox').height();
        $('.scrollbox').each(function() {
            if ($(this).height() > 300)
            {
                $(this).css('overflow-y', 'scroll');
                $(this).css('overflow-x', 'hidden');
                $(this).height(300);
            }
            else
            {
                $(this).removeClass('scrollbox');
            }
        });

        if ($('.scrollbox').length)
        {
            scrollbox();
            $(window).resize(scrollbox);
            $(window).scroll(scrollbox);
        }
    }
    //Hover Effect
    var HoverEffectSelector = 
        'div.children div.content-view-line_tiny,' +
        'div.children div.content-view-line_small,' +
        'div.children div.content-view-line_medium,' +
        'div.children div.content-view-line_large,' +
        'div.children div.content-view-line_big,' +
        'div.children div.content-view-thumbnail_tiny,' +
        'div.children div.content-view-thumbnail_small,' +
        'div.children div.content-view-thumbnail_medium,' +
        'div.children div.content-view-thumbnail_large,' +
        'div.children div.content-view-thumbnail_big'
    $(HoverEffectSelector).mouseover(function() {
        $(this).addClass('childrenHover');
    });
    $(HoverEffectSelector).mouseout(function() {
        $(this).removeClass('childrenHover');
    });
});