(function($)
{
    var REFRESH_SERVICES_TIMEOUT = 5000;

    $.ajaxSetup({
        error: function(e, req, options, error)
        {
            $('#url').text(settings.url);
            $('#error').show();
        }
    });

    var needRefreshServices;
    var refreshServices = function()
    {
        refreshServices.timer = null;
        $.ajax({
            url: '/services',
            cache: false
        }).error(function()
        {
            $('#url').text('/services');
            $('#error').show();
        }).success(function(html)
        {
            $('#error').hide();
            $('#services').html(html);
        }).complete(function()
        {
            needRefreshServices(false);
        });
    };

    needRefreshServices = function(now)
    {
        if (refreshServices.timer != null)
        {
            clearTimeout(refreshServices.timer);
            refreshServices.timer = null;
        }
        if (now)
        {
            refreshServices();
        }
        else
        {
            refreshServices.timer = setTimeout(refreshServices, REFRESH_SERVICES_TIMEOUT);
        }
    };

    $('#services').delegate('form.service-action,form.service-signal', 'submit', function(e)
    {
        e.preventDefault();
        $.post($(this).attr('action')).complete(function()
        {
            needRefreshServices(true);
        });
        return false;
    });

    $('#service-refresh-interval').text(REFRESH_SERVICES_TIMEOUT / 1000);

    needRefreshServices(true);
})(jQuery);

@@ -1,18 +1,83 @@
-(function($)%0A%7B
+/*jslint browser: true, forin: true */%0A(function($, window)%0A%7B%0A    %22use strict%22;
 %0A   
@@ -222,15 +222,14 @@
 ext(
-setting
+option
 s.ur
@@ -310,26 +310,39 @@
 Services
+, refreshServices
 ;%0A    
-var 
 refreshS
@@ -799,24 +799,58 @@
   %7D);%0A    %7D;
+%0A    refreshServices.timer = null;
 %0A%0A    needRe
@@ -921,16 +921,17 @@
 timer !=
+=
  null)%0A 
@@ -951,16 +951,23 @@
         
+window.
 clearTim
@@ -1174,16 +1174,23 @@
 timer = 
+window.
 setTimeo
@@ -1647,11 +1647,19 @@
 )(jQuery
+, window
 );%0A

Use ECMAScript strict mode, fix jslint errors.