jQuery.extend({
        updateSnippet: function (id, html) {
                $("#" + id).html(html);
        },

        netteCallback: function (data) {
                // redirect
                if (data.redirect) {
                        window.location.href = data.redirect;
                }

                // snipeti
                if (data.snippets) {
                        for (var i in data.snippets) {
                                jQuery.updateSnippet(i, data.snippets[i]);
                        }
                }
        }
});

jQuery.ajaxSetup({
        success: function (data) {
                jQuery.netteCallback(data);
        },
        dataType: "json"
});

jQuery.extend({
        updateSnippet: function (id, data) {
                //$("#" + id).html(data);
                $.prompt(data);
        }
});

$(document).ready(function() {
    $('a.ajaxLink').live('click', function () {
        $.get(this.href);
        return false;
    });
});
