// Being nice to other libraries

// In here $ is jQuery regardless of what other libraries are used
(function($) {
    
    /* blockUI global overrides */
    $.blockUI.defaults.css.padding            = '5px';
    $.blockUI.defaults.css.cursor            = 'default';
    $.blockUI.defaults.overlayCSS.cursor    = 'default';
    $.blockUI.message                        = '<h1>Please wait...</h1>';
    
 
        
    /* Observe Confirmations */
    observe_confirm = function() {
        var link = this.href;               
        $.ajax({
            url: link, 
            complete: function(html) { 
                $.blockUI({message : html.responseText}); 
            }
        });
        $(document).ajaxStart($.blockUI);

        return false;
    }
    
    init = function() {
        // Add confirmations to delete links
        $('.modal').click(observe_confirm);
        
    }

    $(document).ready(init);
    

})(jQuery);
