findfred.userSuspend = (new function() {
    var superClass = findfred;
    
    var suspended_user_id    = null;
    var popup_el            = null;
    
    var suspendAction         = null;
    
    superClass.reg(function() {});

    return {
        showPopup: function(modal_el, user_id) {
            suspend_user_id = user_id ? user_id : null;
            popup_el = modal_el; 
        
            $('.mask').css({'width':$(window).width(),'height':$(document).height()});
            $('.mask').fadeIn(500); 
            $('.mask').fadeTo("slow",0.50);
            
            var winH = $(window).height();  
            var winW = $(window).width();  
            
           // $('#' + modal_el).css('top',  winH/2-$('#' + modal_el).height()/2 - 75);  
            $('#' + modal_el).css('left', winW/2-$('#' + modal_el).width()/2); 
            
            $('#' + modal_el).fadeIn(500);
            $('#' + modal_el).fadeIn(500);
            
            $('.mask').click(function () {  
                $(this).hide();  
                $('#' + modal_el).hide();
            });        
 
        },
        hidePopup: function() {
            $('.mask').fadeOut(500);
            $('#' + popup_el).hide();
        },
        reactivateUser: function(action)  {
            $.ajax({  
                type: "POST",  
                url: action,
                data: { user_id: suspend_user_id }, 
                success: function() {
                    setTimeout(function() {
                       $('.mask').fadeOut(500); 
                       $('#' + popup_el).hide();
                    }, 1000);
                },
                error: function() {
                
                }
            });   
        }
    }
}());


