(function ($) {
    // Default timer
    var defaultTime = 1500000, // 25 minutes
        pauseTime = 3000,
        userSetTime, //the length of  pomodoro set by user (if different from the default time)
        t = null,
        increase = $('#increase'),
        decrease = $('#decrease'),
        timer = document.getElementById('timer');
    var alarm = new Audio("audio/gong2.wav");
    var clock = new Audio('audio/clock2.mp3');

    function setTime() {
        return timer.innerHTML = msToTime(defaultTime, false);
    }

    function runTimer() {
        defaultTime -= 1000;
        timer.innerHTML = msToTime(defaultTime, true);
        clock.play();
    }

    function runBreak() {
        pauseTime -= 1000;
        timer.innerHTML = msToTime(pauseTime, true);
    }

    // Format milliseconds to hh:mm:ss
    function msToTime(s, seconds) {

        function addZ(n) {
            return (n < 10 ? '0' : '') + n;
        }

        var ms = s % 1000;
        s = (s - ms) / 1000;
        var secs = s % 60;
        s = (s - secs) / 60;
        var mins = s % 60;
        var hrs = (s - mins) / 60;

        return seconds ? addZ(hrs)+ ':' + addZ(mins) + ':' + addZ(secs) : addZ(hrs) + ':' + addZ(mins);
    }

    function pomodoro() {

        if (defaultTime > 0) {
            runTimer();
            if (defaultTime === 0) {
                pauseTime = 3000;

            } else {
                alarm.pause();
            }
        } else {
            clock.pause();
            alarm.play();
            runBreak();
            if (pauseTime === 0) {
                defaultTime = userSetTime;
            }
        }
    }

   increase.click(function () {
        if (t === null && defaultTime < 3600000) {
            defaultTime = (defaultTime + 300000);
            setTime();
        }
    });

    decrease.click(function () {
        if (t === null && defaultTime > 1200000) {
            defaultTime = (defaultTime - 300000);
            setTime();
        }
    });

    $('#start').click(function () {
        if (t === null) {
            t = setInterval(pomodoro, 1000);
            increase.hide();
            decrease.hide();
            userSetTime = defaultTime;
            console.log(userSetTime);
        }
    });

    $('#reset').click(function () {
        clearInterval(t);
        t = null;
        //set time to default value
        defaultTime = userSetTime;
        setTime();
        clock.pause();
        alarm.pause();
        increase.show();
        decrease.show();
    });
    setTime();
})(jQuery);
@@ -2396,32 +2396,45 @@
 me = userSetTime
+%7C%7CdefaultTime
 ;%0A        setTim

Add custom buttons