(function($){

    var methods = {
        init: function() {
            var $this = $(this);

            $this.find('#responseContent').html('').hide();
            $this.find('#defaultContent').show();

            $this.find('#nlReg').show();
            $this.find('form').rexxForm({
                success: function(form, data, textStatus, jqXHR) {
                    methods.success($this, data);
                }
            });
        },
        success: function(content, data) {
            var $this = $(this);

            content.find('#defaultContent').hide();
            content.find('#responseContent').html(data).show();

            var t=setTimeout(function(form) {
                content.find('#responseContent').html('').hide();
                content.find('#defaultContent').show();
                $.rexxWindowHide();
            }, 4000);
        }
    }

    $.fn.rexxNlAbo = function(method) {

        // Method calling logic
        if ( methods[method] ) {
            return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
        } else if ( typeof method === 'object' || ! method ) {
            return methods.init.apply( this, arguments );
        } else {
            $.error( 'Method ' +  method + ' does not exist on jQuery.tooltip' );
        }
    }
})(jQuery);
