
//$(document).ready(function() {

$(window).load(function() {
    bannerCount = $(".banner").size();

    if(bannerCount == "1") {
        if (window.location.pathname.length <= 5) //Alleen op HOME/Welkom. Niet bij Subgroepen e.d.
            $('#banners').nivoSlider({
                captionOpacity: 0.6,
                controlNav: false,
                directionNav: false,
                pauseTime: 4500
            });
    } else {
        $('#banners').nivoSlider({
            captionOpacity: 0.6,
            controlNav: true,
            directionNav: false,
            pauseTime: 4500
        });
    }
    $("#banners img").each(function(index, Element){
        if ($(Element).width() > $("#banners").width())
            $("#banners").width($(Element).width());
        if ($(Element).height() > $("#banners").height())
            $("#banners").height($(Element).height());
    });
    $("#banners").css("visibility", "visible");
});

