function startTimer(duration, display, separator) {
    var start = Date.now(),
        diff, minutes, seconds;
    var separatorIcon = separator ? separator : " : ";

    function timer() {
        diff = duration - (((Date.now() - start) / 1000) | 0);
        minutes = (diff / 60) | 0;
        seconds = (diff % 60) | 0;
        minutes = minutes < 10 ? '0' + minutes : minutes;
        seconds = seconds < 10 ? '0' + seconds : seconds;
        display.html(minutes + separatorIcon + seconds);
        if (diff <= 0) {
            start = Date.now() + 1000;
        }
    }
    timer();
    setInterval(timer, 1000);
}
$(document).ready(function() {
    var fiveMinutes = 60 * 5,
        display = $('.time');
    startTimer(fiveMinutes, display);
});
$(document).ready(function() {
    var twoMinutes = 60 * 2,
        display2 = $('.time2');
    startTimer(twoMinutes, display2);
});
$(document).ready(function() {
    var sevenMinutes = 60 * 7,
        display3 = $('.time3');
    startTimer(sevenMinutes, display3);
});
$(document).ready(function() {
    var sevenMinutes = 60 * 5,
        display4 = $('.time4');
    startTimer(sevenMinutes, display4, ' : ');
});