; (function ($) {
    jQuery.fn.blink = function (options) {
        var defaults = {
            max: 1,
            minOpacity: 0.3,
            speed: 1000,
            keepBlinking: true
        }

        var opt = $.extend({}, defaults, options);
        var me = $(this);
        var cnt = 0;

        startBlinking();

        function startBlinking() {
            if (opt.keepBlinking) {
                me.animate({ opacity: opt.minOpacity }, opt.speed, function () {
                    me.animate({ opacity: 1 }, opt.speed, function () {
                        cnt++;
                        if (cnt != opt.max) startBlinking();
                        else callback();
                    });
                });
            }
        }

        function callback() {
            if(opt.complete && typeof opt.complete == "function")
                opt.complete();
        }

        var blink = {
            stopBlinking: function () {
                opt.keepBlinking = false;
                callback();
            }
        }

        return blink;
    };
})(jQuery);


$(document).ready(function(){

    if (typeof init=='function')
    {
        init();
    }

    setTimeout(function () { $(".nieuw").blink({ max: 0, speed: 600 }); }, 100);
    
    $(".button").hover(
        function () {
            $(this).addClass("button_hover");
        },
        function () {
            $(this).removeClass("button_hover");
        }
    );
    
    $("#nfg").offset({top:$("#kol1").height()-120});
});


