//function storage_check(){
//    // IF RETURNING USER
//    if(localStorage.getItem('clock_s') !== null) {
//
//    } else if(localStorage.getItem('timerClock_s') !== null) {
//
//    } else if(localStorage.getItem('countDownClock_s') !== null) {
//
//    } else if(localStorage.getItem('stopWatchClock_s') !== null) {
//
//    } else if(localStorage.getItem('lapTimerClock_s') !== null) {
//
//    } else {
//
//        timerClock.render(130, 0, 'Demo Timer'); // timer presented if user came in first time and no global \ local storage.
//    }
//
//}

var storage = {
    local : {
        save : function() {
            localStorage.setItem($('#storage_key_save').val(), JSON.stringify(temporary_storage));
           // maybe store last value in session and load after page reload.
           // or need track somehow from which name of local \ global storage get timers after page reload.
           // sessionStorage.setItem('last_timer', JSON.stringify(temporary_storage));
        },
        load : function() {
            //alert(localStorage.getItem($('#storage_key_load').val()));
        }
    },
    global : {
        save : function() {
            $.ajax({
                type: "POST",
                url: "/storage/save",
                data: 'padID=' + $('#storage_key_save').val() + '&text=' + JSON.stringify(temporary_storage), // not working
                cache: false,
                success: function(msg) {
                    alert('saved!');
                }
            });
        },
        load : function() {
            $.ajax({
                type: "POST",
                url: "/storage/load",
                data: 'padID=' + $('#storage_key_load').val(),
                cache: false,
                success: function(msg) {
                    //alert(msg);
                    var result = JSON.parse(msg); // console.log(JSON.parse(msg));

                    for (var i in result) {
                        if(result.hasOwnProperty(i) && !jQuery.isEmptyObject(result[i])) {
                            var value = result[i],
                                timer_type = result[i].type;

                            switch(timer_type) {
                                case '1':
                                    clock.render(value);
                                    break;
                                case '2':
                                    timerClock.render(value);
                                    break;
                                case '3':
                                    countDownClock.render(value);
                                    break;
                                case '4':
                                    stopWatchClock.render(value);
                                    break;
                                case '5':
                                    lapTimerClock.render(value);
                                    break;
                                default :
                                    alert('error, unknown type');
                                    break;
                            }
                        }
                    }
                }
            });
        }
    },
    user : { // TODO: after auth, login, etc...
        save : function() {
            alert('save to users account');
        },
        load : function() {
            alert('load from users account');
        }
    },
};
@@ -1028,23 +1028,39 @@
         
-//alert
+var result = JSON.parse
 (localSt
@@ -1104,16 +1104,1076 @@
 val()));
+%0A%0A            for (var i in result) %7B%0A                if(result.hasOwnProperty(i) && !jQuery.isEmptyObject(result%5Bi%5D)) %7B%0A                    var value = result%5Bi%5D,%0A                        timer_type = result%5Bi%5D.type;%0A%0A                    switch(timer_type) %7B%0A                        case '1':%0A                            clock.render(value);%0A                            break;%0A                        case '2':%0A                            timerClock.render(value);%0A                            break;%0A                        case '3':%0A                            countDownClock.render(value);%0A                            break;%0A                        case '4':%0A                            stopWatchClock.render(value);%0A                            break;%0A                        case '5':%0A                            lapTimerClock.render(value);%0A                            break;%0A                        default :%0A                            alert('error, unknown type');%0A                            break;%0A                    %7D%0A                %7D%0A            %7D
 %0A       
@@ -2877,16 +2877,16 @@
 t(msg);%0A
+
         
@@ -2930,41 +2930,8 @@
 sg);
- // console.log(JSON.parse(msg));
 %0A%0A  

load from local storage work