CATS.Utils = Classify({
    init: function () {
    },

    add_time: function (date, time) {
        var d = new Date();
        d.setTime(date.getTime() + time * 60 * 1000);
        return d;
    },

    get_time_diff: function (date1, date2) {
        return Math.floor((date2 - date1) / (1000 * 60));
    },

    zeroPad: function (num, places) {
        var zero = places - num.toString().length + 1;
        return Array(+(zero > 0 && zero)).join("0") + num;
    },

    minutes_to_formated_hours: function (min) {
        return Math.floor(min / 60) + ":" + this.zeroPad(min % 60, 2);
    },

    formated_hours_to_minutes: function (h) {
        var time = h.split(":");
        return time[0] * 60 + time[1] * 1;
    },

    proxy_url: function(url) {
        return CATS.Config.proxy_path + encodeURIComponent(url) + '&json=?';
    },

    proxy_get: function(url, callback) {
        CATS.App.utils.json_get(CATS.App.utils.proxy_url(url),
            function(data) { callback($.parseHTML(data.result)); });
    },

    cors_get_content: function(url, callback, type) {
        $.ajax({
            url: url,
            crossDomain: true,
            dataType: type,
        }).done(function(data) {
            console.log("success " + url);
            callback(data);
        })
            .fail(function(a, b, c) {
                console.log("error " + a + b + c);
            });
    },

    cors_get_html: function(url, callback) {
        this.cors_get_content(url, callback, 'html');
    },

    cors_get_xml: function(url, callback) {
        this.cors_get_content(url, callback, 'xml');
    },

    proxy_get_xml: function(url, callback) {
        CATS.App.utils.json_get(CATS.App.utils.proxy_url(url),
            function(data) { callback($.parseXML(data.result)); });
    },

    proxy_get_html: function(url, callback) {
        CATS.App.utils.json_get(CATS.App.utils.proxy_url(url),
            function(data) { callback($.parseHTML(data.result)); });
    },

    proxy_get_json: function(url, callback) {
        CATS.App.utils.json_get(CATS.App.utils.proxy_url(url),
            function(data) { callback($.parseJSON(data.result)); });
    },

    json_get: function (url, callback) {
        $.ajax({
            // Avoid "not well-formed" error when loading JSON from local file.
            beforeSend: function(req) { req.overrideMimeType('application/json'); },
            url: url,
            dataType: 'json'
        }).done(function(data) {
            console.log("success " + url);
            callback(data);
        })
        .fail(function(a, b, c) {
            console.log("error " + a + b + c);
        });
    },
});


@@ -1225,33 +1225,33 @@
 console.log(
-%22
+'
 success 
 %22 + url);%0A  
@@ -1230,33 +1230,33 @@
 le.log('success 
-%22
+'
  + url);%0A       
@@ -1286,29 +1286,16 @@
       %7D)
-%0A            
 .fail(fu
@@ -1297,39 +1297,58 @@
 il(function(
-a, b, c) %7B%0A    
+jqXHR, textStatus, errorThrown) %7B%0A
             
@@ -1363,35 +1363,66 @@
 log(
-%22
+'
 error 
-%22 + a + b + c);%0A    
+' + url + '%5Cn' + textStatus + ': ' + errorThrown);%0A
     
@@ -2540,17 +2540,17 @@
 log(
-%22
+'
 success 
 %22 + 
@@ -2545,17 +2545,17 @@
 success 
-%22
+'
  + url);
@@ -2593,25 +2593,16 @@
       %7D)
-%0A        
 .fail(fu
@@ -2612,15 +2612,38 @@
 ion(
-a, b, c
+jqXHR, textStatus, errorThrown
 ) %7B%0A
@@ -2670,28 +2670,63 @@
 log(
-%22
+'
 error 
-%22 + a + b + c
+' + url + '%5Cn' + textStatus + ': ' + errorThrown
 );%0A 

Improve error logging