jQuery.fn.countdownBigClock = function(future, now) {

    // When the date is in the future change the date to first midnight
    if(future > now) {
        future = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59);
    }

    var $wrapper = $(this);
    var delta = bc_timeDeltaInSeconds(future, now);
    function bc_timeDeltaInSeconds(future, now) {
        return Math.ceil((future.getTime() - now.getTime()) / 1000);
    }

    function bc_formatTimeDelta(delta) {
        if (delta < 0) {
            delta = 0;
        }

        hours = 60 * 60;
        minutes = 60;

        hour_times = Math.floor(delta / hours);
        delta -= hour_times * hours;

        minute_times = Math.floor(delta / minutes);
        delta -= minute_times * minutes;

        return {'hours': hour_times, 'minutes': minute_times, 'seconds': delta};
    }

    function bc_replaceText(hours, minutes, seconds) {
        output = '<strong id="cta-clock-hour">';

		if (hours < 10) { hours = '0'+hours; }
		if (minutes < 10) { minutes = '0'+minutes; }
		if (seconds < 10) { seconds = '0'+seconds; }

        output += hours;
        if(hours == 1) {
            output += ' <span>uur</span></strong> <strong id="cta-clock-min">';
        } else {
            output += ' <span>uur</span></strong> <strong id="cta-clock-min">';
        }

        output += minutes;
        if(minutes == 1) {
            output += ' <span>min</span></strong> <strong id="cta-clock-sec">';
        } else {
            output += ' <span>min</span></strong> <strong id="cta-clock-sec">';
        }

        output += seconds;
        if(seconds == 1) {
            output += ' <span>sec</span></strong> ';
        } else {
            output += ' <span>sec</span></strong> ';
        }

        $wrapper.html(output);
    }

    bc_auto_updater = function autoUpdater() {
        formatted_delta = bc_formatTimeDelta(delta);
        bc_replaceText(formatted_delta['hours'], formatted_delta['minutes'], formatted_delta['seconds']);
        delta -= 1;
        setTimeout(bc_auto_updater, 1000);
    }

    bc_auto_updater();
};
