﻿$.fn.extend({
    ajaxLoading: function() {
        if ($(this).css('display') != 'none') {            
            $(this).after($('<img>').addClass("loader").attr('src', '/images/ajax-loader.gif'));
            $(this).css('display', 'none');
        }
    },

    ajaxLoaded: function() {
        $(this).css('display', 'block').next("img.loader").remove();
    }
});