function beat() {
    var month, date, hours, minutes, seconds, milliseconds, now;

    now = new Date();

    day = now.getDay();
    date = now.getDate();
    month = now.getMonth();
    hours = now.getHours();
    minutes = now.getMinutes();
    seconds = now.getSeconds();
    milliseconds = now.getMilliseconds();

    hours = ((hours < 10) ? "0" : "") + hours;
    minutes = ((minutes < 10) ? "0" : "") + minutes;
    seconds = ((seconds < 10) ? "0" : "") + seconds;

    $('em').removeClass('now');

    $('#d' + date + ',#day' + day + ',#month' + month + ',#h' + hours + ',#m' + minutes + ',#s' + seconds + ',#x' + seconds).addClass('now');
}

function init() {
    setInterval(beat, 1000);
}