

 function loading(){
    $(document)
    .ajaxStart(showLoading)
    .ajaxStop(hideLoading); 
 }
 
 function showLoading(){
     $('#grayness').show();
 }
 
 function hideLoading(){
     $('#grayness').hide();
 }
 
 function setLoadingText(text){
     $("#loadingText").text(text);
 }
 